What it means to contain an AI agent: sandboxes, least privilege and a way to stop it
AI agents act, not just answer. Government cyber agencies say they should run in sandboxes with minimum access, close monitoring and people able to interrupt them. Here is what that means.
An AI agent is software that does things, not only says things. It can run code, use websites, send messages or move money. That makes it useful. It also means that when an agent goes wrong, it can do something, not just give a wrong answer. “Containing” an agent means setting up its surroundings so that a mistake stays small and people can step in.
In 2026, six cyber security agencies from five countries published joint guidance on this. The authors are agencies from Australia, Canada, New Zealand, the United Kingdom and the United States, including the US Cybersecurity and Infrastructure Security Agency (CISA) and the UK National Cyber Security Centre (NCSC). This explainer draws on that guidance.
1. A sandbox: a closed space to work in
A sandbox is a separate, walled-off computing environment. What happens inside it should not reach real systems outside. The joint guidance recommends building agent systems “in a secure, sandboxed environment” and using sandboxes “to test agent behaviour before production deployment”, meaning before the agent is used for real work.
This is different from a regulatory sandbox, which is a supervised legal space for testing new products. A technical sandbox is about walls in the computer system itself.
2. Least privilege: only the access it needs
Least privilege means giving an agent the minimum access needed for its task, and nothing more. The UK NCSC puts it simply: “give agents only the minimum access they need, for the shortest time required.” In practice that can mean temporary passwords or keys that expire, a short list of approved tools, and never giving an agent open access to sensitive data or critical systems.
3. Limiting the “blast radius”
Security teams talk about the blast radius of a failure: how far the damage can spread. The joint guidance recommends “isolation and segmentation to limit blast radius”. This means dividing systems so that an agent working in one part cannot reach the others. The guidance also says agents should not be able to change the logs that record what they did.
4. Watching what it does
Containment needs monitoring. The guidance calls for comprehensive logs and real-time monitoring of what agents do and decide, including their internal steps, not only what goes in and comes out. It also suggests rules that automatically cut an agent’s permissions when it starts behaving unexpectedly.
5. A person who can stop it
The last layer is human. The guidance says agents should not carry out high-impact actions without prior human approval, should stop and escalate to a person when uncertain, and should allow live monitoring and interruption while a task is running. The NCSC adds that organisations should decide in advance who can stop an agent, and that response plans should cover loss of control.
The NCSC’s summary test is a good one for anyone: “If you cannot understand, monitor or contain an agent’s actions, it is not ready for deployment.”
Why this matters for people staying in charge
None of these steps is new on its own. Together, they turn “the agent should behave” into “if it does not, the damage stays small and someone can stop it”. Containment matters during testing as much as in daily use, because new and unproven systems are the ones most likely to surprise their makers.
These ideas map onto the Humasure Directives. Staying within set limits is D2 Bounded autonomy. Being able to halt the system is D1 Always stoppable. Sandboxes, least privilege and monitoring are part of D6 Secure and supported, and logs that show what happened support D9 Accountable. For questions to ask before you let any agent act for you, see our questions to ask page and our security page.
Sources
- Australian Signals Directorate's Australian Cyber Security Centre and partners: Careful adoption of agentic AI services (PDF, May 2026)
- UK National Cyber Security Centre: Thinking carefully before adopting agentic AI (PDF, May 2026)
- Canadian Centre for Cyber Security: Joint guidance on the careful adoption of agentic artificial intelligence services
Written with AI assistance and checked against our editorial and brand standards. Spotted an error? Tell us and we will correct it publicly. Our editorial standards.