Skip to main content
Training Studio is where you train your own enforcement model on ZeroDrift’s base. Anchor handles regulations. Your adapter handles your policies. Training Studio turns an imported custom policy into a policy-specific adapter. After the adapter is ready, enforcement scoped to that import uses the trained adapter instead of the base Anchor path. By default, activated custom rules run automatically during enforcement for your account; supplying validation_scope narrows evaluation to the selected active rules, rule packs, and imports. Training is the extra adapter step: it teaches the engine from the original policy document, not only from the extracted rule definitions.

Terms

What you need

  • A full-access API key (x-api-key). Training returns 403 for a read-only key.
  • An import whose extracted rules are activated. Training returns 409 while the import is still pending review, or if another training run is already in progress.
  • The original imported document still retained. Default content retention is 7 days (Data Retention). If the document is gone, training returns 410 — re-import the policy, activate the rules, then train again.
  • Training enabled for your environment. If it is not configured, training returns 503.

Flow

Do not enforce against a still-training run. ZeroDrift promotes training_run_id only after a successful status poll. Until then, scoped enforcement follows its configured fallback path.

Intake

You need an import_id before you can train. Three ways to get one:
  1. Inline uploadImport Policy with source: "file" (base64) or source: "text". Payload size is limited; use the presigned flow for large files.
  2. Presigned uploadGet Import Presigned URL, put the file on S3, then Start Import.
  3. Connected source — In Command, connect Notion, Linear, Confluence, or Google Drive and sync a document. That produces the same import pipeline. See Connecting the MCP server.
Extraction runs in the background. Poll Get Import Details until status is pending_review. no_rules_found and failed are not trainable — fix the document and import again. While the import is pending review, you can edit a rule’s prompt, fix note, or extraction confidence with Edit Imported Rule. Then Activate Rules. Training returns 409 until activation succeeds. Activated rules run on every enforcement request for your API key. Training does not replace that step.

What training does

Train Policy Adapter starts an asynchronous run. Training Studio:
  1. Re-reads the original imported document (not only the extracted rule list).
  2. Generates and judges training examples from that document.
  3. Trains a policy-specific adapter for that import.
POST returns 202 with training_run_id and a poll object pointing at GET on the same path. Omit the body to use Training Studio defaults, or set: Only one training run can be in progress for an import. A second POST while a run is active returns 409.

Training status

Poll Get Training Status after you start a run. GET returns 404 if no run has been started. stage and progress (completed / total) appear when Training Studio reports them. Treat succeeded and failed as the only stop conditions. A successful poll is what promotes the adapter. Until that poll reports succeeded, enforcement scoped to the import uses the configured fallback path — not a half-trained run. A failed retraining attempt does not replace an earlier working adapter.

Train then poll

Reuse the same import_id for POST and GET on /api/policies/import/{import_id}/train.
A successful start looks like:
A successful poll looks like:
Optional training options (omit the body to use defaults):

Enforce against the trained import

After status is succeeded, submit content with validation_scope.imports set to that import_id. Use model_engine: "anchor_3_0".
Async submissions return a job_id. Poll Get Results until the job is done or failed.

Errors

Field-level detail lives on the endpoint pages. Typical training responses:

FAQ

No. Activate Rules puts extracted rules into enforcement immediately. Training Studio adds a policy-specific adapter on top of that.
Yes. A connected-source import is the same import_id as a file upload. Activate it, then call the train endpoints. See Connecting the MCP server.
Stop polling when status is failed. A failed run does not replace an earlier working adapter. Fix the cause (document, options, or environment) and start a new training run.
Training needs the original imported file or text. After default content retention (7 days unless your contract says otherwise), that document is deleted. Import again, activate the new rules, then train.
No training run has been started for that import. POST first, then poll.

API reference

Train Policy Adapter

POST /api/policies/import/{import_id}/train

Get Training Status

GET /api/policies/import/{import_id}/train

Import Policy

Upload a policy and extract rules.

Activate Rules

Activate extracted rules so they run during enforcement.

Enforce Content

Scope enforcement with validation_scope.imports.

Connecting the MCP server

Import a policy from a connected source instead of uploading a file.