Absolutly fastest virtual bash engine for you AI have a new site

chalyi1 pts0 comments

Bashkit — awesomely fast virtual bash sandbox in Rust<br>Virtual bash for AI agents An awesomely fast virtual bash sandbox. Written in Rust.<br>Bashkit runs untrusted shell scripts from AI agents without spawning a single OS process. 156 reimplemented commands, substantial POSIX shell language coverage, a virtual filesystem, resource limits, and tool interfaces for agent frameworks — all in-memory, all sandboxed.<br>Quick starts Agents Rust Python TypeScript<br>Start in Rust Install the crate.<br>cargo add bashkit<br>Go deeper Rust docs docs.rs reference Examples Rust, Python, TS

The core API is just `Bash`, plus virtual FS and limits. No sidecar<br>process, no container bootstrap.

Rust In-process execution<br>use bashkit::Bash;

#[tokio::main]<br>async fn main() -> anyhow::Result {<br>let mut bash = Bash::new();<br>let out = bash.exec("printf 'ready\n'").await?;<br>print!("{}", out.stdout);<br>Ok(())<br>No process spawning<br>Every command is reimplemented in Rust. No fork, no exec, no shell escape.

Virtual filesystem<br>InMemoryFs, OverlayFs, MountableFs. Host access only when you explicitly mount it.

Resource limits<br>Caps on commands, loops, output, input, and filesystem size. DoS-resistant by construction.

Built-in commands 156 Threats mitigated 250+ Haiku 4.5 eval 97%<br>Runtime surface Browse the builtins that make the sandbox usable.

Text processing, files, archives, network, Python, TypeScript,<br>and shell control all live in-process.

grepsedawkjqcurlfindxargstargitsshpythontypescript<br>See all 156 builtins

Agent development Start with the skill, then embed the runtime.

The Bashkit skill gives coding agents the right local context:<br>sandbox model, package APIs, builtins, examples, and agent-tool<br>patterns. Install it first, then add Bashkit to the host project.

1 Install the skill<br>Give your coding agent Bashkit-specific usage notes and examples.<br>npx skills add everruns/bashkit

2 Ask agent to add it<br>Prompt your coding agent to wire Bashkit into the host project.<br>Using bashkit, add support for a bash tool

3 Enjoy :)<br>Use the new bash tool in your agent workflow.

Product surface What bashkit gives you

A single runtime you can embed in agents, CLIs, editors, and<br>evaluation harnesses. No sidecar process, no container overhead, no<br>external dependencies at runtime.

POSIX-compliant interpreter<br>Substantial IEEE 1003.1-2024 Shell Command Language coverage, plus bash extensions: arrays, [[ ]], brace expansion, extended globs, coprocesses, traps.

156 reimplemented commands<br>grep, sed, awk, jq, curl, tar, find, xargs, and 150+ more — pure Rust, no shelling out.

LLM tool contract<br>BashTool with discovery metadata, streaming output, and system prompts. Plug into any agent framework.

Interactive shell<br>Run bashkit with no args for a local REPL with line editing and multiline input.

Snapshotting<br>Serialize shell state and VFS contents to bytes. Checkpoint any workload, resume anywhere.

Scripted tool orchestration<br>Compose ToolDef + callback pairs into a ScriptedTool driven by a bash script.

Quick start Three languages, one runtime

Start with the core Rust crate, or drop the same runtime into Python<br>and TypeScript when you need it inside an existing stack.

Rust The core crate<br>Install cargo add bashkit

use bashkit::Bash;

#[tokio::main]<br>async fn main() -> anyhow::Result {<br>let mut bash = Bash::new();<br>let out = bash.exec("echo hello world").await?;<br>println!("{}", out.stdout);<br>Ok(())

Python PyO3 wheel with direct Bash API<br>Install pip install bashkit

from bashkit import Bash

bash = Bash()<br>result = bash.execute_sync("echo 'Hello, World!'")<br>print(result.stdout)

bash.execute_sync("export APP_ENV=dev")<br>print(bash.execute_sync("echo $APP_ENV").stdout)

TypeScript NAPI-RS runtime for Node, Bun, Deno<br>Install npm i @everruns/bashkit

import { Bash } from "@everruns/bashkit";

const bash = new Bash();<br>const result = bash.executeSync('echo "Hello, World!"');<br>console.log(result.stdout);

bash.executeSync("X=42");<br>console.log(bash.executeSync("echo $X").stdout);

End-to-end<br>A tiny Rust program that uses bashkit as an in-process shell. No<br>container, no subprocess — just a crate.

use bashkit::Bash;

#[tokio::main]<br>async fn main() -> anyhow::Result {<br>let mut bash = Bash::new();<br>bash.exec("mkdir -p /tmp/data").await?;<br>bash.exec("echo 'hello' > /tmp/data/out.txt").await?;

let r = bash.exec("cat /tmp/data/out.txt | tr a-z A-Z").await?;<br>print!("{}", r.stdout); // HELLO<br>Ok(())

Security Hostile input is the default assumption

Defense in depth across every layer — process, filesystem, network,<br>parser, and runtime. See the<br>full threat model for 250+ mitigations.

No process spawning<br>156 commands reimplemented in Rust — no fork, exec, or shell escape.

Virtual filesystem<br>Scripts see an in-memory FS by default. No host access unless mounted.

Network allowlist<br>HTTP is denied by default. Each domain must be explicitly allowed.

Resource limits<br>Caps on commands (10K), loops (100K), function depth, output (10MB), input (10MB).

Parser limits<br>Timeout, fuel budget, AST depth —...

bash bashkit rust shell process virtual

Related Articles