Security Incident Runbook
Security-specific incident containment and forensics playbook. Covers prompt injection, data exfiltration, credential exposure, and cross-tenant breach scenarios.
Trigger Conditions
Run this playbook when any of the following are detected:
- prompt injection attempts with possible tool execution,
- data exfiltration attempts,
- credential exposure in logs/output,
- suspected cross-tenant data access.
Immediate Containment
- Declare security incident and assign incident commander.
- Scope impact (tenant(s), workflow IDs, time window, affected systems).
- Isolate active threat path:
- pause/terminate affected workflows,
- disable affected tenant if cross-tenant risk exists,
- block suspicious MCP/tool endpoints.
Scenario Procedures
Prompt Injection Detected
- Inspect audit trail for injected payload and resulting actions.
- Confirm whether tool execution actually occurred.
- If execution occurred, inspect side effects and outbound calls.
- Tighten sanitization/output filters and tool allowlists before resuming.
Verification:
- No ongoing malicious prompts executing tools.
- Updated policies prevent replay of same payload.
Data Exfiltration Attempt
- Review network egress and tool call outputs.
- Confirm whether sensitive data left the boundary.
- Restrict egress/network policy and block abusive endpoints.
- Preserve forensic artifacts (audit exports, traces, logs).
Verification:
- Suspicious egress no longer present.
- Output filters redact/deny sensitive payloads as expected.
Credential Exposure
- Identify exposed credential(s) and blast radius.
- Rotate credentials immediately (LLM provider keys, DB creds, API tokens).
- Revoke old credentials and verify no residual access.
- Audit historical access with compromised key window.
Verification:
- New credentials active and old credentials invalid.
- No further auth using compromised credentials.
Cross-Tenant Breach Suspected
- Isolate affected tenant(s) and disable write paths if needed.
- Validate RLS/session tenant binding and tenant middleware behavior.
- Check audit chain continuity for impacted tenants.
- Run focused regression checks for tenant-scoped queries.
Verification:
- No cross-tenant rows visible from tenant-scoped contexts.
- RLS enforcement checks pass for affected tables.
Post-Incident Actions
- Complete incident report with timeline, impact, and root cause.
- Notify stakeholders per policy/compliance requirements.
- Add preventive controls:
- stronger allowlists,
- stricter network policy,
- improved anomaly alerts,
- regression tests for discovered gap.
Escalation Path
- On-call engineer -> Security lead -> Incident commander.
- Engage legal/compliance for confirmed data exposure.
- Engage platform/database owners for infrastructure-level containment.