Part 7 · Agentic AI Security
Defense in Depth
No single defense stops everything, so strong systems stack layers that each cover the others' gaps.
Key concepts
The defense stack, in request order:
| # | Layer | What it does | Main risks |
|---|---|---|---|
| 1 | Identity and access | Knows who is asking, enforced in code | LLM02, ASI03 |
| 2 | Input guardrails | Classifiers, redaction, size limits | LLM01, LLM02, LLM06 |
| 3 | Context controls | Permission-aware retrieval, provenance, no secrets | LLM02, LLM05, LLM08, LLM09 |
| 4 | The model | Safety training, with prompts as guidance only | LLM01, LLM07 |
| 5 | Action controls | Least privilege, sandboxing, approval | LLM03, ASI01–ASI05 |
| 6 | Output guardrails | Validation, encoding, scanning | LLM10, LLM07, LLM02 |
| 7 | Monitoring and response | Logs, alerts, kill switch, playbook | LLM06, ASI08, ASI10 |
Red teaming and security evals run continuously alongside the stack.
Independent layers along a request's path each catch failures the others miss.
Formal view and evidence
- Established. If layer failures were independent, the chance an attack passes all layers would be . Real layers often share failure modes, so this figure usually overstates the protection, and adaptive attackers deliberately seek correlated weaknesses.
- Debated. How to quantify residual risk for probabilistic systems.
- Open problem. Standardized, comparable security assurance for AI agents.
Launch checklist
- If an injection succeeds, can it do anything irreversible?
- Can the model see data the current user may not see?
- Are there secrets in prompts, schemas, or retrieved context?
- Is every tool necessary and minimally scoped?
- Do high-impact actions need meaningful human approval?
- Is output encoded or validated before use?
- Do we know the source and version of every component?
- Are rate limits, token caps, and budget alerts active?
- Are tool calls logged with the identity behind them?
- Do adversarial evals run on every change?
Common misconception
Common belief
"We bought a guardrail product, so we're covered."
In practice
Guardrails catch some attacks. Architecture decides how much damage the rest can do.
Key takeaways
- No single control stops every attack.
- Layers should cover identity, input, context, actions, output, and monitoring.
- Architecture determines how much damage a successful attack can cause.