lite-sandbox

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

README

lite-sandbox-mcp

An MCP (Model Context Protocol) server that provides a bash tool as a replacement for basic shell access in AI coding agents. The goal is to let agents run shell commands freely without per-command permission prompts, while enforcing safety through static analysis and runtime validation — commands are parsed into an AST and validated against a whitelist, then executed via a shell interpreter with runtime path validation that catches variable expansion bypasses.

Quick start

go install github.com/gartnera/lite-sandbox@latest  # Install the lite-sandbox binary (to $GOPATH/bin)
lite-sandbox install                                 # Configure every detected agent CLI, then restart them

Prebuilt binaries for Linux and macOS (amd64/arm64) are attached to every GitHub release; once installed, lite-sandbox update upgrades the binary in place to the latest release (lite-sandbox version shows the current one).

The default is the strictest posture: only whitelisted commands run and code-execution runtimes are opt-in. If you want to start looser and tighten over time, see docs/adoption.md.

install autodetects which supported agent CLIs — Claude Code, OpenAI Codex CLI, opencode, and Crush — are installed on the host (binary on PATH or config directory present) and configures each one: it registers the MCP server, auto-allows the sandbox tools, blocks the built-in shell tool, and adds a usage directive so the agent routes shell commands through the sandbox. Name agents explicitly to configure just those:

lite-sandbox install                       # autodetect claude / codex / opencode / crush
lite-sandbox install codex                 # configure only Codex
lite-sandbox install claude opencode       # configure exactly these
lite-sandbox install codex --with-tool-hook # also confine reads/writes (incl. apply_patch) to the sandbox paths

Codex's hook protocol matches Claude Code's, so lite-sandbox reuses the same hook binary and the same config file to govern both agents — one security/sandbox config for all of them. The --with-tool-hook and --bash-ast-hook-mode flags apply to claude and codex (opencode has no compatible hook protocol). See docs/installation.md for manual setup, per-agent details, and coverage caveats.

Documentation

  • Incremental adoption — other enforcement modes, audit reports, and tightening over time.
  • Installation — getting the binary and keeping it updated, automatic and manual agent setup, built-in tool boundaries, and hook modes.
  • Configuration — config file, CLI management, readable/writable paths, and git support.
  • Runtime support — the built-in sandboxed Python, and enabling Go, pnpm, Rust, Deno, and uv.
  • AWS & Docker access — brokered AWS credentials and the filtering Docker proxy.
  • Background processes — running and managing long-lived commands.
  • Security model — validation layers, the optional OS sandbox, and known limitations.
  • Development — building, testing, the e2e suite, and the release flow.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
e2e
mockedserver
Package mockedserver drives real agent binaries (Crush, Codex, Claude Code, opencode) through `lite-sandbox install` and a non-interactive run against a mocked model server (the mockmodel package), so it needs no API key.
Package mockedserver drives real agent binaries (Crush, Codex, Claude Code, opencode) through `lite-sandbox install` and a non-interactive run against a mocked model server (the mockmodel package), so it needs no API key.
mockedserver/mockmodel
Package mockmodel is a scripted, in-process stand-in for the LLM behind an agent harness, for end-to-end tests that drive real agent binaries (Crush, Codex, Claude Code, ...) without an API key.
Package mockmodel is a scripted, in-process stand-in for the LLM behind an agent harness, for end-to-end tests that drive real agent binaries (Crush, Codex, Claude Code, ...) without an API key.
internal
audit
Package audit records sandbox validation findings to an append-only JSONL log.
Package audit records sandbox validation findings to an append-only JSONL log.
dockerproxy
Package dockerproxy implements a filtering proxy in front of the Docker daemon socket, modeled on the IMDS server in internal/imds.
Package dockerproxy implements a filtering proxy in front of the Docker daemon socket, modeled on the IMDS server in internal/imds.
ghrelease
Package ghrelease downloads assets from GitHub releases.
Package ghrelease downloads assets from GitHub releases.
hook
Package hook models the Claude Code PreToolUse hook protocol: the JSON event delivered on stdin and the decision document written to stdout.
Package hook models the Claude Code PreToolUse hook protocol: the JSON event delivered on stdin and the decision document written to stdout.
selfupdate
Package selfupdate replaces the running lite-sandbox binary with a GitHub release build.
Package selfupdate replaces the running lite-sandbox binary with a GitHub release build.
version
Package version reports the build's release version.
Package version reports the build's release version.
tool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL