Lesson 6 of 6·9 min read

Security Operations

Architecture and policies are the foundation — but security only emerges through daily operations. Security Operations (SecOps) for AI means: continuous monitoring, automated response, and a security culture that includes the entire team.

Continuous Monitoring

What You Need to Monitor

An AI security dashboard should display these metrics in real time:

Security metrics:

  • Prompt injection attempts per hour/day (trend)
  • PII detections in input and output
  • Jailbreak attempts and success rate
  • Anomalous usage patterns (deviation from baseline)

Operational metrics:

  • Model latency (sudden increase = possible DoS)
  • Token consumption per user/team (cost anomaly detection)
  • Error rate (sudden increase = possible attack or system error)
  • Guardrail trigger rate (how often do security filters activate?)

Compliance metrics:

  • GDPR requests (deletions, inquiries) in the AI context
  • Audit log completeness
  • Policy compliance score per team

Monitoring Stack

ComponentTool ExamplesFunction
Log aggregationElastic, Datadog, SplunkCentral prompt/response logs
AlertingPagerDuty, OpsGenieReal-time notification for incidents
DashboardsGrafana, KibanaVisual overview of all metrics
TracingLangSmith, Langfuse, HeliconeLLM-specific tracing and debugging

Threat Detection & Automated Response

Detection Rules

Automated threat detection:

  • Prompt injection patterns: ML classifier + rule engine scan every input
  • Data exfiltration signals: Unusually detailed responses, Markdown links in outputs, Base64 strings
  • Account compromise: Sudden behavioral change of a user (different topics, different times)
  • Model degradation: Quality loss in responses (possible poisoning)

Automated Response Playbooks

Playbook 1 — Prompt injection detected:

  1. Block request → 403 Forbidden
  2. Add user session to watchlist
  3. Alert security team
  4. Apply enhanced scrutiny to user's next 10 requests

Playbook 2 — PII leak detected:

  1. Block response → generic error message
  2. Automatically create incident in ticketing system
  3. Identify affected data
  4. Escalate to Data Protection Officer

Playbook 3 — Cost anomaly:

  1. Temporarily reduce user/team token budget
  2. Alert team lead and FinOps
  3. Analyze usage patterns (shadow AI? Attack? Code bug?)

Compliance Auditing

Continuous Compliance

Instead of annual audits — continuous compliance checks:

  • Automated policy checks: Are all prompts logged? Is PII filtering active? Are rate limits configured?
  • Configuration drift detection: Was a guardrail deactivated? Did someone change the system prompt?
  • Access reviews: Who has access to which models? Are permissions still correct?
  • Data retention: Are logs and training data deleted according to GDPR timelines?

Security Scoring

An AI Security Score aggregates all metrics into an overall picture:

AreaWeightMeasurement
Prompt security25%Injection defense rate, guardrail coverage
Data protection25%PII leak rate, encryption status
Access control20%RBAC coverage, anomaly rate
Monitoring15%Log coverage, alert response time
Incident response15%MTTR, playbook coverage

Rating: A (90–100), B (75–89), C (60–74), D (< 60 — immediate action required)

Team Training & Security Culture

Security Awareness for AI

Every employee using AI tools needs a basic understanding:

  • Onboarding: 30-minute training on AI security basics (prompt injection, data classification)
  • Monthly updates: Newsletter with current threats and best practices
  • Phishing simulations: Prompt injection simulations for developers and power users
  • Responsible use policy: Clear rules on what data may be entered into AI tools

Roles and Responsibilities

  • AI Security Lead: Responsible for security architecture, policies, and incident response
  • AI Red Team: Continuous testing of own systems
  • Developers: Security by design — every LLM integration with guardrails
  • End users: Awareness, no sensitive data in prompts, report anomalies

Culture beats technology: The best security architecture fails if employees copy sensitive data into ChatGPT. Invest at least as much in training as in tooling.

📝

Quiz

Question 1 of 3

Was ist der erste Schritt im Automated Response Playbook bei einer erkannten Prompt Injection?