Prerequisites
- A full-access API key (Quickstart).
- The policy as PDF, DOCX, or plain text, or in Notion, Linear, Confluence, or Google Drive.
The flow
Step 1: Import
Three intake paths. Pick one. Every path yields animport_id.
Inline text or small file
POST /api/policies/import sends the document in the body (source: "text" or base64 source: "file"). Payload size is capped; use the presigned flow for large files.
Set POLICY_TEXT or encode a small file; use the returned import_id for later steps.
Large file (presigned upload)
POST /api/policies/import/presigned_url→import_id,upload_url,required_headersPUTthe raw bytes toupload_urlwith every header inrequired_headers(omitting them causesSignatureDoesNotMatch)POST /api/policies/import/startwith thatimport_id. If status isscan_pending, retry until extraction starts (processing)
POLICY_FILE to the path on disk.
Connected source
In Command, open Settings → Sources, connect Notion, Linear, Confluence, or Google Drive, select a document, and sync. The sync creates the sameimport_id as an upload. Details: MCP Connectors.
Step 2: Poll extraction
PollGET /api/policies/import/{import_id} until status is no longer processing. Continue when it is pending_review. no_rules_found and failed are not activatable — fix the document and import again.
Use IMPORT_ID from the previous step (or your environment).
Step 3: Review
Inspect extracted rules in the poll response or in Command. Before activation you can PATCH a pending rule’sprompt, fix_note, or confidence (Edit Imported Rule). Pass null to clear prompt or fix_note.
Step 4: Activate
POST /api/policies/import/{import_id}/activate activates every extracted rule (or a rule_ids subset). Set overwrite: true to replace rules from an earlier import when ids collide.
Activated rules run on enforcement for your API key. Use validation_scope.imports when you need to narrow to this import (see Per-Tenant Rulepacks).
Step 5: Enforce against it
After activation, scope enforcement withvalidation_scope.imports when you want this import (alone or with managed packs):
Gotchas
- Retention. The original document is kept 7 days by default (Data Retention). Training after that returns
410; re-import. - Re-sync replaces. Syncing a connected document again updates the import; it does not create a duplicate.
- Read-only connections. ZeroDrift does not write back to Notion, Linear, Confluence, or Google Drive.
- Presigned headers. Always send
required_headerson the S3PUT. Retryscan_pendingon start.
Next
Train an Adapter
Teach Anchor your policy’s judgment, not just its extracted rules.
Per-Tenant Rulepacks
Give each customer their own packs and imports.

