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

# Validate at Scale with AI

> Hand a file of content to your coding agent and get back a verdict for every item.

You have a pile of content: a backlog of support replies, a batch of AI-generated copy, a month of chatbot transcripts. Give it to a coding agent with the prompts below. The agent checks every item against your active rulepacks and writes the results to a file.

You do the one-time setup. The agent does the repetitive part.

> [!NOTE]
>
> **Account setup is still manual.** You enable rulepacks and create the API key in Command. The agent cannot do either. A fully agent-driven setup is planned and will replace this prerequisite.

## Before you start

You need four things:

1. **A workspace with the rulepacks for your content active.** The agent validates against whatever is active. In ZeroDrift Command, confirm the regulation rulepacks your content falls under are on. The agent also checks this itself and tells you if none are active. See [Rule Packs](https://docs.zerodrift.com/api-reference/rulepacks.md).
2. **An API key.** Create one in Command under **Settings → API → Keys**. See [Quickstart](https://docs.zerodrift.com/quickstart.md#step-1-get-your-api-key).
3. **The key in your environment.** Export it before you start the agent:

   ```bash theme={null}
   export ZERODRIFT_API_KEY="zd_..."
   ```

   Never paste the key into a prompt or a file. The agent reads it from the environment.
4. **A content file.** CSV or JSONL, one item per row, with a unique ID per item. For example:

   ```jsonl theme={null}
   {"id": "reply-0001", "text": "We guarantee your refund within 24 hours."}
   {"id": "reply-0002", "text": "Your account balance is $4,210.55."}
   ```

## What the agent will typically handle

Agents vary, so treat this as what to expect, not a guarantee. Given one of the prompts below, the agent will typically:

* Read the docs index at `https://docs.zerodrift.com/llms.txt`, and the pages it needs, to learn the API.
* Check which rulepacks are active with `GET /api/rulepacks/?active=true`, and tell you if none are.
* Run a small trial batch first and report how long the full run will take.
* Validate every item with `POST /api/v3/content/validate`, staying under the documented [rate limit](https://docs.zerodrift.com/api-reference/introduction.md#rate-limits) and retrying `429` and `5xx` responses.
* Write one result row per item as it goes, so an interrupted run can resume without repeating work.
* Summarize the run: counts by verdict, the most frequently triggered rules, and the items that need a human.

## What the agent will not do

* **Create your account, workspace, or API key.** You do this in Command.
* **Change your rules.** The agent reads and reports. It does not enable or disable rulepacks or rules.
* **Handle billing.** Usage is billed to your plan. Check [Pricing](https://docs.zerodrift.com/pricing.md) before you run a large file.

ZeroDrift checks content against regulation and policy rules. It does not currently detect PII or PHI, so a `pass` does not mean an item is free of personal or health information.

Content you validate is sent to ZeroDrift for enforcement. Check [Data retention](https://docs.zerodrift.com/data-retention.md) and [Security](https://docs.zerodrift.com/security.md) against your own data policy before you point an agent at sensitive content.

## Results file

Ask the agent to write one row per item, with these fields, so results are easy to join back to your source file:

| Field | Meaning |
| - | - |
| `id` | The item ID from your input file. |
| `verdict` | `pass`, `fix`, `block`, or `escalate`. See [Act on Each Verdict](https://docs.zerodrift.com/guides/act-on-verdicts.md). |
| `overall_status` | The raw `result.overall_status` from the response (`approved`, `needs_changes`, `do not send`). Empty on error. |
| `rules` | The rule IDs that triggered, from `result.violations[].rule_id`. On Mini, they come from `result.flagged_rules[].rule_id`. |
| `job_id` | The job ID, so you can look the item up again. |
| `error` | The error, if the item failed. Empty otherwise. |

Map `overall_status` to `verdict` like this:

| `overall_status` | `verdict` |
| - | - |
| `approved` | `pass` |
| `do not send` | `block` |
| `needs_changes`, with a usable `replace` fix | `fix` |
| `needs_changes`, with no suggested text or no `replace` action | `escalate` |

Mini can return `needs_changes` with no rule IDs and no fix text. Treat that as `escalate`.

An item the agent could not check gets `verdict: escalate` and an `error`. It never gets `pass`.

## Example prompts

Copy a prompt, change the file name, and paste it into your coding agent.

> [accordion] Audit a backlog of support replies
>
> ```text theme={null}
> I have a ZeroDrift API key in the ZERODRIFT_API_KEY environment variable. Do not print it or write it to any file.
>
> Read https://docs.zerodrift.com/llms.txt and the pages you need to learn the ZeroDrift Enforcement API.
>
> My file support-replies.jsonl has one support reply per line, with fields "id" and "text". Check each reply with POST /api/v3/content/validate in sync mode.
>
> 1. First confirm which rulepacks are active with GET /api/rulepacks/?active=true. If none are active, stop and tell me.
> 2. Run the first 20 replies as a trial. Tell me how long the full file will take at the documented rate limit, then continue.
> 3. Stay under the documented rate limit. Retry 429 and 5xx responses with backoff, and honor Retry-After. If you hit a daily quota 429, stop and report instead of waiting.
> 4. Append one row per reply to results.jsonl as you go, with: id, verdict (pass, fix, block, or escalate), overall_status, rules, job_id, error. Skip ids already in results.jsonl so I can resume. Mark any reply you could not check as escalate.
> 5. When done, summarize: counts per verdict, the 10 most triggered rules, and the ids that need a human.
>
> Do not change any rules or rulepacks. Only read and report.
> ```

> [accordion] Screen a batch of AI-generated marketing copy
>
> ```text theme={null}
> I have a ZeroDrift API key in the ZERODRIFT_API_KEY environment variable. Do not print it or write it to any file.
>
> Read https://docs.zerodrift.com/llms.txt and the pages you need to learn the ZeroDrift Enforcement API.
>
> My file campaign-copy.csv has columns "id" and "copy". Each piece can run several hundred words, so use async mode: submit with POST /api/v3/content/validate, then poll GET /api/v3/jobs/{job_id} until status is completed or failed. Stop polling on failed and record the error.
>
> 1. Confirm the active rulepacks with GET /api/rulepacks/?active=true. If none are active, stop and tell me.
> 2. Trial the first 10 pieces, report the time estimate for the full file, then continue.
> 3. Stay under the documented rate limit and cap in-flight jobs at 10. Retry 429 and 5xx with backoff.
> 4. Append one row per piece to results.jsonl as you go: id, verdict, overall_status, rules, job_id, error. Skip ids already present so I can resume.
> 5. When done, list every piece that is not a pass, with the rules triggered and the quoted text from each violation. Do not rewrite any copy.
>
> Do not change any rules or rulepacks. Only read and report.
> ```

> [accordion] Replay chatbot transcripts, grouped by tenant
>
> ```text theme={null}
> I have a ZeroDrift API key in the ZERODRIFT_API_KEY environment variable. Do not print it or write it to any file.
>
> Read https://docs.zerodrift.com/llms.txt and the pages you need to learn the ZeroDrift Enforcement API.
>
> My file transcripts.jsonl has one chatbot reply per line, with fields "id", "tenant", and "text". Validate each reply with POST /api/v3/content/validate in sync mode, falling back to async when a response says so.
>
> 1. Confirm the active rulepacks with GET /api/rulepacks/?active=true and tell me which are active. If none are, stop.
> 2. Run 20 replies as a trial and report the time estimate for the full file, then continue.
> 3. Stay under the documented rate limit. Retry 429 and 5xx with backoff, and stop and report on a daily quota 429.
> 4. Append one row per reply to results.jsonl as you go: id, tenant, verdict, overall_status, rules, job_id, error. Skip ids already present so I can resume.
> 5. When done, report per tenant: reply count, counts per verdict, and the most triggered rules. Call out any tenant whose block rate is more than double the overall block rate.
>
> Do not change any rules or rulepacks. Only read and report.
> ```

## Tips for better results

* **Start with a trial run.** The first 10 to 20 items tell the agent the real throughput and surface problems with your file before the full run.
* **Ask for a results file, not a chat summary.** A file is reproducible, resumable, and joins back to your source data.
* **Give a stop condition.** Set an error budget, such as "stop if more than 5% of items fail", so a bad key or a bad file does not burn a full run.
* **Put a unique ID on every item.** Resume and joins depend on it.
* **Say which rulepacks you expect to be active.** The agent compares that to what the API reports and flags the gap.
* **Use async for long items.** Short replies work in sync mode. Long documents belong in async mode. See [Long-Form Content](https://docs.zerodrift.com/guides/long-form-content.md).
* **Tell the agent to read the rate limit from the docs.** Limits depend on your plan and can change. See [Handle Errors](https://docs.zerodrift.com/guides/handle-errors.md).
* **Keep one `model_engine` for the whole run, and record it.** Results from different models are not directly comparable. See [Choose a model](https://docs.zerodrift.com/models.md).
* **Ask for a spend total.** Each response includes `result.cost`. Have the agent add them up and report the total with the summary.

> [!NOTE]
>
> A batch validation endpoint is coming. When it ships, this page will point your agent at it for large files. The results file format will not change.

## Keep building

> [card] [Act on Each Verdict](https://docs.zerodrift.com/guides/act-on-verdicts.md)
>
> Decide what happens to each result: deliver, fix, block, or escalate.

> [card] [Enforce a Chatbot](https://docs.zerodrift.com/guides/enforce-a-chatbot.md)
>
> Move from auditing after the fact to checking every reply before it is sent.

> [card] [Import a Policy](https://docs.zerodrift.com/guides/import-a-policy.md)
>
> Turn your own policy document into enforceable rules before you audit.

> [card] [Handle Errors](https://docs.zerodrift.com/guides/handle-errors.md)
>
> Retries, rate limits, and what to do when a check cannot run.

> [card] [For AI Agents](https://docs.zerodrift.com/for-agents.md)
>
> Give your coding agent the machine-readable docs and the API cheat sheet.


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