AG-808

Agent Code-Execution Sandbox Isolation

Infrastructure, Platform & Network ~6 min read AGS v2.1 · 2026-06-06
EU AI Act NIST AI RMF ISO 42001

AGS Agentic Runtime | Infrastructure, Platform & Network | Version 2.2

1. Definition

Agent Code-Execution Sandbox Isolation governs the requirement that code an agent generates, interprets, or executes — and the tools it invokes that run code — does so inside a strongly isolated environment (e.g. a microVM or hardened container) with constrained filesystem, network, and host access, so that a compromised or misbehaving agent cannot escape to the host or pivot into the wider environment.

Agents increasingly write and run code, execute shell/tool commands, and call MCP servers; any of these can be turned into remote code execution via prompt injection or unsafe output handling. This dimension is the containment boundary that bounds the blast radius of agent code execution, distinct from policy-simulation sandboxes (AG-275) used for testing governance rules.

2. Scope

In scope: isolation of agent-generated/executed code and code-running tools; filesystem/network/host egress constraints; per-task ephemeral execution environments; escape-resistance and new-agent provisional sandboxing.

Out of scope: policy-simulation sandbox (AG-275), tool schema integrity (AG-370), and compute budgeting (AG-807). This dimension governs *runtime execution isolation*.

3. Why This Matters

Code execution is the highest-severity agent capability: an injected instruction that reaches a code tool can become host compromise, data exfiltration, or lateral movement. Strong, ephemeral isolation ensures that even a fully-subverted agent's code runs in a disposable, least-privileged cell with no path to the host or sensitive networks — turning a potential breach into a contained, discardable incident.

4. Requirements

5. Maturity Model

6. Test Criteria

Test 6.1: Host Isolation

Test 6.2: Egress Control

Test 6.3: Ephemerality

7. Scoring

ScoreCriteria
0Agent code executes on a shared host with ambient privilege
1Basic container isolation; egress not default-deny; state persists
2Strong isolation, default-deny egress allow-list, least-privilege, escape detection, logging
3Ephemeral per-task microVMs, provisional sandboxing, evaluated escape-resistance, capability-sized containment

8. Failure Scenarios

Scenario A — Prompt-Injection RCE: A document the agent processes contains an injected instruction that reaches its code tool and runs a reverse shell. Because execution was strongly sandboxed with default-deny egress, the shell cannot connect out and the disposable cell is destroyed — the breach is contained.

Scenario B — Host Pivot: An agent's code tool runs on the orchestrator host; a single exploit yields host access and lateral movement into production. MicroVM isolation would have bounded the compromise to a throwaway environment.

Scenario C — Persistent Implant: Without ephemeral environments, an attacker plants a payload in the shared sandbox that affects later tasks. Per-task disposable environments would have erased it.

9. Regulatory Mapping

RequirementEU AI ActNIST AI RMFISO 42001
R1: Strong execution isolationArt. 15 — Cybersecurity, robustnessMANAGE 2.3 — Recovery from unknown risksClause 8.1 — Operational control
R2: Least-privilege environmentArt. 15 — CybersecurityMEASURE 2.7 — Security and resilienceA.6 — AI system lifecycle
R3: Default-deny egressArt. 15 — CybersecurityMEASURE 2.7 — Security and resilienceClause 8.1 — Operational control
R4: Ephemeral per-task environmentsArt. 15 — RobustnessMANAGE 2.3 — RecoveryA.6 — AI system lifecycle
R5: Provisional sandboxing of new agentsArt. 9 — Risk managementGOVERN 1.3 — Risk-based activityClause 6.1 — Actions to address risk
R6: Escape-attempt detection/escalationArt. 15 — CybersecurityMEASURE 2.4 — Production monitoringClause 9.1 — Monitoring and measurement
R7: Scoped short-lived secretsArt. 15 — CybersecurityGOVERN 6.1 — Third-party riskA.4 — Resources for AI systems
R8: Evaluated escape-resistance, patchedArt. 15 — CybersecurityMEASURE 2.7 — Security and resilienceClause 10.1 — Continual improvement

EU AI Act — Article 15 and Article 14

Article 15 requires cybersecurity and resilience to attempts to exploit vulnerabilities; strong execution isolation is the containment control for agent RCE. Article 14 (human oversight) is supported because contained execution keeps incidents recoverable and reviewable.

NIST AI RMF — MANAGE 2.3, MEASURE 2.7

MANAGE 2.3 (recovery from unknown risks) and MEASURE 2.7 (security and resilience) frame sandboxing as a containment-and-recovery control for the highest-severity agent capability.

ISO 42001 — Clause 8.1, A.6

Clause 8.1 (operational control) and Annex A.6 (AI system lifecycle — responsible operation) require controlled, isolated execution environments for agent code.

Cite this protocol
AgentGoverning. (2026). AG-808: Agent Code-Execution Sandbox Isolation. The Protocols of AI Agent Governance, AGS v2.1. agentgoverning.com/protocols/AG-808