Creative Genius Creative Genius
Lesson 2 of 2 · 18 min read

Defense in Depth

There's no single fix. There's a stack of mitigations that together get you to safe.

The five-layer model:

  1. Input filtering. Strip obvious injection patterns. Use tools like LlamaGuard 3 or Azure AI Content Safety.
  2. Privilege separation. Tools that touch sensitive data require human-in-the-loop confirmation, not just an LLM decision.
  3. Output filtering. Scan responses for sensitive patterns (CC numbers, SSNs, internal hostnames) before sending.
  4. Sandboxed tools. Code execution in Firecracker / e2b / Modal sandboxes — never on your prod box.
  5. Audit logging. Every tool call gets logged, alarmed, and reviewed.
← What Prompt Injection Actually Is Back to course