GlossaryGuardrails and control
Defense in depth
Definition: Defense in depth is the practice of protecting a system with several independent layers of control, so that what one layer misses another can stop.
The practice assumes that any single control can fail. The glossary of the US National Institute of Standards and Technology (NIST) lists several definitions taken from NIST publications. One, from the NIST report NISTIR 8183, a cybersecurity profile for manufacturers, describes “the application of multiple countermeasures in a layered or stepwise manner to achieve security objectives”, with different security technologies layered “to ensure that attacks missed by one technology are caught by another” (NIST glossary). A second definition in the same glossary, from NIST’s catalog of security and privacy controls (Special Publication 800-53), calls defense in depth a strategy that “integrates people, technology, and operations capabilities to establish variable barriers across multiple layers and missions of the organization”.
For an AI agent, some layers can be ordinary software outside the model and others can use AI models. In Google’s Approach for Secure AI Agents (May 2025), Google advocates “a hybrid, defense-in-depth strategy” with two layers. The first is what Google calls policy engines: software outside the model that checks each action against predefined rules before it is executed. The second is defenses that use AI models to judge inputs, outputs or the agent’s reasoning. The paper says the second layer “cannot provide absolute guarantees” and has to work together with the first. Other entries in this glossary describe controls that can serve as layers: least privilege, sandboxing and guardrails.
For example, a trading agent may be set up so that the AI model never sees the exchange API key, and the key itself has no permission to withdraw funds. If a prompt injection tells the model to send the key to an attacker, the model has no key to send. If the key is exposed some other way, it still cannot be used to withdraw funds. The second limit holds whether or not the first one does. A key that could withdraw, although trading never needs that permission, would be a case of excessive agency, a separate entry.
Mangrove Agent’s Kraken setup applies both limits to a user’s API key for Kraken, a centralized exchange. The user enters the API key in a terminal with the input hidden, never in the chat, so the AI model does not see the key and receives only a short-lived reference to it. The setup also tells the user to create the key with Withdraw Funds turned off, and tells the agent not to continue with a key that has it turned on.
The term is also used outside computing. In nuclear safety, the US Nuclear Regulatory Commission describes defense in depth as creating “multiple independent and redundant layers of defense to compensate for potential human and mechanical failures so that no single layer, no matter how robust, is exclusively relied upon” (NRC glossary). The same holds for software. The NIST definition above calls for layering “heterogeneous” security technologies, meaning technologies of different kinds, and two checks that run in the same program can both be lost in one failure.
