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 returns403for a read-only key. - An import whose extracted rules are activated. Training returns
409while 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
Intake
You need animport_id before you can train. Three ways to get one:
- Inline upload — Import Policy with
source: "file"(base64) orsource: "text". Payload size is limited; use the presigned flow for large files. - Presigned upload — Get Import Presigned URL, put the file on S3, then Start Import.
- 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.
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:- Re-reads the original imported document (not only the extracted rule list).
- Generates and judges training examples from that document.
- Trains a policy-specific adapter for that import.
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 returns404 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 sameimport_id for POST and GET on /api/policies/import/{import_id}/train.
Enforce against the trained import
After status issucceeded, submit content with validation_scope.imports set to that import_id. Use model_engine: "anchor_3_0".
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
Do I have to train before custom rules run?
Do I have to train before custom rules run?
No. Activate Rules puts extracted rules into enforcement immediately. Training Studio adds a policy-specific adapter on top of that.
Can I train a document I synced from Notion or Drive?
Can I train a document I synced from Notion or Drive?
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.What if retraining fails?
What if retraining fails?
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.Why did training return 410?
Why did training return 410?
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.
Why did GET training return 404?
Why did GET training return 404?
No training run has been started for that import. POST first, then poll.
API reference
Train Policy Adapter
POST
/api/policies/import/{import_id}/trainGet Training Status
GET
/api/policies/import/{import_id}/trainImport 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.

