Skip to content
Docs
GitHub

Bashkit Shell

Run Bash commands in a sandboxed interpreter with process isolation, resource limits, streaming output, and workspace-only filesystem access.

5 min readEdit on GitHub

Applies toFrameworkSelf-hostedEverruns Demo

IDbashkit_shell (legacy alias: virtual_bash)
CategoryExecution
RiskHigh, assignment requires an org Admin
Featuresfile_system (enables the Files tab)
Dependenciessession_file_system

Execute bash commands in a sandboxed environment with no access to the host system. The session filesystem is mounted at /workspace, so commands read and write the same files as the File System tools.

This capability runs on Bashkit, a virtual Bash interpreter written in Rust. It executes shell scripts in-process, with no real shell, no subprocess spawning, and no host access, which makes it suitable for running untrusted scripts in multi-tenant agent environments. Browse the source on GitHub.

Bashkit provides:

  • The shell language: variables, parameter expansion, command substitution, arithmetic, pipelines, redirections, control flow, functions, arrays, globs, and here-documents.
  • Built-in commands implemented in Rust: file I/O and navigation (cat, ls, find, cp, mv), text processing (grep, sed, awk, jq, sort), archives (tar, gzip), and network commands (curl, wget).
  • A pluggable virtual filesystem: Everruns plugs in the session file store, so there is no copy step before or after a command.
  • Resource limits on command count, loop iterations, and function depth, so a runaway script cannot exhaust shared infrastructure.

Because the interpreter is sandboxed by construction, bash here is not a shell-out to the host: there is no /bin/bash process, no direct network stack, and no filesystem beyond the session workspace. Outbound HTTP for curl/wget is off by default and can be enabled per agent (see Outbound HTTP below).

Execute a shell command (or a multi-line script).

ParameterTypeRequiredDescription
commandsstringyesShell command(s) to execute
working_dirstringnoWorking directory (default: /workspace)
timeout_msintegernoTimeout in milliseconds (default: 30000, max: 60000)
outputstringnoOutput verbosity (auto, normal, …; default: auto)

Returns stdout, stderr, exit_code, and a success flag. Output streams live to the UI and CLI via tool.output.delta events while the command runs. On timeout, any partial output captured so far is returned alongside the error.

This tool also supports background execution, long scripts can run detached and report progress without blocking the agent loop.

The interpreter exposes a single mount:

  • /workspace maps to the session file store. Reads and writes are live, files created by bash are immediately visible to the File System tools and vice versa.
  • Paths outside /workspace (for example /etc, /home/agent, /tmp) do not exist and cannot be written.
  • Symlinks are unsupported; chmod is a no-op (the session filesystem does not track Unix permissions, and files are executable by default).

Default environment: HOME=/home/agent, SHELL=/bin/bash, PATH=/usr/local/bin:/usr/bin:/bin, WORKSPACE=/workspace, user and host everruns.

Every invocation runs under fixed limits to prevent runaway scripts:

LimitValue
Max commands per run1,000
Max loop iterations10,000
Max function depth100
Max script size1 MB
Max memory10 MB
Parser timeout5 s
Wall-clock timeouttimeout_ms (default 30 s, max 60 s)

Set the capability config {"enable_http": true} to let scripts use curl and wget. Every request, including each redirect hop, is routed through the platform egress boundary, where the agent/session network access list and the deployment-wide system allowlist are enforced. Policy denials surface as curl’s native access denied failure (exit code 7). Without the flag, the interpreter has no network path at all.

A bound secret is an API key stored with the URL it may be sent to and how (Authorization: Bearer, or a named header). With outbound HTTP on, the shell sees $NAME as a placeholder, and the platform swaps in the real key only in that header and only for requests to the bound URL:

Terminal window
curl -sS https://api.example.com/v1/items -H "Authorization: Bearer $EXAMPLE_API_KEY"

The model can never read the value: printing $NAME shows an opaque handle. A request that places that handle on another host, path, header, or form field is refused before it is sent, including a redirect to another destination. A response that echoes the key is redacted. The bound URL still has to pass the agent’s network access list.

A Daytona, E2B, or Modal command runs without these bindings. sandbox_exec does not expand $NAME, and those providers do not add the credential to outbound HTTPS. Modal’s GitHub connection injection is a separate, domain-wide control.

Set one for every session of an agent on the agent’s Credentials tab: Add binding, choose HTTP API, and give the shell variable, the URL and how it is sent. Platform Chat or the CLI can declare it without a value, and you paste the value on that tab:

Terminal window
everruns agents credentials create --agent-id agent_01h9 \
--env-name EXAMPLE_API_KEY --url https://api.example.com --label 'Example API key'

Set one for a single session with bindings on PUT /v1/sessions/{session_id}/storage/secrets. Over MCP, session_set_secret takes url, auth, header and scope and collects the value on a secure page, so it never passes through the MCP client.

  • Sandboxed: no direct network access (outbound HTTP is opt-in and egress-routed), no host filesystem, no subprocess spawning.
  • High risk: because it exposes arbitrary scripted code execution, assigning bashkit_shell to an agent requires an org Admin. Existing agents that already had it keep working; the gate applies to new assignments only.
  • Built-in observability hooks emit structured tracing events per builtin and on interpreter errors (tagged with the session ID) without logging argument values or command output.
  • Commands operate on the same /workspace as File System tools.
  • Built-in commands support <command> --help, and many also support <command> --version.
  • Common builtins: cd, ls, cat, echo, grep, head, tail, sed, find, plus shell features like pipes, redirections, and command substitution. grep is backed by the session’s indexed search.