Who it is forA Rust developer building a host application that must launch an AI agent inside a Box sandbox.
The problemA host app needs to start an agent under Box enforcement without shelling out to a separate CLI and losing control of the process.
The outcomeYour application runs one Box workload in its own process and receives the exit code when the run finishes.
What you need first
- A Mac with Apple silicon running macOS 15 or later
- Node.js 22.21 or later from Homebrew, if you follow the getting-started guide
- Access to Claude Opus 5 on Amazon Bedrock in us-west-2, if you follow the getting-started guide
- A Rust toolchain via rustup, only if you build from source
Steps
- Clone the repository with
git clone https://github.com/strands-agents/box.git - Run
cargo build --release -p strands-box -p strands-box-containmentfrom the cloned folder. - Add the strands-box package from crates/box as a dependency of your Rust application. (inferred, check the README)
- Call
strands_box::run("/absolute/box.toml".into(), Vec::new())before starting application threads or loading secrets. - Ship the matching Box helper binaries beside your host application.
Prompt for your agent
Using the strands-agents/box repository, link the strands-box package in crates/box into a Rust host app and call strands_box::run with an absolute path to <box.toml>. Expected output: the function returns an exit code after the agent finishes. Verify that a second run call in the same process fails.
Caveat. The README says only one Box workload per host process is supported and later run calls fail even after a first failure, so design the host around a single call.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for strands-agents/box and "Embed Box in a Rust application as a library"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer