Install the crate.
cargo add bashkit Bashkit runs untrusted shell scripts from AI agents without spawning a single OS process. 160 reimplemented commands, substantial POSIX shell language coverage, a virtual filesystem, resource limits, and tool interfaces for agent frameworks — all in-memory, all sandboxed.
Install the crate.
cargo add bashkit Text processing, files, archives, network, Python, TypeScript, and shell control all live in-process.
A single runtime you can embed in agents, CLIs, editors, and evaluation harnesses. No sidecar process, no container overhead, no external dependencies at runtime.
Substantial IEEE 1003.1-2024 Shell Command Language coverage, plus bash extensions: arrays, [[ ]], brace expansion, extended globs, coprocesses, traps.
grep, sed, awk, jq, curl, tar, find, xargs, and 150+ more — pure Rust, no shelling out.
BashTool with discovery metadata, streaming output, and system prompts. Plug into any agent framework.
bashkit mcp exposes the interpreter over Model Context Protocol for Claude, Cursor, and other clients.
Serialize shell state and VFS contents to bytes. Checkpoint any workload, resume anywhere.
Compose ToolDef + callback pairs into a ScriptedTool driven by a bash script.
Start with the core Rust crate, or drop the same runtime into Python and TypeScript when you need it inside an existing stack.
use bashkit::Bash;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut bash = Bash::new();
let out = bash.exec("echo hello world").await?;
println!("{}", out.stdout);
Ok(())
} from bashkit import Bash
bash = Bash()
result = bash.execute_sync("echo 'Hello, World!'")
print(result.stdout)
bash.execute_sync("export APP_ENV=dev")
print(bash.execute_sync("echo $APP_ENV").stdout) import { Bash } from "@everruns/bashkit";
const bash = new Bash();
const result = bash.executeSync('echo "Hello, World!"');
console.log(result.stdout);
bash.executeSync("X=42");
console.log(bash.executeSync("echo $X").stdout); A tiny Rust program that uses bashkit as an in-process shell. No container, no subprocess — just a crate.
use bashkit::Bash;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut bash = Bash::new();
bash.exec("mkdir -p /tmp/data").await?;
bash.exec("echo 'hello' > /tmp/data/out.txt").await?;
let r = bash.exec("cat /tmp/data/out.txt | tr a-z A-Z").await?;
print!("{}", r.stdout); // HELLO
Ok(())
} Defense in depth across every layer — process, filesystem, network, parser, and runtime. See the full threat model for 250+ mitigations.
160 commands reimplemented in Rust — no fork, exec, or shell escape.
Scripts see an in-memory FS by default. No host access unless mounted.
HTTP is denied by default. Each domain must be explicitly allowed.
Caps on commands (10K), loops (100K), function depth, output (10MB), input (10MB).
Timeout, fuel budget, AST depth — pathological input can't hang the interpreter.
Every builtin is wrapped in catch_unwind. A panic in one command can't crash the host.
Bashkit ships with a 58-task LLM eval harness across 15 agentic categories. Results below are from the 2026-02-28 run:
| Model | Score | Tasks passed |
|---|---|---|
| Claude Haiku 4.5 | 97% | 54/58 |
| Claude Sonnet 4.6 | 93% | 48/58 |
| Claude Opus 4.6 | 91% | 50/58 |
| GPT-5.3-Codex | 91% | 51/58 |
| GPT-5.2 | 77% | 41/58 |
The crate is MIT-licensed. These are the links that actually help you evaluate, integrate, and operate it.
Core crate docs, builder options, limits, and shell semantics.
Python docsPyO3 package docs for direct Bash usage, snapshots, and builtins.
TS docsNode, Bun, and Deno runtime docs for the NAPI bindings.
Security spec268 documented threat cases across parser, VFS, network, and runtimes.
CLI docsRun bashkit as a Model Context Protocol server via `bashkit mcp`.
Browse examplesReference programs for Rust, Python, JavaScript, and tool flows.