---
title: "Sandboxes for AI pentest agents: a fresh target per attempt"
description: "Promigence lets offensive-security agents fork a fresh, identical copy of a prepared target for every attempt, behind an outbound allow-list."
url: "https://www.promigence.ai/for/ai-pentest"
site: "Promigence"
---

# AI pentest agents that attack a fresh copy of the target every time

Promigence lets an offensive-security agent fork the same prepared target as many times as it needs, so every exploit attempt starts from an identical, clean state, behind an outbound allow-list.

**Who this is for:** Teams building AI penetration-testing and offensive-security agents.

## What breaks today
### Every attempt changes the target
An exploit that half-worked leaves the target in a state the next attempt did not expect, and results stop being comparable.

### Parallel attempts need parallel targets
Rebuilding the target for each attempt is slow, so attempts run one after another.

### An attacking agent must not reach the wrong hosts
An agent with open network access is a liability. It has to reach the target and nothing else.

## What changes with Promigence
### Fork the prepared target
Build the target once as a verified snapshot and fork a fresh copy per attempt. Each starts identical and isolated.

### Many attempts at once
Forks start warm, so dozens of attempts can run side by side from the same starting point.

### An outbound allow-list
An outbound allow-list, every refused host recorded, and a sandbox's egress can be cut at once.

## One prepared target, a fresh copy per attempt
```bash
promigence snapshot create --image debian:12 \
  --setup "apt-get update && apt-get install -y git" \
  --setup "git clone https://github.com/your-org/target-app /work/app && git -C /work/app checkout <40-char sha>" \
  --setup "cd /work/app && ./provision.sh" --verify "cd /work/app && ./healthcheck.sh" \
  --alias target-app --wait --wait-timeout 10m
promigence fork --snapshot target-app --count 20 --cap 5

# What a copy may reach, and every host it was refused
promigence sandbox network "$SANDBOX"
```

## How do I give an AI security-testing agent a fresh, isolated copy of my application for every run?

Snapshot the application once, already running on test data, behind a health check that has to pass before anything is stored. Every test run forks a fresh sandbox from that snapshot, so the agent meets the same app in the same state each time, and nothing an earlier run changed is left behind. The agent works inside the sandbox against the copy on localhost, with an outbound allow-list naming only your model API, and the sandbox is deleted once its report is copied out. Point it only at systems you own or have written permission to test.

## How it works

### Build the copy from your Dockerfile

Point `snapshot create` at the Dockerfile you already have, give it the command that starts your app, and make the verify step wait until the health route answers. A copy that cannot start never becomes a snapshot. The medium size gives the app and the agent 4 vCPU and 16 GiB side by side. Seed the image with test accounts and fixtures only, and put your testing agent in the same image so every run pairs the same app with the same agent.

```bash
promigence snapshot create --dockerfile ./Dockerfile --tier medium \
  --start "cd /app && ./start.sh > /tmp/app.log 2>&1" \
  --verify "timeout 120 sh -c 'until curl -fsS http://127.0.0.1:8080/health; do sleep 2; done'" \
  --alias app-under-test --wait --wait-timeout 15m
```

### Keep the model key out of the copy

Your agent needs a model API key, and nothing inside the sandbox should be able to read it. Store it once, bound to the model API's host: requests sent to the address the command prints arrive authenticated, and `--no-raw` means no run can ever ask for the value. That key is the only secret a test run needs.

```bash
export ANTHROPIC_API_KEY=...   # already set in most setups
promigence secrets set ANTHROPIC_API_KEY --from-env ANTHROPIC_API_KEY \
  --host api.anthropic.com --no-raw
```

### Price the run and cap it

A quote is the most a run can cost, with every sandbox running for its whole timeout. Set the run's cap at or above it: a run quoted over its cap is refused before anything starts, and a sandbox that reaches the cap is paused with its files kept.

```bash
promigence run quote --snapshot app-under-test --count 1 --timeout 1h
```

### Run, collect, throw away

Fork a fresh copy by the snapshot's id, start your agent inside it against `http://127.0.0.1:8080` (or your app's own port), then copy out its report, the app's log and the list of refused hosts before killing the sandbox. Whatever the run changed goes with it. The complete script, with TypeScript and Python versions, is in the security-testing guide linked below.

## What you get, in numbers

| What | Result | Conditions |
|---|---|---|
| 20 copies of a warm workspace, all usable | 1.41 s | p50 over 3 rounds, measured 18 September 2026 [Source](https://www.promigence.ai/#numbers) |
| Medium sandbox, per second | $0.000128 | 4 vCPU / 16 GiB, $0.46 an hour at list [Source](https://www.promigence.ai/#pricing) |
| Sandboxes at once on a new account | 20 | each for up to an hour, 15 minutes unless the timeout asks for more [Source](https://www.promigence.ai/docs/limits) |
| How long a failed sandbox's state is kept | up to 7 days | by default, so you can reopen it or delete it sooner [Source](https://www.promigence.ai/security) |

## What it costs

Twenty test runs side by side against fresh copies of your app, each on a medium sandbox (4 vCPU, 16 GiB) with a one-hour timeout. The agents finish in 25 minutes.

Quote: 20 × 3,600 s × $0.000128 = $9.22. Billed: 20 × 1,500 s × $0.000128 = $3.84.

Total: $3.84 for the twenty runs, and $9.22 at most.

Set the run's cap at $10 or more, since a run quoted over its cap is refused. Twenty at once is a new account's limit. Building the snapshot is billed once at the medium rate for the time it runs, at most an hour ($0.46), and your model provider bills the tokens.

## Security and limits

- A copy cannot see, reach or address another sandbox, yours or anyone else's, so parallel runs never share state.
- Outbound access is yours to set: an allow-list naming only the hosts a test needs, or no network at all.
- Secrets are injected at run time and never written into a snapshot unless you explicitly force it.
- Nothing from a test run, whether your code, the agent's output or its findings, is used to train models.

## Related

- [Security-testing agents against a fresh copy of your own application](https://www.promigence.ai/docs/guides/ai-pentest-fresh-target)
- [Snapshot after an install, then start ten copies](https://www.promigence.ai/docs/guides/snapshot-and-fork)
- [Running AI-written code safely](https://www.promigence.ai/docs/guides/run-ai-written-code-safely)
- [Acceptable Use Policy, section 4: permitted security research](https://www.promigence.ai/legal/acceptable-use)
- [Security and data handling](https://www.promigence.ai/security)
- [Quickstart](https://www.promigence.ai/docs/quickstart)

## Questions

### Can I point the agent at production or at someone else's systems?

No. Test only systems you own or have written permission to test, and here that is a copy of your own application inside a sandbox you started. The Acceptable Use Policy permits security testing in your sandboxes only when its conditions hold, among them that the targets are yours, authorized or deliberately vulnerable test environments, and that network access for the workload is restricted to those targets.

### How do I re-run a finding against exactly the same copy?

Fork the snapshot id the run recorded, rather than the alias. A snapshot is named by a hash of its contents and kept until you delete it, so the copy a finding came from can be started again later, whatever the alias points to by then. The CLI can also export it as a portable bundle to attach to the finding.

### Can the agent reach anything outside its sandbox?

Only the hosts on its allow-list, which in the guide's setup is one: your model API. Every other host it asks for is refused and recorded, and `promigence sandbox network SID` lists them after the run. If a run looks wrong, `--cut` ends the sandbox's outbound access at once, for good.

### Does the agent ever see the model key?

Not if you store it bound to the model API's host with `--no-raw`. The sandbox sends its requests to the address `secrets set` printed, they arrive authenticated, and the key's value never enters the copy.

### What does one security-test run cost?

A medium sandbox lists at $0.46 an hour, billed per second, so a run that stops after 25 minutes costs about $0.19. Quote it first and set a cap; the cap is the most the run can ever cost.

### Why does every run need a fresh copy?

Findings only compare when every run starts from the same place. On a shared target, a run that changed data, sessions or files leaves those changes for the next one. A fresh copy starts clean, and killing its sandbox discards everything the run did.

### Can several test runs go at once?

Yes. Start them with a count and each sandbox is a separate fresh copy; one command runs your agent in all of them, and another ends them all. On a new account, up to 20 run at once.

