shellsim
Shellsim is a BusyBox for containers: one small, deterministic process that provides a useful Unix-shaped environment without starting a VM, container runtime, or host subprocess. It is built for experimentation and testing with reinforcement-learning rollouts and agentic environments, where fast startup, reproducibility, isolation, and explicit resource limits matter more than cycle-accurate emulation.
Shell programs, common command-line tools, logical processes, and Python run in-process against an in-memory filesystem. Simulated code cannot access the host filesystem, processes, network, environment, or clock. A trusted harness may copy a selected project into the virtual filesystem before execution; changes never write back to the host.
Compatibility
Shellsim aims for broad compatibility inside clear boundaries. A supported facility should handle almost all ordinary uses, even when obscure flags or legacy behavior remain out of scope. A module or command with no coherent useful subset is omitted instead of being exposed as a misleading stub. Unsupported syntax, options, executable formats, and capabilities fail visibly and are included in structured results.
The current environment includes:
- a Bash-like shell with pipelines, redirections, functions, common expansions, control flow, background jobs, signals, and job control;
- common filesystem, text, archive, Git, Make, process, and system commands;
- deterministic virtual time, network fixtures,
/proc,/dev, processes, descriptors, and bounded pipes; - a mostly complete Python language runtime with a deliberately selected standard-library and third-party module surface.
Python is source-compatible where supported, not ABI-compatible with CPython. Native extensions, package installation, compilers, and arbitrary machine code are outside the simulation boundary. See Python in shellsim for the current contract.
Install and run
Install the Python package and console command:
python -m pip install shellsim
shellsim -c 'printf "b\na\n" | sort'
shellsim --root ./project -c 'python3.14 test.py'
--root copies the selected host tree into a disposable /work snapshot. With no -c and a
terminal attached, shellsim starts a persistent interactive session.
To build the Rust binaries from source:
cargo build --release
./target/release/shellsim -c 'echo hello'
./target/release/shellsim eval --cpu 100k --memory 8m -c 'make test'
./target/release/shellsim-python ./project/main.py -- arg1
Limits accept k, m, and g binary suffixes. eval emits a structured result containing the
exit status, stdout and stderr, resource use, command trace, and unsupported behavior.
The Python API exposes fresh and persistent environments:
import shellsim
environment = shellsim.Environment(cpu=100_000)
environment.write_file("/work/main.py", "print(6 * 7)\n")
result = environment.run("python3.14 /work/main.py")
assert result.returncode == 0
assert result.stdout == b"42\n"
Agent harness
shellsim serve --root ./project runs a persistent newline-delimited JSON session. It supports
bounded execution, streaming actions, VFS operations, checkpoints, workspace diffs, process and
resource inspection, and deterministic session forks. shellsim mcp exposes the same environment
as a stdio MCP server. shellsim replay scenario.ndjson reruns checked action transcripts.
printf '%s\n' \
'{"id":1,"op":"execute","source":"printf hello > result"}' \
'{"id":2,"op":"workspace_diff"}' \
| shellsim serve --root ./project
Resource model
CPU is deterministic fuel, memory is modeled working set, disk is current virtual-filesystem usage, and output bounds materialized stdout and stderr. The defaults are 10,000,000 CPU units, 64 MiB memory, 64 MiB disk, and 4 MiB output. Costs are stable and intentionally approximate. Exhaustion is observable and never falls back to an ambient host implementation.
For internals and contribution workflow, see implementation, Python, and CONTRIBUTING.md.
Release files for shellsim 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| shellsim-0.1.3.tar.gz | 424.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| shellsim-0.1.3-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| shellsim-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| shellsim-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| shellsim-0.1.3-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| shellsim-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 11.0 MB
Release files / shellsim-0.1.3.tar.gz
| Download URL | shellsim-0.1.3.tar.gz |
|---|---|
| Size | 424.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9223bced793250f09655b08280088c373cab2b8a6cf91b1bbb2e64fbdde895e
|
|
BLAKE2b-256 checksum How to use checksums |
8f533257c80fb5bcd7ae09e920fd5438dfbeeb877a4e588ebb86bcfb38ece30e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / shellsim-0.1.3-cp39-abi3-win_amd64.whl
| Download URL | shellsim-0.1.3-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f2ce489896a5d6cb42f3b8a84286d7f0228658cb0ec4615a7cb1844dc88fc0ec
|
|
BLAKE2b-256 checksum How to use checksums |
6a5158c1388a5f1403e67b40eb2fa628d3f221319c63890e7d97d21307540d46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / shellsim-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | shellsim-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
da5115da771ce5147743a37cc60b225e90c804fef1ab9ac6d8f4cde2241f7afc
|
|
BLAKE2b-256 checksum How to use checksums |
7561c45dfc083e8964d34cf897604fc8249fe766063b3c97b0138b2d6cbb4702
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / shellsim-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | shellsim-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f08f3922019cd03dcf2dbbb095debeae4eeaa5ca73bba234c51594358bbdaa21
|
|
BLAKE2b-256 checksum How to use checksums |
3395064a3a9e381fe6dea012a97f5ef31023fe66248d95b49d4fe3e9551afa81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / shellsim-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | shellsim-0.1.3-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ab4292ecc30c9ff5f18af5d4979f0aa8fe1a177b9c4d0db652491ebb6d574ca4
|
|
BLAKE2b-256 checksum How to use checksums |
c398040b7dd62b52840c6d905ffeaab15bb2c4c15a4d72286bbaea96ff14e939
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / shellsim-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | shellsim-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f939aaa7fb05095d7228e649120afc73611d44e59aba665e048eeb6f27c4a942
|
|
BLAKE2b-256 checksum How to use checksums |
c1309a46c6eec70f5c437a4d3c9e1122b4de46b41db6a34e13d9cfdf90a7dab3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency log