Available on NuGet Read more

Computerwelt

An in-process sandboxed bash interpreter and Python runtime for .NET 10, sharing one virtual filesystem. No CPython, no container, no process.

What is Computerwelt?

Computerwelt is a C# library that gives a .NET application a shell and a Python interpreter it can hand to untrusted code, most often code written by a language model. Both are managed implementations of the language, running inside your process against a virtual filesystem you supply. Nothing is forked, nothing is executed, and no file on the host is reachable.

It is a ground-up port of two Rust projects, both MIT-licensed:

Upstream What it contributes
Bashkit the bash interpreter, the virtual filesystem, and the command implementations
Monty (Pydantic) a minimal, secure Python interpreter for running LLM-written code

They fit together the way they do upstream: the shell exposes Python as its python command, so python script.py runs in the same sandbox, against the same virtual filesystem, under the same resource limits as everything around it.

Project on GitHub Bashkit (upstream) Monty (upstream)


A first taste

using Computerwelt.Emulation.Bash;

var bash = Bash.CreateBuilder()
    .WithWorkingDirectory("/home/agent")
    .WithLimits(ExecutionLimits.Strict)
    .Build();

var result = await bash.ExecAsync("echo hello | tr a-z A-Z");

Console.WriteLine(result.Stdout);   // HELLO
using Computerwelt.Emulation.Python;

var python = new PythonRunner().Run("print(sum(x * x for x in range(5)))");

Console.WriteLine(python.Stdout);   // 30

Or both at once, over one filesystem:

using Computerwelt;
using Computerwelt.Emulation.Bash;

var bash = Bash.CreateBuilder().WithPython().Build();

await bash.ExecAsync("""
    echo '17 4 42' > /data.txt
    python -c "print(max(int(x) for x in open('/data.txt').read().split()))"
    """);
// 42

Packages

Package Contents
Computerwelt both halves, joined over one virtual filesystem
Computerwelt.Emulation.Bash the shell on its own
Computerwelt.Emulation.Python the Python interpreter on its own

Each project's root namespace is its package name, so a type's namespace says which package it ships in. Versions are CalVer (yy.M.<build>), computed by the release pipeline.


What "sandboxed" means here

No process spawning

Every command is a managed implementation. There is no PATH lookup, no fork, no exec.

No ambient filesystem

All I/O goes through IFileSystem. The default backend is an empty in-memory tree with a byte and file-count quota.

No ambient network

Nothing in the sandbox makes an outbound request unless the host configures one.

Enforced limits

Command count, loop iterations, recursion depth, output size, parser fuel and wall-clock time are charged during evaluation, not checked afterwards.

Isolated

Two Bash instances share nothing mutable, so one tenant's session cannot observe another's.

POSIX everywhere

Virtual paths are POSIX on every host, so the sandbox behaves identically on Linux, macOS and Windows.

See The sandbox model for what each of those buys you and where the boundary actually sits.


Where it is used

Computerwelt is the sandbox behind Sudo, the admin assistant in Curiosity Workspace. The workspace configuration is mounted as a virtual filesystem and Sudo edits it with ordinary shell and Python commands, with the workspace supplying the mounts, the extra commands and the limits. It is a worked example of every extension point this library has.


Conformance

Both upstreams ship golden corpora, and both transfer to the port unchanged. They are the definition of "correct" rather than a smoke test:

Suite Cases Notes
Shell 2,521 / 2,521 Bashkit's own corpus, 27 cases skipped by upstream directive
Python 557 / 558 Monty's 568 fixtures; the one failure asserts upstream's slot-recycling object identity
Joined 210 / 210 agent operations end to end, plus upstream's python command corpus
Extensions 11 / 11 fixtures for what this port adds beyond Monty

Both conformance suites are ratchet-based: a per-file baseline is recorded and a run fails if any file regresses.


Getting started

Install the package and run your first script.

Core concepts

The sandbox model, the virtual filesystem, and the limits.

The shell

What bash supports, which commands ship, and how to add your own.

Python

The language subset, the stdlib modules, and host libraries.

© 2026 Curiosity. All rights reserved.