> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zespan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How a prevention draft gets proven

> What Zespan needs to see before it calls a prevention draft proven: clean traces over several days, how many normal traces it may also have stopped, back-dated traffic, and multi-agent pipelines.

When Zespan drafts a policy to prevent a failure, it tests the draft on your own recorded traffic before anyone applies it. A draft that passes is **proven**. A draft that does not is **not proven**, and the Prevent section says why, with the counts and the next step. This page explains the tests.

Prevention drafts are on by default and need the Pro plan; see [Issues → Prevent](https://docs.zespan.com/dashboard/issues.md#prevent).

## What a draft has to show

A draft is proven when all of these hold:

| Test | Needs |
| - | - |
| **It stops the original problem** | The draft would have stopped the trace the finding came from. |
| **Enough clean traces** | At least **100** normal traces of the same agent and environment to test it on. |
| **Enough days** | Those clean traces cover at least **3** days. |
| **It leaves normal traffic alone** | The draft would also have stopped at most **5** of them, and no more than **0.5%** of them. |

A "clean" trace is a normal trace the draft is tested against. Hitting one of them is an "other hit": a normal trace the draft would also have stopped.

## When a draft is not proven

The Prevent section shows the real counts and what to do next:

| Reason | What it says |
| - | - |
| Too few clean traces | "{n} of 100 clean traces so far. Wait for more traffic, or send past traffic with back-dated timestamps." |
| Too few days | "Clean traces cover {n} of 3 days. Check again after more days of traffic." |
| Too many other hits | "It would also have stopped {n} normal traces (at most {m} allowed with {k} clean traces)." |

The "at most {m} allowed" number depends on how many clean traces the proof had. A draft may also stop only a small share of normal traces: fewer than **0.5%** of the clean traces, and never more than 5. With 100 to 200 clean traces that allows none and with 201 it allows 1. Because a proof reads at most 1,000 traces, the most it can allow is 4. Drafts that must never touch normal traffic, such as a tool allow-list or confirm-first, allow 0.

**Recheck** runs the proof again on current traffic. See [Policies → Policies Zespan drafted](https://docs.zespan.com/dashboard/policies.md#policies-zespan-drafted).

## Sending past traffic

If you are short of clean traces, send past traffic to `POST /v1/ingest` with its original, past timestamps. A trace counts when its spans fall within the test window: the **last 14 days**, or the **last 30 days** for a confirm-first draft (see [Policies → Confirm before destructive calls](https://docs.zespan.com/dashboard/policies.md#confirm-before-destructive-calls)). Older traces do not count. A trace that was still being written in the last 5 minutes is left out until it is complete, and each proof reads at most 1,000 traces.

> [!NOTE]
>
> Back-dated traces help a draft reach its proof, but **detection itself still checks only recent traces**. A problem that sits only in old, back-dated traffic is not found as a finding. Re-scanning past traffic for findings is not available yet.

## Multi-agent pipelines

Many apps run several agents in one trace: a coordinator hands off to intake, policy and payout agents. Prevention handles this the way you would expect:

* **Clean traces are counted across the whole pipeline.** A trace counts for a draft when the draft's agent appears **anywhere** in it, not only on its last step. A pipeline that ends on a different agent than the one that made the offending call is no longer left out of the count.
* **The draft is scoped to the agent that made the offending tool call.** Not the agent that ended the trace, and not the agent that started it. For a loop finding (repeated calls, no progress, retry after an error) the agent is the one that made the repeated calls. If several agents made them, Zespan uses the one with most of them, and the latest one when they are level.
* **Replay judges each call by its own agent**, with the whole trace as history, the same way the live check sees it.

> [!WARNING]
>
> Drafts created before this change stay scoped to the agent they were first drafted for, including loop drafts scoped to the first agent of the pipeline. Zespan does not change or move them. Dismiss the old draft, then draft again from the finding to get one scoped to the agent that made the call.

## Conditions and once-per-key drafts

Two kinds of draft use more of your own data to stay narrow:

* A **confirm-first** draft for a destructive tool applies only to the calls that meet the tool's **Only when** condition, if you set one in [Settings → Detectors](https://docs.zespan.com/dashboard/detectors.md#only-when-limit-a-destructive-tool-to-some-calls). Proof replays only those calls.
* A **once per key** draft limits a money-moving, deleting or destructive tool to one call per key, such as one payment per claim id. The key is up to 3 argument fields that stayed the same across the repeated calls, for example `amount_inr` and `claim_id`, so a retry that changes one of them is a different call and is not blocked. A field that is different on every normal call (a claim number without "id" in its name) is kept in the key first, never dropped. Fields such as request ids, idempotency keys, timestamps and trace or span ids are never part of the key. Arguments longer than 2,000 characters are cut when recorded, so a call with such arguments falls back to the full-argument key. See [Policy file reference → loop\_detection](https://docs.zespan.com/policies/file-reference.md#loop_detection).

## Next steps

* [Issues → Prevent](https://docs.zespan.com/dashboard/issues.md#prevent) — where a draft's proof shows
* [Policies](https://docs.zespan.com/dashboard/policies.md#policies-zespan-drafted) — review and apply a drafted policy
* [Detectors](https://docs.zespan.com/dashboard/detectors.md) — confirm your tools and set an Only when condition
* [Policy file reference](https://docs.zespan.com/policies/file-reference.md) — the rules a draft is built from


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.