On the host
Full accessThe agent runs with the developer’s own access. A note in its task tells it to read the access token and send it to an outside address.
customer data and the access token sent out to attacker.example.
Module 15 · Agent sandboxing
When an agent runs code to do its work, a planted instruction can make that code read your files or send your data away. A sandbox is a box the operating system holds the code inside: it decides which files the agent sees and which servers it can reach, from outside the model, so it holds even when the agent is taken over.
The whole idea in one example
The agent runs with the developer’s own access. A note in its task tells it to read the access token and send it to an outside address.
customer data and the access token sent out to attacker.example.
fetch to attacker.example
The token went out. On the host there was nothing to stop it.
In a sandbox the same note changes nothing: the token is kept by a gatekeeper (a proxy) outside the box, the outside address is not on the list of allowed servers, and the moves are refused. The agent’s turns are recorded, written to illustrate the sources below; the sandbox is a model (no real code runs), and its checks and the outcome are computed in your browser.
How it works
The same task, held inside a box the operating system enforces
In Anthropic’s October 2025 design, the file wall lets the agent read or change only specific folders.
Source, checked 30 October 2026
What it can read and write, and where it can reach
In Anthropic’s design, the network wall lets the agent connect only to approved servers, so a taken-over agent cannot leak private data or download malware.
Source, checked 30 October 2026
A request to an allowed server can carry data out
Allowing broad domains such as github.com can create paths for data exfiltration, because the proxy makes its allow decision from the client-supplied hostname without inspecting the encrypted connection's contents.
Source, checked 30 October 2026
The story
Larkspur Supply Co.’s agent now runs code to do its work, so where it runs and what it can reach decide what a compromised agent can do. You’re on the team that decides which sandbox settings it runs with.
New to Larkspur’s agent, or to planted instructions (prompt injection)? The AI agents module builds what this one defends.
New to Larkspur’s agent, or to planted instructions (prompt injection)? The Prompt injection & guardrails module builds what this one defends.
Your path

Chapter 1 · done
What changes when the same attack runs on the host, then in a sandbox?


Chapter 3 · done
With egress off, then an allow-list through a proxy, what can the agent reach?

Chapter 4 · done
With the egress open, does moving the secret out of the sandbox stop it being stolen?

Chapter 5 · done
If the agent can reach only Larkspur’s own host, can an attack still get data out?

Chapter 6 · done
With a sandbox boundary, which actions still need a person, and which can run freely?

Chapter 7 · done
Which sandbox policy stops every attack and still lets every ordinary task run?
Product managers, engineers and analysts whose AI agent runs code or tools that can touch files and the network. No code needed. Play AI agents and Guardrails first if agents and planted instructions (prompt injection) are new to you.