## ZeroDrift integration
ZeroDrift Enforcement API. Base URL: https://api.zerodrift.ai. Authenticate with the `x-api-key` header using the `ZERODRIFT_API_KEY` environment variable. Never expose the key in source control, logs, client-side code, or prompts.
Enforce text: `POST /api/v3/content/validate` with `{content, model_engine: "anchor_3_0", mode: "sync"|"async", document_category?, validation_scope?: {rulepacks?, imports?, rules?}, metadata?}`.
Sync mode returns the result inline when processing completes within the inline budget; otherwise it falls back to async mode. Async mode returns `202` with `{job_id, poll.url}`; poll `GET /api/v3/jobs/{job_id}` until `status` is `done` or `failed`.
Read the enforcement decision from `overall_status`: `approved` = Pass (deliver); `needs_changes` = Fix (replace each flagged line with `violations_by_line[i].best_fix.suggested_text`); `do not send` = Block (deliver a fallback, never the original). Treat `status` only as job lifecycle state. If any `best_fix.confidence` is below `0.85`, escalate to a human.
Rulepacks: `GET /api/rulepacks/`; use the returned `id` in `validation_scope.rulepacks`. Policies: `POST /api/policies/import`, poll the import, activate its rules, then use the import ID in `validation_scope.imports`.
Activity log (30 days): `GET /api/activities`. Rate limit: 10 requests per second with a burst of 50; back off on `429`.
Docs index: https://docs.zerodrift.com/llms.txt
Full docs: https://docs.zerodrift.com/llms-full.txt
OpenAPI spec: https://docs.zerodrift.com/openapi.json
Docs MCP: https://docs.zerodrift.com/mcp