How strands-agents/box works
Strands Box is an AI-agent sandbox: an operator configures direct OS grants and Dogwood policies, then launches an agent workload inside containment. Shell, Python, network egress, and MCP tool calls are mediated by policy enforcement outside the agent process; shared event history enables temporal decisions, and decisions can be recorded as OTLP JSON. The README documents these runtime relationships; source excerpts and the SOURCE INDEX additionally support the CLI entry point and policy engine’s schema dependencies. Several runtime internals are unsampled, so their links are omitted.
Main entry points: dogwood.rs Dogwood engine · boundary.rs Contained workload · http1.rs Egress gateway · cli.rs Box CLI
Components 19
Box runtime
- Box CLI
crates/box/src/command/cli.rs - Box configuration
crates/box/src/record/config/mod.rs - Workload launch
crates/box/src/run/hosted.rs
Policy engine
- MCP tool policy
crates/policy/src/mcp_schema.rs - Dogwood engine
crates/policy/src/dogwood.rs - Policy authority
crates/policy/src/policy/authority.rs - Request schema
crates/policy/src/schema.rs
OS containment
- Contained workload
crates/box/src/run/contain/boundary.rs - Containment facade
crates/containment/src/facade.rs - macOS enforcement
crates/containment/src/backend/macos/seatbelt.rs - Grant safety floors
crates/containment/src/floors.rs
Agent mediators
- Strands Shell
crates/shell/src/shell.rs - Python mediation
crates/box/src/run/broker/python/mod.rs - Egress gateway
crates/egress-gateway/src/intercept/mitm/http1.rs - MCP broker
crates/box/src/run/broker/mcp/server.rs
Records and telemetry
- Decision records
crates/telemetry/src/record.rs
Other components
- Operator
- Network services
- Local MCP server
Connections 23
- Operator → Box CLI: configures and runs
README.md - Box CLI → Box configuration: loads settings
- Box CLI → Workload launch: starts workload
- Workload launch → Contained workload: launches contained
README.md - Contained workload → Containment facade: applies restrictions
- Containment facade → macOS enforcement: selects backend
crates/containment/src/facade.rs - Containment facade → Grant safety floors: checks grants
crates/containment/src/floors.rs - Contained workload → Strands Shell: mediates commands
README.md - Contained workload → Python mediation: mediates Python
README.md - Contained workload → Egress gateway: routes requests
README.md - Contained workload → MCP broker: routes tool calls
README.md - Egress gateway → Network services: sends permitted requests
README.md - MCP broker → Local MCP server: calls tools
README.md - Strands Shell → Dogwood engine: checks actions
README.md - Python mediation → Dogwood engine: checks actions
README.md - Egress gateway → Dogwood engine: checks requests
README.md - MCP broker → Dogwood engine: checks tool calls
README.md - Dogwood engine → Request schema: maps requests
crates/policy/src/dogwood.rs - Request schema → MCP tool policy: validates tool actions
crates/policy/src/schema.rs - Policy authority → Dogwood engine: coordinates policy
crates/policy/src/policy/authority.rs - Dogwood engine → Decision records: records decisions
README.md - Strands Shell → Dogwood engine: shares event history
README.md - Egress gateway → Dogwood engine: uses event history
README.md