Agentic CI with a known cost before every run
Promigence gives every agentic CI job a warm environment forked from a verified snapshot of your repo, so an agent starts at a built tree rather than at a git clone. Most of an agent-heavy CI bill is repeated setup. Forking removes it, and a quote before each run keeps the monthly number predictable.
Who this is for: Platform teams running coding agents against their own repositories in CI.
end to end, through the CLI
warm fork
forks in six hours, zero failures
Three things that are true of almost every team doing this
Setup is most of the job
A five-minute agent task behind a ninety-second install is 30% overhead, paid on every job.
The bill scales with enthusiasm
Agentic CI usage grows the moment it works, and per-second billing means the finance conversation happens afterwards.
Flaky environments look like flaky agents
A dependency that fails to resolve at 3am produces a red build nobody can attribute, and trust erodes in the agent rather than the fleet.
With Promigence underneath
A snapshot per branch, rebuilt when the lockfile moves
So most pushes start from a snapshot that is already built and verified.
Quote and cap per pipeline
Every workflow knows its ceiling before it starts, and a runaway loop is paused at the cap.
Environment failures show up as environment failures
Red builds get a cause attached, which is the only way an agent-driven pipeline keeps anyone's trust.
- name: Agent pass on the PR
run: |
promigence run \
--snapshot app --secret ANTHROPIC_API_KEY \
--count 1 --cap 0.50 --timeout 10m --json \
-- sh -c "cd /work/repo && git fetch -q origin ${GITHUB_SHA} && git checkout -q ${GITHUB_SHA} && claude -p 'fix the failing tests in this diff'"
env:
PROMIGENCE_API_KEY: ${{ secrets.PROMIGENCE_API_KEY }}
Language: yamlWhat tools let AI agents run and fix CI pipelines automatically?
Two pieces do it: an agent that can change code, such as Claude Code, Codex or OpenCode, and a place for each attempt to run with your repository already built. The second piece is what Promigence provides. A pipeline step starts a sandbox from your repository's verified snapshot, the agent works on the failing tests there under a spend cap and a timeout, and the step prints one JSON document the pipeline can act on. Each attempt's cost is quoted before it starts.
How it works
- 01
Build the snapshot the workflow names
The workflow step above starts from a snapshot called app. Build it from an image with two setup steps, a clone at a pinned commit and the install, plus your test command as the verify step. It is stored only if that command exits 0. Keep one path in both places: this example clones into
/work/app, while the workflow step changes into/work/repo.
Language: bashpromigence snapshot create --image node:22 \ --setup "git clone https://github.com/your-org/your-app /work/app && git -C /work/app checkout <40-char sha>" \ --setup "cd /work/app && npm ci" \ --verify "cd /work/app && npm test" \ --alias app --wait --wait-timeout 10mFrom the guide Snapshot after npm install, then fork 10 copies
- 02
Store the model key once
Because the step passes
--secret ANTHROPIC_API_KEY, a secret of that name must exist before the first run. Store it once withpromigence secrets setand--from-env, which reads the value from an environment variable rather than the command line. The pipeline itself holds onlyPROMIGENCE_API_KEY, as a repository secret. - 03
Know the ceiling before the job starts
promigence run quoteprices a run before any sandbox exists, as if each one ran for its whole timeout. The step above sets--cap 0.50and--timeout 10m. A run whose quote tops its cap is refused outright, and if a sandbox hits that ceiling mid-run, it pauses with its files in place, so a looping agent stops costing money. - 04
Act on the result
With
--json, the run prints one JSON document: what completed, what failed the task, what failed because of the environment, and the cost. Fail the job on a task failure. Retry on an environment failure, then pass the agent's diff to a person for review.
What you get, in numbers
| Result | What | Conditions |
|---|---|---|
| 43.7 s | Whole coding-agent task | 20 steps on a 3 GB repository; median of 30 runs, 58.0 s under load Source |
| 48.5 to 55.9 s | CI job, start to finish | A clone, an install and a type-check at 4 vCPU / 16 GiB; median of at least 3 runs Source |
| 8 ms | Sandbox ready to run a command | From create to the first command at 2 vCPU / 4 GiB; median of 100 runs Source |
What it costs
The workflow step at the top of this page, in a small sandbox (2 vCPU, 4 GiB) with its 10-minute timeout and $0.50 cap, run on 40 failing pull requests a month. The 40 is an example input.
Quote per run: 600 s × $0.000046 = $0.0276. A month in which every run used its whole timeout: 40 × $0.0276 = $1.10.
Total: at most $1.10 a month for the agent's sandboxes.
Each run's quote, under three cents, sits well inside its $0.50 cap. Building the snapshot costs at most $0.17 at small, billed by the second, and runs started from it pay no further build charge. The model's tokens are not in this figure: your model provider charges for those.
Security and limits
- Anything over an account limit is turned down before it starts, and its error code names the limit along with the fix.
- A sandbox is never billed past its cap: it is paused when it reaches the cap, or stopped there if it cannot be paused.
- With Promigence Runners on, each CI job gets its own console page showing who started it, the commit, the runner's size and what the job cost.
Questions
How do I cap what an AI agent can spend when it fixes a failing CI job?
Put --cap and --timeout on the run that starts the agent. A run whose quote is over the cap never starts, and one that reaches the cap mid-run is paused rather than billed further. Limit the agent's own turns too, since the model's tokens are billed by its provider.
Does the agent need the whole repository rebuilt on every job?
No. It starts from a snapshot that already has the install and the build done, and the step checks out the commit it was given inside the sandbox. Rebuild the snapshot when the lockfile changes.
How does the pipeline tell a broken environment from a bad fix?
From the run's report. Environment failures are counted apart from task failures, so a red build caused by the environment comes with that cause attached.
Can the CI job itself run on Promigence?
Yes. Turn CI on for the repository in the console, and one line, runs-on: promigence, moves a GitHub Actions job onto Promigence sandboxes; GitLab CI uses a runner tag. The runner guide covers both.
Which agents can run in the pipeline step?
Any agent CLI your command can start inside the sandbox. The step on this page runs Claude Code in headless mode, and promigence agent start can install Claude Code, Codex or OpenCode for you.
What happens when the agent cannot fix the tests?
The run reports a task failure and the job goes red like any other failing build. What the failed sandbox left stays reopenable for up to a week, so a person can run promigence run open and see what the agent tried.
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.