Background agents with a full dev environment, and no bill while they wait
Promigence gives background agents a full development environment forked from a verified snapshot: your repository, its services and its build, ready when the agent starts. A long-running agent can pause while it waits on a person, a queue or a timer, and paused time is not billed.
Who this is for: Platform teams building internal background agents, and teams running vendor coding agents on their own pool.
forks in six hours, zero failures
warm fork
at 200 concurrent, all served
Three things that are true of almost every team doing this
A real task needs the whole dev environment
Databases, queues and a built frontend, not just a repository. Setting that up for every task takes longer than the task.
Agents spend most of their time waiting
On a reviewer, a queue or a timer. A sandbox billed for every second of that wait costs more than the work it does.
Secrets and network access need a boundary
An agent with production-like access must reach the hosts it should and nothing else, with credentials that are not baked into the environment.
With Promigence underneath
One snapshot of the full environment
Set up the services and the build once, verify them, and fork the finished environment for each agent run.
Pause while the agent waits
Set an idle rule and a sandbox pauses itself when nothing is happening, then wakes on the next request. Paused time is not billed.
Allow-listed network and secrets at run time
An outbound allow-list, with every refused host recorded, and secrets injected at run time, never stored in the snapshot your build produces.
# Store a credential once; it is injected at run time, never stored in the snapshot your build produces
promigence secrets set GITHUB_TOKEN --from-env GITHUB_TOKEN
# Fork the environment and let it pause itself when idle
promigence fork --snapshot devenv@9b0d3f1 --count 1 --cap 1
promigence sandbox autopause "$SANDBOX" --after 30s
# What it may reach, and every host it was refused
promigence sandbox network "$SANDBOX"
Language: bashWhat infrastructure should you use to run background coding agents on your private repos?
Give each task its own isolated sandbox that opens on your private repository with the dependencies installed and the tests passing, holds the model key as a stored secret, and reaches only the hosts the work needs. While the agent waits on a reviewer or a queue, the sandbox should pause and stop billing. On Promigence that means a verified snapshot of the repository, an outbound allow-list, an idle rule, and a spend cap on every sandbox.
How it works
- 01
Connect the repository and build it once
Connect GitHub once with
promigence github connect. Then build a snapshot of the repository whose setup steps install everything the task touches, including the services it talks to, and whose verify command must pass before anything is stored. A--startcommand brings up any service that should already be running when the agent arrives. The Claude Code guide has the private-repository version of the build command. - 02
Start the agent with its key stored
The first line reads the model key from your environment; the second stores it as a secret and starts Claude Code in a new sandbox, capped at $2. After the first run, the stored secret is enough. For private code, start it from your snapshot's alias and give it a prompt: the agent then works through the task headless, in the background.
Language: bashexport ANTHROPIC_API_KEY=... # already set in most setups promigence agent start claude --key-from-env ANTHROPIC_API_KEY --cap 2From the guide Run Claude Code, Codex or OpenCode in a sandbox
- 03
Name the hosts it may reach
List each host the task needs and nothing more. Sandboxes you start with
promigence forktake one--allowper host, as below, andpromigence sandbox networkthen lists the allowed hosts and each one the sandbox was refused. If an agent misbehaves,--cutswitches its outbound access off at once, for good.
Language: bashpromigence fork --snapshot my-analysis-env --count 1 --cap 1 \ --allow pypi.org --allow files.pythonhosted.orgFrom the guide Run LLM-generated code safely
- 04
Pause while it waits, then collect the work
Under an idle rule, a quiet sandbox pauses itself and the next request brings it back; paused time is not billed.
promigence sandbox inforeports where it stands: state, time left, cost so far and the commands it ran. When the agent is finished, copy its files out withpromigence files getand end the sandbox.
What you get, in numbers
| Result | What | Conditions |
|---|---|---|
| 104 ms | Wake a paused sandbox | From resume to the first database query; median of 100 runs, 127 ms under load Source |
| 30 days | Time a paused sandbox is kept | Waking it starts the 30 days again Source |
| 43.7 s | Whole coding-agent task | 20 steps on a 3 GB repository; median of 30 runs, 58.0 s under load Source |
What it costs
Take a task with 30 minutes of real work spread over an afternoon: 20 minutes, a three-hour wait for a person to approve the plan, then 10 minutes more. It runs in a medium sandbox (4 vCPU, 16 GiB) with an idle rule and a $1 cap.
Working time: 1,800 s × $0.000128 = $0.23. Waiting time, paused: $0. Without the idle rule, the sandbox would stay up for 12,600 s: 12,600 × $0.000128 = $1.61.
Total: $0.23 for the task with the idle rule, $1.61 without it.
With a 45-minute timeout, the quote is 2,700 s × $0.000128 = $0.35, inside the $1 cap; paused time does not use up the timeout. A start quoted over its cap is refused, and a sandbox that hits the cap stops billing and keeps its files and state until you raise the cap or end it.
Security and limits
- Runs can sit behind an outbound allow-list, or have no network at all.
- Unless you force it, no secret is written into a snapshot, because one baked in would reach every sandbox started from that snapshot.
- A paused sandbox costs nothing by the second and takes no place under your concurrency limit.
Questions
What does a background agent cost while it waits?
Nothing by the second, once its sandbox is paused. A paused sandbox is kept for 30 days, and waking it starts the 30 days again.
How does the sandbox know the agent is waiting?
Through an idle rule you set with promigence sandbox autopause. By default, idle means no API requests; with --mode activity it also means no CPU use, no network traffic and no open connection inside the sandbox. After the idle time you set, the sandbox pauses itself, and the next request wakes it.
Can a background agent reach your production systems?
Only the hosts you allow. Give its sandbox an outbound allow-list, or no network at all, and every refused connection is recorded, so you can read what the agent tried to reach.
Does the model key end up in the environment you build?
No. Secrets reach the sandbox when it runs and stay out of the snapshots you build, and a snapshot of a sandbox that holds one is refused unless you force it.
How long can a background agent run?
Until its timeout, which you set when it starts: an hour by default for promigence agent start. Paused time does not use the timeout up, and promigence sandbox extend gives a live sandbox a longer one if the extra time fits under its spend cap. The longest a sandbox may run is one of your account's limits.
Which agents can work in the background this way?
promigence agent start runs Claude Code, Codex or OpenCode headless from a prompt, each in a sandbox of its own. Agents you wrote yourself use the same sandboxes through the SDKs or the CLI.
What happens if the environment breaks halfway through a long task?
It is recorded as the environment's failure, never the agent's. A sandbox that fails on our side before it reaches you is not billed; after that, when our side shows the failure was ours, the work since its last snapshot or start, up to 24 hours, is credited back.
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
Not ready to hand over a repo? Read the quickstart or check the numbers first.