Skip to content
News

Developer tools

AWS Strands Box CLI: Sandbox Claude Code & Codex, Keep Keys Out

Isolate Claude Code, Codex, and Kiro CLI in an OS sandbox with AWS Strands Box CLI, Dogwood policies, and egress credential injection.

#Strands Box#Claude Code#Codex#Sandbox#AWS

AWS Strands Box CLI: Sandbox Claude Code & Codex, Keep Keys Out

Q. Can you run Claude Code or Codex in YOLO mode without permission prompts while still preventing API key leaks and unintended file damage? Yes. On November 23, 2026, AWS added native support for Claude Code, Codex, and Kiro CLI to its open-source sandbox Strands Box CLI. With a single box run claude command, the agent runs inside an OS sandbox while real API keys and AWS credentials remain outside the box and are injected by the egress gateway only when an approved request leaves.

⚠️ Accuracy guardrail: This post is based on the official Strands Agents announcement (November 23, 2026) and the strands-agents/box repository documentation as of November 29, 2026. box is currently in preview, and its credential protection applies only to keys configured through routes—plaintext keys left inside project files or MCP server configs remain visible to the agent unless moved or blocked. We did not run a live local installation test on macOS or Linux for this review.

30-second summary

  • One-command isolation: Launches already-installed coding agents such as box run claude or box run codex inside an OS-level sandbox.
  • External credential storage: Exposes only placeholders inside the sandbox, injecting real Bedrock, Anthropic, GitHub tokens, or AWS profile signatures at the egress gateway.
  • Dogwood policy engine: Evaluates file reads/writes, shell commands, network hosts, and MCP calls outside the model, including history-aware rules like hourly call caps.
  • Supported platforms: Apple Silicon Macs (macOS 15+) and Linux ARM64/x86-64; Intel Macs and Windows are not supported.

1. The YOLO mode dilemma and Strands Box's approach

Running coding agents in "YOLO mode" without permission prompts boosts throughput, but leaves every file and credential you can access exposed to the model. As noted in our coverage of Cline v4.1.28 and CLI v3.0.76 defaulting to Yolo mode and GitHub Copilot CLI v1.0.117 MCP sandboxing, a single prompt injection inside a README or web page can trick an agent into running destructive commands.

Official Strands Agents announcement page

Strands Box CLI avoids relying on model self-restraint or manual step-by-step approvals by pairing an operating system sandbox with an external policy engine (Box Core). The agent works freely inside its permitted project folder, while Box intercepts every file access, shell command, network request, and MCP call and checks it against your Dogwood policy outside the model.

Advertisement

2. Profiles, packs, and egress credential injection

Strands Box splits agent configuration into packs and profiles. A pack defines how a single program runs inside the box—covering agents (@box/claude, @box/codex, @box/kiro), model providers (@box/bedrock, @box/anthropic), and everyday tools (@box/git, @box/gh, @box/npm, @box/uv, @box/cargo).

Strands Box CLI isolation architecture and 3-stage control diagram

A profile (profile.toml) combines packs and Dogwood policy files (.dw) into a task-specific persona. Separating a coding profile from an oncall profile keeps their session histories and storage isolated while enforcing completely different boundaries.

packs = ["@box/claude", "@box/bedrock", "@box/git", "@box/npm"]
policies = ["policy.dw"]

[egress.github]
destinations = ["github.com"]
secret.ref = "env://GIT_GITHUB"
secret.placement = "basic_auth"
secret.inject = "always"

With an egress route like the one above, the GIT_GITHUB environment variable inside the sandbox holds only a placeholder. The egress gateway swaps in the real token only when an outbound request goes to github.com, preventing prompt injections from exfiltrating the actual credential.

3. Dogwood policies: from directory blocks to hourly rate limits

Box's policy language, Dogwood, evaluates both exact targets and session history. For instance, a coding agent can be allowed to read shared notes in ~/.shared while being blocked from ~/.shared/.secrets.

@id("aws_mcp_rate_limit")
@description("At most 60 AWS MCP calls an hour. Tell the user what you found so far.")
forbid (principal, action == Box::Action::"mcp:call", resource)
when { context.input.server == "aws" && context.input.method == "tools/call" }
when temporal {
  exists (total: Long). (
    (count for (t: Timepoint). where (
      formerly within 1h (
        Box::Action::"mcp:call"::response{ input.server: "aws", input.method: "tools/call" } && tp(t)
      )
    )) == total && total >= 60
  )
};

In an oncall profile, a when temporal rule can count completed aws MCP tool calls over the past hour and block the 61st call, returning the @description message so the agent reports what it has found so far instead of burning tokens in a loop. Policy edits can also be reloaded mid-session with a single keypress without restarting the agent.

4. Requirements and limits to check before adoption

Box CLI is written in Rust and is currently in preview. Key platform requirements and caveats from the official documentation include:

Item Requirement / Behavior
macOS Apple Silicon Mac, macOS 15 or later (Intel Macs unsupported)
Linux ARM64 or x86-64 (glibc 2.34+, libgcc, Python 3, curl, GNU utilities)
Install brew install --cask strands-agents/tap/box or official install.sh script
Run box profile create claude --with bedrock, then box run claude in project dir
Credential scope Protects routed keys only (.env files or MCP configs in project remain readable)

Developer workspace running terminal and Git workflows

Q. Does Box hide secrets stored in a project's .env file automatically? No. As stated in the official announcement, egress credential protection only covers keys configured via Box routes. Any plaintext secret inside a project file or MCP server config that the agent can read remains visible unless you move it to a route or add an explicit read-deny rule.

Toris's take

For developers on macOS 15+ or Linux who run Claude Code or Codex in long autonomous YOLO sessions, Strands Box CLI is worth testing right away. Separating coding and oncall personas via profile.toml and capping hourly MCP calls with Dogwood provides practical guardrails that model-level prompts cannot guarantee.

Because Box is still in preview, lacks Windows and Intel Mac support, and does not automatically shield .env files inside a repo, we recommend starting in a test repository with box run claude, verifying sensitive-path blocks and records.jsonl logs before rolling it into daily production workflows.

Sources

Advertisement