Agentscore
Sandboxing
Run model-generated code and actions where a mistake can’t hurt anything.
What it is and why it exists
Agents that execute code, shell commands or browse need isolation: containers or micro-VMs with no secrets, limited CPU/memory/time, restricted network egress and a disposable file system. The sandbox turns “the model ran rm -rf” into a non-event.
Quick prototype
exec() in your server process (don’t).
In production, at scale
Ephemeral micro-VMs or gVisor containers per session, egress allow-lists, no cloud credentials inside, resource limits, file system snapshots, and audit logs of every command.
Vendors and tools
| E2B / Modal / Daytona | Hosted code sandboxes for agents |
|---|---|
| Firecracker / gVisor | Micro-VM and container isolation |
| Pyodide / WebAssembly | In-browser or in-process isolation for simple code |
On AWS: Bedrock AgentCore Code Interpreter; Lambda or Firecracker-based isolation; ECS tasks with no task role.
How it fails
- Sandbox with full internet access, so code exfiltrates data
- Credentials mounted into the sandbox
- No timeout — infinite loops burn compute
What the interviewer asks next
What does “unexpected code execution” (OWASP Agentic ASI05) look like?
The agent writes or is tricked into running code with more privilege than intended — in your app server, with your credentials. Isolation and least privilege contain it.