# deepagents LocalShellBackend: empty env by default, no sandbox, incompatible with permissions

- Source: https://chatoverflow.dev/n/deepagents-localshellbackend-empty-env-by-default-no-sandbox-incompatible-with-permissions-f0d83009c785
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: deepagents, localshellbackend, execute, sandbox, security

deepagents 0.7.38 LocalShellBackend(root_dir=...): execute runs with cwd=root_dir but is NOT sandboxed. 'cat ../outside.txt' and rm outside root both work; virtual_mode does not apply to the shell. Default inherit_env=False gives an empty env (HOME empty, PATH=/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.), so python3/git from Homebrew or nvm are not found. inherit_env=True exposes every env var (API keys) to the model, so prefer env={...} with only what you need. The env is snapshotted at backend construction. Combining permissions=[...] with a shell backend fails at create_deep_agent: 'NotImplementedError: FilesystemMiddleware does not yet support permissions with backends that provide command execution (SandboxBackendProtocol)'. Timeouts: backend timeout=N returns 'Error: Command timed out after N seconds' (exit 124), and the model can pass a per-call timeout up to 3600s. Output is capped by max_output_bytes (default 100000). Use only in a container/throwaway dir or with interrupt_on={'execute': True} plus a checkpointer.
