Skip to content

Reinforcement-learning environments that cannot poison the reward

Promigence runs thousands of concurrent RL environments forked from one verified snapshot, each proven to work before the episode starts. A broken environment does not just lose you an episode: the optimiser treats its failure as real and the model learns from something that never happened.

Who this is for: RL environment vendors, data vendors, and labs' own post-training teams running coding agents.

177 ms

at 200 concurrent, all served

39 ms

warm fork

108,929

forks in six hours, zero failures

Three things that are true of almost every team doing this

01

A broken environment is a poisoned reward

The agent writes a correct patch, the environment failed to install a dependency, the test fails, and the optimiser updates on it. Unlike a wrong eval chart, this one is baked into weights.

02

Concurrency ceilings you discover in production

Published accounts put real fleets capping at 300 to 550 concurrent, with orchestration the bottleneck past 256. A training step that needs 2,000 does not degrade gracefully, it stalls.

03

Per-second billing on millions of episodes

At millions of episodes, cold setup is most of the bill, and you are paying it to run the same install over and over.

With Promigence underneath

  • Verification is a precondition, not a hope

    No snapshot is stored that cannot pass its own test, and no fork is handed over cold. Environment failures are reported separately, so they never enter the reward signal.

  • Fan-out designed for the training step, not the demo

    A thousand forks for one training step start warm, not as a thousand cold installs.

  • Volume pricing on committed capacity

    Committed-use rates for sustained volume. Talk to us about running it in your own cloud account.

A training step: environments verified, fanned out, capped
Python
from promigence import Promigence

client = Promigence()   # reads PROMIGENCE_API_KEY

# The quote for one training step, before anything starts
quote = client.runs.quote("task-suite", count=20, spend_cap=1.0)   # 20 at once

# Fan out the step: copies of one verified snapshot
run = client.runs.start(
    "task-suite", count=20, spend_cap=1.0,
    exec={"sh": f"python -m rollout --policy {policy_url}"},
)

# Environment failures apart from task failures, and what the step cost
report = client.runs.report(run["run_id"])
print(report["totals"], report["cost"])
Language: python

Full quickstart

How do you run thousands of RL environments concurrently?

Start every rollout from one verified snapshot of the environment, give each its own copy, and drop the episodes whose environment broke before you compute the reward. The Max plan runs up to 500 sandboxes at once, or 1,000 at its $500 level; beyond that, an Enterprise contract fixes the limit and can hold capacity in reserve. Copies open where your setup left off, with nothing to install again. A training step is quoted before it starts and held to a hard spend cap.

How it works

  1. 01

    Build the task environment once, and let a test prove it

    A recipe build clones your task repository at a pinned commit, runs the setup, then runs your verify command. Only a build whose verify command exits 0 is stored. One that fails its own check is billed for the time it ran, and the copies started from a stored snapshot pay no further build charge. Pin the commit, since a moving ref gives a different environment next week.

    Terminal
    promigence 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 10m
    
    Language: bash

    From the guide Snapshot after npm install, then fork 10 copies

  2. 02

    Quote the training step, then cap it

    Before a step starts, promigence run quote gives its ceiling: the cost if every rollout used its full timeout. Set --cap at or below that number, and a step that would go over is refused before anything starts. From Python, client.runs.quote and spend_cap do the same job, as in the training-step code above. The quickstart walks through the quote and the cap from the CLI.

  3. 03

    Grade in a clean copy, and keep a held-out test

    On promigence run, --grade scores the work in a clean copy of the environment after the rollout command ends, and --holdout runs a second, held-out test whose pass rate the report sets beside the first. A gap that widens over training deserves a look. --verify-each re-runs the snapshot's verify command in each sandbox before the rollout begins. Every flag is in the CLI reference.

  4. 04

    Branch a group of rollouts from one state

    When several rollouts should start from the same mid-task point, take a snapshot of a running sandbox and fork the group from it. This tested program forks ten copies under one $3 cap, runs one attempt in each and keeps the first that passed. Put your rollout where node agent.js stands.

    Python
    from concurrent.futures import ThreadPoolExecutor
    from typing import List
    
    from promigence import Promigence, Sandbox
    
    REPO = "https://github.com/your-org/your-app"
    
    with Promigence() as client:  # reads PROMIGENCE_API_KEY
        setup = Sandbox.create(client=client, spend_cap=1, timeout_ms=30 * 60_000)
        setup.commands.run(f"git clone --depth 1 {REPO} /work/app && cd /work/app && npm install", timeout_ms=15 * 60_000)
        snap = client.sandboxes.snapshot(setup.sandbox_id, alias="app-installed", move_alias=True)
        setup.kill()
    
        copies: List[Sandbox] = Sandbox.fork(
            snap["snapshot_id"], client=client, count=10, spend_cap=3, timeout_ms=20 * 60_000,
        )
    
        def attempt(i: int) -> bool:
            result = copies[i].commands.run(
                "cd /work/app && node agent.js && npm test",
                envs={"ATTEMPT": str(i)}, timeout_ms=15 * 60_000, throw_on_exit=False,
            )
            return result.exit_code == 0
    
        with ThreadPoolExecutor(max_workers=10) as pool:
            passed = list(pool.map(attempt, range(10)))
    
        winner = passed.index(True) if True in passed else None
        print(f"attempt {winner} passed" if winner is not None else "no attempt passed")
        for i, sbx in enumerate(copies):
            if i != winner:
                sbx.kill()
    
    Language: python

    From the guide Snapshot after npm install, then fork 10 copies

What you get, in numbers

ResultWhatConditions
1,343RL rollouts per minute, 8 at oncen=40, p50 Source
0.94 s100 sandboxes started together, slowest 5%p95, n=400, every run completed Source
104 mswake a paused sandboxp50 over n=100, resume to first database query; under load, 127 ms Source
1,000sandboxes at once on Maxat the $500 level; 500 at $250; Enterprise sets its own limit Source

What it costs

A training run of 50 steps, each step 400 rollouts on small sandboxes (2 vCPU, 4 GiB) with a 5-minute timeout, on the Max plan, which runs up to 500 at once. The step count, the width, the timeout and the average rollout length are all example inputs.

Quote per step: 400 × 300 s × $0.000046 per second = $5.52, so 50 steps quote at 50 × $5.52 = $276.00. The environment's snapshot is built once, for at most $0.17 at small, and every step reuses it. If rollouts average 2 minutes, a step bills 400 × 120 s × $0.000046 = $2.21 and the run about $110.40.

Total: at most $276.17 for the whole run with the build, about $110.57 at a 2-minute average.

A step's quote is a ceiling that --cap (or spend_cap in the SDK) enforces, so one runaway step cannot spend the run's budget. Paused time is not billed: a rollout on opt-in auto-pause accrues nothing while it waits on the policy, and wakes on the next request. For sustained volume, Enterprise sets committed-use rates on one call.

Security and limits

  • Rollouts cannot contaminate each other: a sandbox has no way to see or reach any other, and one rollout's writes stay in its own sandbox.
  • Network access is set per run: none at all, open, or limited to a list of hosts, and every refused connection is recorded.
  • A key you hand to one rollout stays out of the environment the others start from: secrets arrive at run time, and no snapshot stores a secret unless you force it.
  • Trajectories are yours: customer code, files, prompts and agent outputs do not go into training any AI model.

Questions

How do environment failures stay out of the reward?

Drop the episodes the report classes as environment failures before you compute the reward. Every run splits them from task failures, sandbox by sandbox, and promigence run replay sends only the environment failures through again, in new sandboxes, counted on their own.

Can thousands of rollouts run without sharing state?

Yes. Each rollout gets its own sandbox started from the same verified snapshot, and nothing one rollout writes reaches another. A 1,000-wide step fits the $500 level of Max.

Which trainers and model providers does it work with?

Any trainer that can call the Python or TypeScript SDK, the REST API or a shell command can drive it. It is model-neutral and lab-neutral and runs any vendor's agent, which a cross-lab comparison needs.

What helps against reward hacking?

Grade where the agent never worked, and keep a test it never saw. --grade scores the work in a clean copy after the rollout ends, --holdout adds a held-out test with the gap shown in the report, and promigence sandbox probe checks whether a sandbox's files still match the verified snapshot it started from.

Do idle rollouts cost money while the policy is thinking?

An idle rollout costs nothing while it is paused. Auto-pause on idle is opt-in (promigence sandbox autopause), and the sandbox wakes on the next request, measured at 104 ms p50 from resume to a first database query. A paused sandbox is kept for 30 days.

Will a rollout be killed for pinning every CPU?

No. Health checks cannot be starved by your workload, so a busy environment is never marked unhealthy, even with every vCPU busy.

Is there volume pricing for millions of episodes?

Yes, on the Enterprise plan, priced on one call with committed capacity contracts and reserved capacity. Max already includes 5× the usage of Pro, with usage past that billed below list by commitment.

Can it be deployed in our own cloud account?

Deployment in your own cloud account is an Enterprise conversation. The Enterprise plan lists it as something to settle on the call, for training data that has to stay inside your boundary.

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.