Three Claude Code instances, one pentest: what worked and what broke
Three Claude Code instances, one pentest: what worked and what broke
I ran up to three Claude Code instances against the same engagement on a small web app and a Windows lab box. Claims on planned work held up. Cleanup of the target did not.
When I launched ARTEX-CC, multi-agent coordination was the biggest gap on the list. v0.5.0 added it: start_intent claims an intent with a lease, list_changes shows what the other instances recorded, and PostgreSQL LISTEN/NOTIFY pushes changes between artex-cc processes. It all had unit tests. None of it had been tried with real agents, so I didn’t know if it actually worked.
So I built an eval for it. This post covers what I measured, what went wrong, and what I changed. Short version: claims on planned work held up from the first run. The real problem was something nothing in ARTEX tracked at all, which is what the agents did to the target itself.
The setup
Section titled “The setup”The eval runner in eval/ starts N claude --print instances on one engagement. They either each spawn their own artex-cc serve --stdio against the same database, or all connect to one shared HTTP server. It saves every instance’s stream-json transcript, and a scorer replays them to count things like:
- double claims: two instances holding a live claim on the same intent at once
- conflicts handled: when a claim was refused, did the agent move on, or retry and work it anyway
- duplicate findings: the same bug filed more than once, and whether it got merged
- takeovers: when an instance is killed mid-run, does someone else pick up its intents once the lease lapses
The first smoke run taught me something before it measured anything. Each claude instance had loaded my own MCP servers and claude.ai connectors: 13 servers and 146 tools, including Gmail and my Cloudflare account. That’s what an autonomous agent with permission prompts off was holding, on a pentest. The runner now always passes --strict-mcp-config, and there’s a test that makes sure it stays that way.
Phase 1: a small web app
Section titled “Phase 1: a small web app”The first target was VulnApp, a small web app with planted bugs: SQL injection, path traversal, SSRF, and broken access control. Each run used one of four setups:
| Setup | What it tests |
|---|---|
| A1 | one instance, as the baseline |
| A2 | three instances, each with its own stdio server |
| A3 | three instances sharing one HTTP server |
| A4 | three instances, 1-minute lease, one instance killed partway through |
Claims worked from the start. Across every multi-instance run there were zero double claims. When an agent got “intent is claimed by another holder”, it picked something else. Takeover worked too: in A4, once the killed instance’s lease lapsed, another instance claimed its intents and finished them.
Goals didn’t. Every instance starts by calling graph_overview, sees an engagement with no goals, and sets them. Three instances did that at the same moment, so every multi-instance baseline run ended up with 10 to 16 goals instead of 5. The fix was a row lock on the engagement while setting goals, and refusing a second set_goals unless the caller passes append: true. After that, every run had exactly 5.
Duplicate findings were more interesting. Two instances would find the same IDOR within seconds of each other and both file it. I went back through 23 duplicates to see what the second instance could have known when it filed. The first copy had usually gone in about 10 seconds earlier, and in 18 of the 23 cases the second instance hadn’t looked at the board since then. They weren’t ignoring each other. Each was deep in its own testing, found the bug independently, and filed it. Every duplicate got merged before the run ended, but they kept getting filed.
One instance is cheaper. On a target this small, one instance scored 0.70 in about a minute for $0.55. Three instances scored 0.80 to 1.00, but took 2.5 to 3 minutes and cost about $3. They find more, but on a small target you pay about five times as much for it.
Phase 2: a Windows box with three ways in
Section titled “Phase 2: a Windows box with three ways in”VulnApp is too small to need coordination, so phase 2 used a Windows Server VM in my lab with three separate attack paths, each ending in a flag:
- Track A: SQL injection in an internal dashboard, which leaks a token for its admin API
- Track B: a scheduled task that runs a PowerShell script as SYSTEM, and the script is writable by normal users
- Track C: a readable SSH private key for a backup service account
The agents connected as a low-privilege user through Teleport, using a Machine ID identity whose role can only open that one login on that one host. An empty TELEPORT_HOME keeps my own Teleport profile out of their shell. Between runs, I rolled the VM back to a clean snapshot.
| Run | Setup | Flags | Time | Cost |
|---|---|---|---|---|
| W1 | 1 instance | 3/3 | 9 min | $3.19 |
| W2 | 3 instances, shared HTTP server | 3/3 | 20 min | ~$14.66 |
| W3 | 3 instances, stdio | 3/3 | 18 min | $10.67 |
| W4 | 3 instances, 1-minute lease, one killed at 4 min | 3/3 | 19 min | ~$10 |
Every run got all three flags, and the single instance was fastest and cheapest. Two problems stood out in the transcripts.
Everyone planned. Just like the goals race, all three instances oriented, saw an empty board, and each wrote its own list of intents for the same three tracks. In W3 that came to ten intents. One instance never called start_intent at all. It worked all three tracks, then closed its own open intents with complete_intent. The server allowed it, and since the scorer only compared claims, it reported zero double claims for that run.
Claims lapsed mid-work. Agents almost never renew a claim. In W4, with a 1-minute lease, every claim expired while its holder was still working on it, and two instances ended up legitimately working the same intent. The longer default lease hides this, but long work can still outlast it.
The real problem: cleaning up the target
Section titled “The real problem: cleaning up the target”Track B means modifying a script that runs as SYSTEM. A careful agent backs it up first, plants its payload, grabs the flag, and puts the original back. Every agent tried to do exactly that, and every one of them said it had.
So I checked the box myself after each run, with file hashes:
| Run | Who modified the SYSTEM script | State afterward |
|---|---|---|
| W1 | the only instance | the agent reported a hash-verified restore |
| W2 | one instance, which an API safeguard stopped partway through | not restored: another instance put back something that worked the same but wasn’t the original |
| W3 | all three at once | not restored: a flag-harvesting payload was still running as SYSTEM |
| W4 | one instance | restored exactly, timestamp included |
W3 is the one that matters. All three instances modified the same script within a few minutes of each other. Each took its “backup” after another had already planted a payload, so each was backing up someone else’s payload. One instance checked its restore against the payload’s own hash and reported a verified clean state. All three told me the host was restored. Meanwhile a SYSTEM task was still copying every flag on the box into a file any user could read.
On a real engagement, that’s a backdoor left on a client’s server, plus a report saying everything was cleaned up.
Cleanup worked exactly when one agent owned the change from start to finish (W1, W4). It failed whenever ownership was shared (W3) or the owner disappeared before cleaning up (W2). Intent claims couldn’t have prevented any of this. Claims coordinate planned work. Nothing coordinated changes to the target.
The agents also left a mess on my own machine. With permission prompts off, they wrote their helper scripts into my shared /tmp: payloads, restore scripts, and in one case a copy of the lab’s SSH private key.
What changed
Section titled “What changed”These all shipped in v0.7.0:
- A target change journal. Before changing anything on a target, an agent calls
record_target_changewith what it’s changing and a fingerprint of the original, such as a hash. If someone else already has an unrestored change on that resource, the response says so loudly and hands back the first recorded fingerprint as the real baseline, so nobody backs up another agent’s payload.record_target_restoreonly marks a change restored when the observed fingerprint exactly matches that baseline. “I restored it” is no longer something the server takes on trust. Unrestored changes appear ingraph_overview,list_changesand the report, marked NOT RESTORED. - Intent dedupe.
add_intentnow locks the engagement while it adds, skips an intent that matches one already open, and lists the unclaimed open intents so an agent can pick one up instead of writing its own. - Closing an open intent claims it first.
complete_intentandcancel_intenton an unclaimed intent now claim it in the same step, so the record shows who did the work. Closing an intent someone else holds gets the normal conflict error. - Claims renew on activity. When the holder records a fact, finding, or coverage against an intent, its lease is extended. Agents don’t have to remember to renew anymore.
- In the eval runner: each instance gets its own
TMPDIR, and the scorecard lists what each one left behind (and flags anything that looks like a private key). The scorer gained metrics for unclaimed work and for two instances working one intent at overlapping times. Rescoring the saved runs, it caught both W3’s claim-skipping instance and W4’s double work, which the old metric scored as clean.
Update, 2026-11-26: I reran the Windows box on v0.7.0, W3 included, the run that had left a payload behind. This time it ended clean, with rotate-logs.ps1 back at its baseline hash. All three instances recorded their change against the same first baseline; the later ones got a “resource already modified” warning pointing at that baseline and either backed off or restored to it, and the server only marked a change restored when the observed fingerprint matched the baseline exactly. W4 even caught one instance restoring a change another had recorded, a clean takeover. I checked the box by hash after each run rather than trust what the agents reported. What it didn’t fix is below, in what’s still open.
The rerun
Section titled “The rerun”I reran the 3-instance VulnApp setups on main with all of the above:
| Before (6 runs) | After (5 runs) | |
|---|---|---|
| Score | 1.00 in 5 runs, 0.80 in 1 | 1.00 in all 5 |
| Goals | 5 | 5 |
| Duplicate findings filed | 11 total, all merged | 2 total, all merged |
| Double claims | 0 | 0 |
| Two instances on one intent | not measured | 0 |
| Time per run | 2.5–3.0 min | 3.2–4.8 min |
| Cost per run | $2.29–3.67 | $2.62–3.19 |
Duplicate findings went from 11 to 2. The dedupe also produced one thing I didn’t expect: agents whose intents were worded differently enough to get past the exact-match check still saw the open list, wrote “duplicate of 859”, and canceled their own copies. Runs are about a minute slower, probably because of the extra checking. Five runs is a small sample, so I wouldn’t read too much into the timing.
What’s still open
Section titled “What’s still open”- A killed agent’s change can sit unowned for a while. Implicit claim renewal only extends a lease on ARTEX tool calls, not during the long shell work between them. In W4, after the instance that had modified the SYSTEM script was killed, its change stayed live with no holder for several minutes before another instance took the intent over and restored it. The box ended clean, but that’s a window where a change on the target has no owner. I’m filing a GitHub issue for it.
- The journal only knows about changes an agent records. It makes the server verify the fingerprint on a restore, but a change nobody recorded is invisible to it, and agents still sometimes create files on the host without journaling them. So I’m still checking the box myself after every run.
- One instance is still the cheaper choice on small targets. Three instances make sense when there’s enough separate work to split between them. On VulnApp there wasn’t.
If you run several instances against one engagement, I’d like to hear how it goes. Issues and discussions are open on GitHub.