Writing ·
How to stress-test a long-running multi-agent system for adversarial failures
Warm up representative memory, tools, and shared state, inject one bounded adversarial event, then assess detection, containment, recovery, and cleanup separately before promotion.
By Youssef Hemimy · agent safety · agent evaluation · AgentOps
Test a long-running agent system after it has representative memory, tools, work artifacts, and shared state—not only from a blank session. Introduce one bounded adversarial event through a normal input surface, then check separately whether the system detected it, prevented consequential propagation, recovered the intended state, and removed the contamination it created.
That is an engineering test design, not a claim that a single harness can certify a system as safe. The point is to make persistence visible before promotion. For a narrower action-boundary test, start with testing instruction hierarchy in AI agents.
Warm-up state
memory, artifacts, permissions, queued work
Bounded event
one input surface, one protected constraint
Declared paths
tools, memory, shared records, peer handoffs
Detection
A usable signal reached a control or operator.
Containment
The event did not reach a protected path.
Recovery
The required safe postcondition was restored.
Cleanup
Contaminated state cannot be reused by ordinary work.
Record each check separately, then reset to the captured starting state before the next repeat.
Why a fresh prompt test leaves a gap
In the Emergence World preprint, researchers ran eight simulated ten-agent worlds with persistent memory, tools, and shared institutions, then introduced controlled stress events only after the worlds had accumulated operating history. The events covered indirect prompt injection, misinformation, and exposure of private agent memories through ordinary interaction surfaces. Source: Akkil et al.
The reported setting is deliberately unlike a short, isolated prompt check: prior work, saved information, and peer interactions could influence what happened after the event. The authors report that, in their simulated worlds, recognizing a threat did not necessarily mean the threat was restrained, contained, or followed by recovery. Source: Akkil et al.
Design the test around an event and its consequences
OWASP describes its Agentic AI – Threats and Mitigations guide as a threat-model-based reference for emerging agentic threats and mitigations. Source: OWASP Use that framing before choosing test content: name the interaction surface, what the event is trying to influence, and what consequence would matter.
For each event, write a compact test card before running it:
| Field | What to decide | Evidence to retain |
|---|---|---|
| Normal surface | The document, message, retrieval result, ticket, tool output, or peer handoff where the event appears | Fixture version and exact injection point |
| Representative accumulated state | The memories, artifacts, permissions, work queue, and shared context that make propagation plausible | Versioned starting-state snapshot and reset procedure |
| Protected constraint | The action, data, boundary, or decision that must not be altered | Expected allowed action, refusal, or escalation |
| Consequential paths | Where the event could travel: memory, tools, shared records, agent-to-agent messages, or queued work | Trace identifiers and the records to inspect |
| Recovery condition | What “back under control” means after detection or escape | Required postcondition, cleanup evidence, and operator handoff rule |
This is Bonfire AgentOps Hardening guidance. The exact surfaces and constraints must come from your system's threat model; do not copy the preprint's stimuli as though they cover every workflow.
Run a stateful event, then use four independent checks
The paper's event rubrics distinguish recognition, restraint, containment, coordination, and durable response. Source: Akkil et al. A practical release check can simplify those into four independently recorded outcomes:
- Detection: Did the relevant control or operator receive a usable signal? Record the signal, timestamp, and evidence it relied on.
- Containment: Did the system prevent the event from reaching a consequential tool, memory store, shared artifact, or peer workflow? Inspect the paths you listed in the test card.
- Recovery: If anything crossed the boundary, was the required safe postcondition restored without introducing a second harmful change?
- Cleanup: Were contaminated memories, queued jobs, cached artifacts, or access grants removed, quarantined, or marked so that ordinary work will not reuse them?
Keep these columns separate. A warning is not containment. A blocked tool call does not prove that an earlier retrieval was not stored. A restored record does not prove that a queued follow-up will not replay the event tomorrow. That separation is the value of the test.
For durable-state inspection, use the method in evaluating an AI agent that changes persistent system state: define the required postcondition and the changes that must remain absent, then preserve evidence that shows both.
Use a warm-up that is representative, not theatrical
The preprint injects events after state accumulates; it does not supply a universal amount of history that every agent needs. Source: Akkil et al. Choose the warm-up from the dependencies that make your system different from a fresh session:
- create ordinary task artifacts the agent would later read or modify;
- populate only the memory and retrieval records that the intended workflow can actually access;
- exercise the normal tool and handoff paths that might carry an event forward; and
- use identities and permissions that match the release scope, including the boundaries that should deny the action.
Then reset the fixture to the captured starting state for each repeat. If an event cannot be replayed from a known state, its result is harder to interpret and harder to compare after a control changes.
Decide promotion from the escape path, not a single score
Before promotion, require the test record to answer four questions:
- Which state was present before the event?
- What did the system detect, block, change, and preserve afterward?
- Did the event reach any consequential path that the test card declared protected?
- If it did, was the repair and cleanup verified before normal work resumed?
There is no universal pass count or safety threshold in the sources. A defensible decision instead names the release scope, the events that matter for it, the observed failure modes, and the control or operating boundary that addresses each one. If containment or cleanup is unproven for a consequential path, narrow the release scope or keep a human approval boundary while the evidence is incomplete.
When a case fails, do not jump straight to another run and call the newest outcome progress. Preserve the starting snapshot, injection, trace, post-state, and cleanup result; then use an evidence-backed root-cause analysis to find the earliest failure that materially changed the outcome.
Caveats
- Emergence World is an arXiv v1 preprint, not peer-reviewed production evidence. Its findings are limited to eight simulated worlds and three controlled event types.
- The study motivates a stateful test pattern; it does not establish that every long-running system will exhibit the same failures, or that its test setup represents your environment.
- OWASP's threat-model reference supports making the event surface and consequences explicit. It does not prescribe this scorecard or certify a system as secure.
- A successful stress test complements access control, monitoring, rollback, incident response, and human review; it does not replace them.
Sources
FAQ
Why isn't a fresh-session prompt test enough for a long-running agent system?
A blank session lacks the memory, artifacts, permissions, and shared state through which an event could persist or propagate. A fresh-session test can show how an agent responds to a prompt, but it cannot by itself show whether an event will persist or spread through an already-running system.
What should the four checks be?
Detection, containment, recovery, and cleanup, recorded separately. A warning is not containment, a blocked tool call does not prove nothing was stored, and a restored record does not prove a queued follow-up will not replay the event.
How much warm-up history does the test need?
The sources give no universal amount. Choose warm-up from the dependencies that make your system differ from a fresh session: the artifacts, memory, tool paths, and permissions the release scope actually uses.
Is there a pass count or safety threshold for this kind of test?
No source supplies one. Name the release scope, the events that matter, the observed failure modes, and the control or operating boundary addressing each. If containment or cleanup is unproven for a consequential path, narrow the release scope or keep a human approval boundary.
Does the Emergence World preprint show my system will fail this way?
No. It is a non-peer-reviewed arXiv v1 preprint covering eight simulated worlds and three controlled event types. It motivates a stateful test pattern; it does not establish production resilience or that your system will behave the same way.
Building something that has to hold up?
We do this work for teams — agent reliability hardening, custom MCP servers, and full-stack AI systems built to survive production.