Skip to main content
You have a rulebook that is not a regulation: a communications policy, a claims manual, a brand guide, an underwriting policy. You want Anchor to enforce it alongside managed rule packs.

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

Training an adapter is optional and comes after activation. See Train an Adapter.

Step 1: Import

Three intake paths. Pick one. Every path yields an import_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)

  1. POST /api/policies/import/presigned_urlimport_id, upload_url, required_headers
  2. PUT the raw bytes to upload_url with every header in required_headers (omitting them causes SignatureDoesNotMatch)
  3. POST /api/policies/import/start with that import_id. If status is scan_pending, retry until extraction starts (processing)
Max upload size is 1 GB. Set 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 same import_id as an upload. Details: MCP Connectors.

Step 2: Poll extraction

Poll GET /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’s prompt, 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 with validation_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_headers on the S3 PUT. Retry scan_pending on 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.