Skip to content

Code interpreters that answer while your user is still looking

Promigence runs the code your AI app writes in an isolated sandbox that is ready in milliseconds. In our benchmark a code-interpreter session took 1.15 seconds from start to result at the median, and Promigence works with the sandbox API many AI apps already use.

Who this is for: Teams building AI analysts, chat-with-your-data features and any AI app that runs code for its users.

177 ms

at 200 concurrent, all served

108,929

forks in six hours, zero failures

39 ms

warm fork

Three things that are true of almost every team doing this

01

Your user is watching

A code-interpreter answer is interactive. Every second of sandbox start-up is a second your user stares at a spinner in your product.

02

Model-written code needs a real boundary

The model writes the code, and anyone can prompt the model. It has to run somewhere isolated, with network access you control.

03

Switching providers should not be a rewrite

Code written against one sandbox API should not have to change to move to a faster one.

With Promigence underneath

  • Ready in milliseconds

    A sandbox is ready for its first command 8 milliseconds after it is requested.

  • Isolated, with network you decide

    Each session runs in its own isolated sandbox, which can sit behind an outbound allow-list.

  • A drop-in for the API you use

    Promigence works as a drop-in replacement for the sandbox API many AI apps already use, so moving over is a small code change.

A clean sandbox, then the code your model wrote
bash
# A fresh sandbox from the base image
promigence fork --count 1 --cap 1

# Run the model's code, isolated
promigence exec --sandbox "$SANDBOX" -- python3 analysis.py
Language: bash

Full quickstart

Which code interpreter API should an AI app use to execute Python?

Choose one that gives each user session an isolated sandbox of its own, answers before the user tires of the spinner, and lets you switch the network off and cap what a session spends. On Promigence a sandbox is ready for its first command 8 ms after the request, a notebook-style cell runs in 8.9 ms at the median, and code written for the sandbox API many AI apps already use moves over with a small change. Billing is per second, with a quote and a hard spend cap before anything runs.

How it works

  1. 01

    Build the environment once

    Make a snapshot that holds the libraries your model reaches for, such as pandas, with a verify command that has to exit 0 or nothing is stored. Name it my-analysis-env to match the code below; the MCP execute-tool guide shows the build command for a pandas environment. Sessions then start from that one clean environment, so a package installed by one user's code is never there for the next user. The build is billed per second while it runs, at most $0.17 at the small size.

  2. 02

    Run each answer's code in a sandbox of its own

    Write the model's program into the sandbox as a file, run it, then read the exit code and output. The SDK's compatibility Sandbox class keeps the calls you know from other sandbox APIs, and spendCap puts a dollar ceiling on the session. A non-zero exit is a normal answer: show it to the user, or hand the error back to the model for another try (throwOnExit: false on commands.run returns it as a result instead of an error).

    TypeScript
    import { Sandbox } from "@promigence/sdk";
    
    const modelWrittenCode = "print(sum(range(10)))"; // the Python your model wrote
    
    const sandbox = await Sandbox.create("my-analysis-env", { spendCap: 1 });
    
    await sandbox.files.write("/tmp/job.py", modelWrittenCode);
    const res = await sandbox.commands.run("python3 /tmp/job.py");
    console.log(res.exitCode, res.stdout);
    
    await sandbox.kill();
    
    Language: typescript

    From the guide Run LLM-generated code safely

  3. 03

    Open the network only where the code needs it

    Most analysis code needs no network at all, and a sandbox can start with none. When a session must install a package, name the package index hosts and nothing else. Afterwards, promigence sandbox network SID lists what the sandbox may reach and every host it was refused, which tells you what the code tried to do.

    Terminal
    promigence fork --snapshot my-analysis-env --count 1 --cap 1 \
      --allow pypi.org --allow files.pythonhosted.org
    
    Language: bash

    From the guide Run LLM-generated code safely

  4. 04

    End the session, or let it sleep

    Kill the sandbox when the conversation is over: its bill stops and its files are gone. For a user who will be back in a few minutes, pause it instead. A paused sandbox bills no seconds and keeps its files for 30 days, and with autopause it pauses itself when the user goes quiet and wakes on the next request.

    Terminal
    promigence sandbox kill SID
    
    Language: bash

    From the guide Run LLM-generated code safely

What you get, in numbers

ResultWhatConditions
8 msReady for its first commandcreate to first command, 2 vCPU / 4 GiB, n = 100, p50 Source
8.9 msOne notebook-style code cellp50 (p95 9.3 ms), through the public API from a client in the same region, 100 runs, measured 21 and 22 September 2026 Source
0.94 s100 sandboxes started at once, slowest 5%p95, every run completed, n = 400 Source
104 msWake a paused sandboxresume to first database query, n = 100, p50; 127 ms under load Source
$0.000046Small sandbox, per second2 vCPU / 4 GiB, $0.17 an hour at list Source

What it costs

An AI analyst feature answers 1,000 questions a day. Each question runs in a small sandbox (2 vCPU, 4 GiB) for 4 minutes of running time, and the sandbox is ended or paused afterwards.

1,000 sessions × 240 s × $0.000046 a second = $11.04

Total: $11.04 a day, about $331 over a 30-day month.

Give each sandbox a 30-minute timeout and a $1 cap: its quote, 1,800 s × $0.000046 = $0.08, sits under the cap, so it starts, and no single sandbox can cost more than $1. Paused time is not billed. Building the environment is billed once, at most $0.17 at small.

Security and limits

  • One user's sandbox cannot see, reach or address another user's, or anyone else's.
  • A session can run with no network at all, or behind an outbound allow-list of the hosts it needs.
  • Secrets are stored once, injected at run time and never passed on a command line; a snapshot you build never holds one unless you force it.
  • Whatever a session's code changes is discarded when its sandbox ends, unless you keep it.

Questions

How fast does a code-interpreter sandbox start on Promigence?

A sandbox is ready for its first command 8 ms after it is requested, at the median (2 vCPU / 4 GiB, n = 100). After that, a notebook-style cell runs in 8.9 ms at p50. Start a hundred sessions at once and the slowest 5% take 0.94 s.

Do a user's files survive between messages?

Yes. Reuse one sandbox for the whole conversation and the files it wrote are still there on the next call, or pause it between messages and it keeps them for 30 days without billing seconds. When the user leaves for good, kill it and the files go with it.

What stops prompt-injected code from reaching my systems?

The sandbox has only the network you give it. Start sessions with no network, or with an allow-list naming the few hosts the code needs, and read the refused hosts afterwards. Keys your app holds stay out of the sandbox: store them as secrets, and bind a key to its host so the code never sees the value.

Do I have to rewrite code built on another sandbox API?

Not much. The TypeScript SDK's compatibility Sandbox class carries the familiar calls (Sandbox.create, files.write, commands.run, kill), so existing call sites keep working through it. Try your own against it before you move traffic over.

How much does one code-interpreter session cost?

A small sandbox costs $0.000046 a second, about $0.17 an hour, billed only while it runs. Four minutes of running time comes to about $0.01. Set a cap per sandbox, and a start whose quote is over it is refused before anything runs.

Can the interpreter run languages other than Python?

Yes. The execute tool in the MCP guide accepts Python and JavaScript as well as bash scripts, and any other language works once its runtime is in the snapshot you build.

Should I write my own MCP execute tool or use the one in the CLI?

Write your own when the tool is part of a product you serve to other people and its rules belong in your code; the MCP guide has a complete server in TypeScript and Python. For a coding assistant on your own machine, promigence mcp is ready-made, and claude mcp add promigence -- promigence mcp adds it to Claude Code.

What happens when the model's code loops forever?

Three limits stop a runaway loop. A command timeout ends that one script, the sandbox's timeout ends the session, and the spend cap pauses the sandbox, files intact, the moment it is reached.

Run your own workload on it, free

Send a repo and the command you run against it, whatever that is: an eval suite, an RL rollout, a CI job, a queue of coding tasks. We build the environment once, run it a thousand times, and send back the timings, the failures and an exact price. Free, once, on your real workload.

  • 1,000 runs of your own command, on your own repo
  • What each one cost in wall clock, and anything that failed
  • Whether a failure was your code or the environment
  • An exact price for your real volume

A person replies, usually the same day. Or write to support@promigence.ai.

See our Privacy Policy for how we use what you send.

Not ready to hand over a repo? Read the quickstart or check the numbers first.

Request access

Leave your work email and we will email you an invite code with $100 in free credits.

See our Privacy Policy for how we use your email.