You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,8 @@ shell = strands_shell.Shell(
139
139
)
140
140
```
141
141
142
+
> ⚠️ **`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.
143
+
142
144
### TOML
143
145
144
146
You can load all of this from a config file instead:
@@ -174,6 +176,8 @@ If you declare `[[mcp]]` servers in your TOML config, they show up as Lua module
174
176
175
177
## Security Model
176
178
179
+
> **Strands Shell is a mediation layer, not a security sandbox.** It enforces what the agent *should* access via Kernel-mediated deny-by-default. It does NOT protect against: memory-safety exploits in the shell engine itself, timing side-channels, or an attacker who controls the host process. For multi-tenant or adversarial workloads, run each Shell instance inside a container or microVM.
180
+
177
181
The Kernel mediates everything; it runs in the same process as your code, not in a VM. If your threat model is "untrusted tenant running arbitrary code," put Strands Shell inside a container too. For "my agent shouldn't access things I haven't explicitly allowed," the Kernel handles it.
178
182
179
183
**Default-deny. You allowlist what the agent can reach:**
@@ -189,6 +193,16 @@ If you bypass any of these, report it. See [SECURITY.md](SECURITY.md).
189
193
190
194
**Multi-tenant:** a Shell instance is single-owner. If you're serving multiple agents, create one Shell per session. Construction is cheap (no containers, no VMs, just an in-memory VFS), so spinning up per-request is the intended pattern.
191
195
196
+
### Secure Defaults
197
+
198
+
Out of the box, the shell is an empty sandbox — no files, no network, no credentials. When you grant access, follow least privilege:
199
+
200
+
-**Prefer `mode: "copy"` over `mode: "direct"` for source code.** Copy-on-create isolates the agent from your live files. Use `direct` only for output directories where the agent needs to persist results.
201
+
-**Scope binds narrowly.** Bind `/my/project/src` rather than `/my/project` or `/`. The agent doesn't need your `.git/`, `.env`, or `node_modules/`.
202
+
-**Allowlist URLs explicitly.** Don't use `allowed_urls: ["https://"]` — this disables SSRF protection entirely. List the specific API endpoints the agent needs.
203
+
-**Set timeouts.** The default has no per-command timeout. Set `timeout` to bound runaway commands (30s is reasonable for most agent loops).
204
+
-**Use limits.** Set `max_output` to prevent agents from filling memory with unbounded command output (1MB is a good default).
205
+
192
206
## Commands
193
207
194
208
25 builtins, 33 commands, and a Bourne-compatible shell with pipes, loops, functions, and subshells.
IP filtering via `SafeResolver`. Blocks RFC1918, link-local, loopback, IMDS,
51
+
IPv4-mapped-IPv6, 6to4, Teredo
52
+
3.**Credential injection** — per-URL prefix matching with path-boundary checks;
53
+
credentials injected only on original request, stripped on redirects
54
+
4.**No syscalls** — pure userspace shell; no `fork`, `exec`, or raw syscall paths
55
+
56
+
Custom Kernel implementations (for embedding in other runtimes) carry their own
57
+
security properties. Reports about the `VfsKernel` implementation are in scope;
58
+
reports about third-party Kernel implementations should go to those maintainers.
59
+
60
+
61
+
## Out of Scope
62
+
63
+
The following are explicitly **not** part of the security boundary and will not
64
+
be treated as security issues:
65
+
66
+
- Resource exhaustion via CPU/memory within configured limits (limits are
67
+
best-effort, use OS-level cgroups for hard guarantees)
68
+
- Speculative execution and side-channel attacks (same-process architecture,
69
+
use VM isolation for this threat model)
70
+
- Multi-tenancy within a single OS process (documented non-goal, one Shell
71
+
instance per session is the contract)
72
+
- Agent reading files it was explicitly granted access to via binds (working
73
+
as designed, the bind is the grant)
74
+
- Lua scripts consuming memory up to configured limits (limits are advisory,
75
+
Lua sandbox is not a security boundary)
76
+
77
+
See the [Security Model](README.md#security-model) in the README for the full
78
+
threat model and guidance on running Strands Shell inside VM- or container-level
31
79
isolation when stronger guarantees are required.
32
80
81
+
33
82
## Reporting Security Issues
34
83
35
-
Amazon Web Services (AWS) is dedicated to the responsible disclosure of security vulnerabilities.
36
-
37
-
We kindly ask that you **do not** open a public GitHub issue to report security concerns.
38
-
39
-
Instead, please submit the issue to the AWS Vulnerability Disclosure Program via [HackerOne](https://hackerone.com/aws_vdp) or send your report via [email](mailto:aws-security@amazon.com).
40
-
41
-
For more details, visit the [AWS Vulnerability Reporting Page](http://aws.amazon.com/security/vulnerability-reporting/).
84
+
Amazon Web Services (AWS) is dedicated to the responsible disclosure of security vulnerabilities.
85
+
86
+
We kindly ask that you **do not** open a public GitHub issue to report security concerns.
87
+
88
+
Instead, please submit the issue to the AWS Vulnerability Disclosure Program via [HackerOne](https://hackerone.com/aws_vdp) or send your report via [email](mailto:aws-security@amazon.com).
89
+
90
+
For more details, visit the [AWS Vulnerability Reporting Page](http://aws.amazon.com/security/vulnerability-reporting/).
42
91
43
92
Thank you in advance for collaborating with us to help protect our customers.
0 commit comments