Run an isolated terminal in Chalk Sandboxes
This demo shows a Linux terminal running Python in a Chalk sandbox. Inspect the environment and its network restrictions, then use the example code to create the same isolation for your own workload.
Run a command inside an isolated sandbox
Run Python and test a blocked network request in the same sandbox. Follow the two checks below. Sessions last four minutes and end after ninety seconds of inactivity.
Try this experiment · expected results
1Run Python
Select Launch sandbox, then run this in the terminal.
python3 -c "print(2 + 2)"Expected: 4. The command runs inside your sandbox.
2Try an outbound request
Use Python to request a public site.
python3 -c "import urllib.request; urllib.request.urlopen('https://example.com', timeout=5)"Expected: A network error. This demo’s sandbox has no outbound access.
Launch the sandbox and run a Python command. Chalk supplies an isolated Linux environment; this example deliberately blocks outbound network access.
Built on Chalk
Chalk supplies the sandbox, isolation, resource limits, and interactive PTY. The example application relays the session to a browser terminal rendered by ghostty-web.
Isolate the workload with gVisor
KernelPolicy.RESTRICTED runs the sandbox under a user-space kernel, separating code inside it from the host kernel.
Choose the network policy
This demo launches without egress, including DNS. A workload that needs the network must be given an explicit policy for its allowed destinations.
Attach an interactive session
Chalk exposes a PTY session. The example server relays input and output over a WebSocket, and ghostty-web renders it in the browser.
Set limits per sandbox
CPU, memory, and lifetime are constructor arguments. The demo server also manages its warm pool and visitor limits; those are part of the example application.
A sandbox in a few lines of Python
Create a sandbox, run a command, stream another, and tear it down. Every limit you see on this page is a constructor argument: CPU, memory, lifetime, kernel policy, and network policy.
The terminal above is open source too. Its server keeps a warm pool, rate-limits by visitor, and relays a PTY over a WebSocket. The page uses ghostty-web.
git clone https://github.com/chalk-ai/sandbox-terminal
cd sandbox-terminal
# Or export CHALK_CLIENT_ID and CHALK_CLIENT_SECRET.
chalk login
# Builds the server image, starts a warm pool of sandboxes, prints your terminal's URL.
./deploy.pyGive your agents a safe place to work
Talk to an engineer about running sandboxes in your cloud, next to your data.