2 min read|Last updated: February 2026

What is Defense in Depth?

TL;DR

Defense in Depth defense in depth is a security strategy that layers multiple protective controls, so if one fails, others still provide protection. For AI agents, this means combining input validation, behavioral monitoring, sandboxing, and other controls to create comprehensive security.

What is Defense in Depth?

Defense in depth is a security principle that advocates for multiple layers of protection rather than relying on any single security control. The core insight is that any individual security measure can fail—it might be bypassed, misconfigured, or face an attack it wasn't designed for. By layering multiple independent controls, defense in depth ensures that an attacker must defeat multiple defenses to succeed, dramatically reducing the likelihood of a complete breach. For AI agents, this means combining multiple approaches to security throughout the system.

How Defense in Depth Works

Defense in depth implements security controls at multiple layers: perimeter controls (input validation, content filtering), process controls (permission management, sandboxing), detection controls (behavioral monitoring, anomaly detection), and response controls (alerting, automatic remediation). Each layer operates independently, so a failure at one layer doesn't compromise others. The layers should be diverse—using different techniques and technologies—so a single vulnerability or attack technique can't defeat multiple layers simultaneously. Regular testing verifies that each layer functions correctly.

Why Defense in Depth Matters

No single security control is perfect. Input validation might miss novel prompt injection techniques. Sandboxing might have escape vulnerabilities. Behavioral monitoring might have blind spots. By layering controls, defense in depth creates robust security that degrades gracefully rather than failing catastrophically. For AI agents—which face novel and evolving threats—this resilience is essential. Defense in depth also provides time to detect and respond to attacks, as attackers must work through multiple layers.

Examples of Defense in Depth

An AI agent has defense in depth: content filtering screens inputs, the LLM has built-in safety measures, tool access requires permissions, sandboxing limits what tools can do, behavioral monitoring watches for anomalies, and network monitoring prevents unauthorized external communications. An attacker might bypass one layer but faces additional obstacles at each subsequent layer. When a new attack technique defeats input filtering, the other layers still provide protection while the filter is updated.

Key Takeaways

  • 1Defense in Depth is a critical concept in AI agent security and observability.
  • 2Understanding defense in depth is essential for developers building and deploying autonomous AI agents.
  • 3Moltwire provides tools for monitoring and protecting against threats related to defense in depth.

Written by the Moltwire Team

Part of the AI Security Glossary · 25 terms

All terms

Protect Against Defense in Depth

Moltwire provides real-time monitoring and threat detection to help secure your AI agents.