How to Stop Your AI Agent From Blowing Up Your System
Introduction
AI agents are spreading fast through software engineering and many other fields. The industry seems to be changing overnight, and it can feel as if nobody needs to know how to code any more. Writing code is no longer the main bottleneck in building software. What matters more now is understanding what the system should be: its architecture and its design.
To make this work, we give agents broad permissions. That way they can explore the problem and work out what we want to design, build or tweak. In theory, we can then sit back and sip tea on a beach in the Bahamas without a worry in the world. Believe it or not, that’s what I hoped for at the start of this year.
The problem
We soon found out that’s not how it works. First came the news that someone accidentally deleted their emails while testing OpenClaw. Then others leaked their credentials on GitHub. Suddenly, security became the main worry about agents:
- Will it delete our whole file system?
- Will it steal our secrets and publish them online, or push them to GitHub?
- Will a stranger hijack it and plant a trigger on our machine?
- Will it edit Wikipedia on our behalf and drag our name through the mud?
So the tea on the beach has to wait. We need to arm ourselves for a new challenge. How do we turn an agent into a hard-working employee without letting it blow up our systems? And when something does go wrong, how do we keep the blast radius small enough that we can stay in our seats and just say “oops”?
The solution: three layers of defence
Different companies have proposed many ideas, but most fall into three categories. Each one targets a different threat.
- Sandbox isolation: limit where the agent can act. All of the agent’s actions run inside a small, contained environment. If something goes wrong, the damage stays in the sandbox and doesn’t reach the rest of the system.
- Credential injection: limit what the agent can leak. The agent never holds real credentials, so it has nothing to sneak into files or send anywhere.
- Egress control: limit what goes in and out. All network traffic from the sandbox is monitored and checked. This helps us catch malicious files or prompts trying to get into or out of the sandbox, which is one of the most critical risks reported in agent engineering.
How companies are doing it
Grab uses all three layers. It treats every agent as an untrusted workload, and each agent gets its own Kubernetes namespace, service account, storage and network policy. Agents only ever see placeholder credentials. A proxy swaps in the real secret on the outbound request, and all egress passes through Envoy plus an Open Policy Agent policy check (Grab — Palana).
Cloudflare, Duolingo and Block focus on identity. Instead of building walls around the agent, they make sure it can never do more than the person using it:
- At Cloudflare, agents can’t exceed the permissions of the user who invoked them. Prompt injection is handled by sanitising untrusted content with boundary tags (Cloudflare).
- Duolingo applies the same rule to its Slack bot: “the bot should not be a way around existing permissions; access follows job roles” (Duolingo).
- Block’s goose inherits the calling user’s access controls, so the blast radius is limited to what that person could already do (Block).
Others are tackling the problem at a deeper level. Anthropic has published how it sandboxes agents across its own products (Anthropic — How we contain Claude). Google DeepMind’s CaMeL tries to solve prompt injection by design: it separates trusted control flow from untrusted data instead of trying to filter bad input (DeepMind CaMeL, via Simon Willison).
Ongoing problems
None of this solves every security problem. Grab-level isolation is expensive and complex, and even Grab’s own write-up suggests most teams couldn’t rebuild it. No company claims that prompt injection is fully solved.
Even with all these layers, a determined agent can still find a way out. OpenAI recently reported an agent that used DNS to reach an external chatbot and escape its sandbox. I don’t yet understand how DNS can carry messages from a sandbox to the outside world, but it shows that every wall has gaps.
Conclusion
Agents can do a lot of work for us, but only if we stop them from causing damage along the way. Sandbox isolation, credential injection and egress control are the three main ways to keep the blast radius small. Identity-based permissions add another safety net. You don’t need Grab’s platform to start: run your agent in a container, keep real secrets out of its reach, and limit where it can send traffic. Agents will keep finding new ways out, so treat security as ongoing work. As for my tea on a Bahamas beach, it’s not happening this year.