strands-agents /shell
Give your agent a shell without giving it the keys to your machine.
★ 301⑂ 41👁 0⑃ 283● 24▤ 9
TA的项目
+2
日增长
301
stars
41
forks
0
watchers
283
prs
24
issues
9
releases
README
Strands Shell
Give your agent a shell without giving it the keys to your machine.
Documentation
◆ MCP Server
◆ Python
◆ Node.js
---
Agents run shell commands in tight loops: Install deps, run tests, grep for errors, iterate. Those loops need speed and isolation.
Strands Shell is a Bourne-compatible shell that runs in-process. grep, sed, jq, curl, find, 50+ commands and it does this without fork, exec, syscalls, or cold starts. You declare what the agent can reach (files, URLs, credentials) and everything else doesn't exist to the agent.
| | Docker | Cloud sandbox | Strands Shell |
|---|---|---|---|
| Cold start | ~200ms | ~1s (network) | |"MCP / Python / Node.js"| shell
subgraph shell ["Strands Shell"]
direction TB
subgraph kernel ["Kernel (mediation boundary)"]
vfs["VFS: isolated filesystem"]
net["Network: SSRF guard + allowlist"]
creds["Credentials: injected per-URL"]
limits["Limits: timeout, output, fds"]
end
engine["Shell engine: parser, 25 builtins, 33 commands, Lua 5.4"]
end
Written in Rust, with native bindings for Python (PyO3) and Node.js (napi-rs). State persists across run() calls (env vars, working directory, functions). The filesystem is shared.
Configuration
python
shell = strands_shell.Shell(
binds=[
strands_shell.Bind("/host/project", "/workspace", mode="copy"),
strands_shell.Bind("/tmp/output", "/output", mode="direct"),
],
credentials=[
strands_shell.Cred("https://api.example.com/", env_var="API_TOKEN"),
],
allowed_urls=["https://api.example.com/", "https://pypi.org/"],
timeout=30.0,
env={"PROJECT": "demo"},
limits=strands_shell.Limits(
max_output=1 ⚠️ mode: "direct" mounts are live. The agent can read and modify host files in real time. Use only for designated output directories. Never direct-bind directories containing secrets, credentials, or configuration you don't want the agent to modify.
Inspecting configuration
A constructed shell exposes a read-only snapshot of how it was configured. This
is useful when you embed Strands Shell as a sandbox in a larger framework and
need to build tool descriptions, surface the network allowlist, or report the
active resource caps from a shell object you were handed.
python
shell = strands_shell.Shell(
allowed_urls=["https://api.example.com/"],
credentials=[strands_shell.Cred("https://api.example.com/", env_var="API_TOKEN")],
timeout=30.0,
)
cfg = shell.config a frozen ShellConfig snapshot
cfg.allowed_urls ('https://api.example.com/',)
cfg.timeout 30.0
cfg.credentials[0].url 'https://api.example.com/'
cfg.credentials[0].env_var 'API_TOKEN' (the secret value is never exposed)
javascript
const shell = await Shell.create({
allowedUrls: ['https://api.example.com/'],
credentials: [{ url: 'httpsTop issues
#207Agent-usability gaps: missing commands, flags, and shell syntax3 comments · 2026-11-06#151[FEATURE] Publish the native Rust crate to crates.io2 comments · 2026-10-16#132[BUG] curl -L resolves a protocol-relative `Location: //host/path` as a path on the current host1 comments · 2026-10-05#107[FEATURE] Option to disable network access, and RFC 6598 shared address space (100.64.0.0/10) in the SSRF blocklist1 comments · 2026-09-15#302FileStat should carry owner, link count and device numbers0 comments · 2026-11-13#300[BUG] printf %s with a huge width grows memory without bound0 comments · 2026-11-13#299[BUG] A double-quoted empty word ("") is dropped from a command's arguments0 comments · 2026-11-13#294[BUG] `command -v` ignores redirects, so `command -v X >/dev/null` still prints X0 comments · 2026-11-13
Latest release
v0.6.0 v0.6.0 2026-11-04v0.6.0 🚀 Features - feat: let a kernel run commands Shell doesn't implement (190) (da522f9) - feat: make the interactive CLI an optional default feature (172) (924927a) - feat: add the builtin builtin (174) (a202be8) - feat: accept legacy -N line counts in head and tail (171) (07df899) 🐛 Fixes - fix: fail a write that goes past max_file_size (198) (f5b232d) - fix: run break, continue and exit inside command substitution (189) (77b6309) - fix(rm): report removal refusals, including under -f (180) (e77c26b) - fix: apply the input size limit to multiline input (178) (cff867b)