R305 · Agent principles and patterns › Formal constraints on agent actions

Strands Box: OS containment plus a policy language, not a virtual machine

Read the original

agent-securitysandboxingagent-harnesspolicy

Sources: AWS Open Source Blog, "Introducing Strands Box: AI agent sandboxes powered by Dogwood", Fernando Dingler (Principal Engineer, AWS Strands team), 7 October 2026; and the strands-agents/box README. Apache-2.0.

What it is

An open-source sandbox engine for coding agents, in developer preview, that pairs operating-system isolation with a policy engine evaluating each action the agent attempts. AWS frames it against the two things developers currently choose between: running an agent with permission prompts on, which is slow and judges the tool call rather than its effect, or running it in "YOLO mode" and hoping.

The design choice worth noting first is what it is not. The blog has a section headed "Why not containers or microVMs?" and answers that the team wanted agents to "operate within a developer's existing environment, without having a separate guest operating system" — while granting that microVMs offer the stronger isolation boundary. Containment here is macOS Seatbelt, enforced by the host kernel. This is a sandbox in the browser sense, not the VM sense.

The two layers

Containment. OS-level isolation. Filesystem and workspace grants declared in box.toml are enforced by the host OS directly. Note the consequence: those grants bypass the policy engine entirely and "do not produce individual Dogwood decisions", so anything the agent reads through a direct grant leaves no trace in the policy history.

Policy. Dogwood — a separate open-source policy language in Cedar syntax with temporal operators, plus a local engine that evaluates policies against the requested action and the recorded history. Rules are permit or forbid over a principal, action and resource, with a when clause. Checked operations are denied by default: a matching permit must allow, and a matching forbid overrides it.

Policy is not applied in one place. There are four enforcement points: the network egress gateway, a Python interpreter (Monty), a shell interpreter (Strands Shell), and a broker for MCP servers. Actions carry names like shell:spawn, http:request / http::response, fs:read and fs:delete, with context fields such as program_path, host, port, method and path.

The interesting architectural trade

The interpreters and gateways run outside the sandbox, and the blog is candid that this widens the trusted computing base. That is the price of enforcing from outside the agent process: a policy check that ran inside the sandbox could be reasoned about by the thing it governs. Here the shell and Python interpreters are hoisted out so decisions are made somewhere the agent cannot reach — and in exchange, those components are now part of what you must trust.

Egress, and what the gateway can actually see

All outbound traffic goes through a proxy. Per request it sees host, port, method and path, raises an http:request decision, and forwards only what policy permits. A denial returns HTTP 403 with the body policy denied this operation, naming the rule by its @id and carrying its @description — a small thing that matters a lot when you are debugging why your agent is stuck.

Credential handling is the strongest part of the design. The agent receives a placeholder token; the gateway substitutes the real secret before forwarding a permitted request, so "the real secret never enters the agent's environment". Injection modes include bearer token, custom header, Basic, query parameter and AWS SigV4. A credential binding grants no network reach on its own — every destination still needs its own permit.

Two limits on the egress model are worth being precise about, because they bound what policy can express:

Rate limits

Dogwood's temporal operators make counting possible, and the blog claims the shape generalises: "the same rule shape expresses any count, cooldown, or ordering constraint." The one worked example caps Slack chat.postMessage at three calls per 10 minutes, built as a permit plus a forbid using formerly within 10m and a count over http::response events with status 200 — counting successful responses, not attempts, which is the right default and an easy thing to get wrong by hand. Any other cap is plausible but undemonstrated.

Failure modes to design around

  1. The gap between containment and policy. Direct filesystem grants are OS-enforced and invisible to the policy log. An auditor reading records.jsonl sees an incomplete picture of what the agent touched.

  2. Enforcement-point coverage is the real boundary. Policy governs what passes through the four interpreters and the gateway. The blog says plainly: "Over time, we want policy to cover more of what the agent does." Anything outside those paths is governed only by OS containment.

  3. External programs and local MCP servers. They cannot send requests to Box's interpreters, and their network traffic goes through the gateway by default — but their process behaviour is not policy-checked. macOS 27 Endpoint Security is named as the intended fix, which is to say the current answer is incomplete.

  4. Widened TCB. The interpreters, the gateway and the broker are now security-relevant software you did not write.

  5. No baseline policy yet. A CLI to generate a recommended default policy is planned, not shipped. Until then the default-deny model means you author every permit by hand, and the practical failure is a policy so permissive it approves everything.

Review checklist before adopting

Current scope

Developer preview. Local execution on macOS with Apple silicon only; macOS 15 or later, Node.js 22.21 or later, and model access in one region. Expanding OS support is the stated next priority, with the caveat that each operating system offers different isolation primitives that must still preserve the containment guarantee. Packaging for deployed agents — named targets include framework SDKs — is future work. No threat model, startup-latency or overhead numbers are published.

Connections

See R305 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.