Defence in Depth for an LLM Application or Agent

Defence in Depth for an LLM Application or Agent An architecture diagram generated by Archify. Users · employees, customers · Architecture component Users employees, customers AI gateway · auth, limits, guardrails · Enterprise trust boundary AI gateway auth, limits, guardrails Authorisation · OPA / Cedar, approvals · Enterprise trust boundary Authorisation OPA / Cedar, approvals Audit + evals · traces, red-team results · Enterprise trust boundary Audit + evals traces, red-team results LLM app / agent · prompts, planner · Enterprise trust boundary LLM app / agent prompts, planner Retriever · ACL-filtered vectors · Enterprise trust boundary Retriever ACL-filtered vectors Model · hosted or self-hosted · Architecture component Model hosted or self-hosted Tools via MCP · scoped credentials · Enterprise trust boundary Tools via MCP scoped credentials prompt authorise screened inference as user tool call trace Enterprise trust boundary Legend Backend Database Cloud Security External

Untrusted input

  • • Prompts, documents and tool output can all inject

Least agency

  • • Scoped tools, human approval for risky actions

Observe + test

  • • Trace everything, red-team before release
© 2026 Samir Kumar Sahoo. All rights reserved.