strands-agents/shell

Give your agent a shell without giving it the keys to your machine.

What it solves

AI agents often need to run shell commands—install dependencies, run tests, grep logs—but doing so on a real machine is risky: they might access files, network, or credentials they shouldn't. Traditional solutions like Docker or cloud sandboxes are slow to start (200ms to 1s) and hard to configure. Strands Shell gives agents a real Bourne-compatible shell experience with strong isolation, starting in under 1ms, and no fork/exec overhead.

How it works

Strands Shell runs inside your application process (in-process), written in Rust with bindings for Python and Node.js. It provides a virtual file system (VFS) mapped from host directories, network access mediated through an allowlist and SSRF guard, and credentials injected per request so the agent never sees them. The shell engine supports 25 builtins and 33 commands (grep, sed, curl, jq, etc.) plus Lua scripting. Everything is mediated by a Kernel that enforces deny-by-default: only what you explicitly bind or allow is visible.

Who it’s for

Developers building AI agents (e.g., with Strands, LangGraph, Pydantic AI) who need to give the agent shell capabilities without exposing the host. Also useful for anyone embedding a sandboxed execution environment in their LLM applications. Works on macOS, Linux, and WASM, and can be used via MCP, Python, or Node.js.

Highlights

  • In-process: <1ms cold start and no fork/exec syscalls.
  • Deny-by-default security: only bound files, allowed URLs, and injected credentials are reachable.
  • Credential injection per-URL; agent never holds secret values.
  • Supports MCP, Python, and Node.js; includes a built-in MCP server.
  • File operations API for direct read/write without shell commands.
  • Configurable via TOML or programmatically; snapshots expose config without secrets.

Related

  • Project
  • Project
  • Project
  • Project