{ "import_id": "550e8400-e29b-41d4-a716-446655440000", "training_run_id": "run-808961af", "status": "queued", "message": "Training started. Poll the training status endpoint for progress.", "poll": { "method": "GET", "url": "/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train" }}
Start asynchronous training for an activated policy import. Training Studio
re-reads the import’s original document, generates and judges examples, and
trains a policy-specific LoRA adapter.Call this after Import Policy
and Activate Rules. Import
extracts candidate rules; training is only accepted once those rules are
activated (409 if the import is still pending review). Then poll
Get Training Status
until training succeeds or fails.
Training uses the original imported document, not only the extracted rule
definitions. If that document has expired under your retention policy,
re-import and activate the policy before training.
Path Parameters
string
required
The activated policy import to train.
Request Body
The body is required. Every request must include the customer’s versioned
consent to Training Studio data use. Training sends the policy document to
Training Studio and its model providers. A request without valid consent
returns 400.
object
required
The customer’s explicit consent. ZeroDrift records it on the import for each
run, with the API key, the acting user if given, and the time.
Show consent properties
boolean
required
Must be true.
string
required
Version of the consent text the user was shown. A non-empty string of at
most 128 characters.
string
Optional ID of the user who gave consent. A non-empty string of at most
256 characters. The API key alone identifies only the workspace.
number
Optional maximum generation spend in US dollars for this run.
integer
Optional number of generated training examples per extracted rule.
Response
Returns 202 Accepted after the training run has been created.
string
Policy import being trained.
string
Training Studio run identifier.
string
Initial status reported for the training run.
string
Human-readable next step, when present.
object
Endpoint used to monitor this run.
Show poll properties
string
Always GET.
string
/api/policies/import/{import_id}/train
{ "import_id": "550e8400-e29b-41d4-a716-446655440000", "training_run_id": "run-808961af", "status": "queued", "message": "Training started. Poll the training status endpoint for progress.", "poll": { "method": "GET", "url": "/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train" }}
Error Responses
Status
Description
400
Consent missing or not accepted, invalid consent.version or consent.accepted_by_user, or invalid training options
403
A full-access API key is required, or the import belongs to another customer
404
Import not found
409
Import is not activated, or another training run is already in progress
410
Original document expired; re-import the policy
422
Document is too short to train, or Training Studio rejected it
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ZeroDrift Enforcement API","description":"ZeroDrift Enforcement API - Enforce regulations and policies on AI content and communications","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/zerodrift/EnMFM7yTopP4lGmD/logo/ZD_White_Transparent.png?fit=max\u0026auto=format\u0026n=EnMFM7yTopP4lGmD\u0026q=85\u0026s=8a3a1cfcd216c0a056b6a1cd0c50a332","dark":"https://mintcdn.com/zerodrift/EnMFM7yTopP4lGmD/logo/ZD_Black_Transparent.png?fit=max\u0026auto=format\u0026n=EnMFM7yTopP4lGmD\u0026q=85\u0026s=dd2ae5c915064ad7ebf1aa495eb2efce"},"favicon":"https://mintcdn.com/zerodrift/C1CP0SqlGtEDTLZM/favicon.svg?fit=max\u0026auto=format\u0026n=C1CP0SqlGtEDTLZM\u0026q=85\u0026s=3ffcd8394a2e8995fcc413d960e17117","api":{"examples":{"defaults":"required"},"mdx":{"auth":{"method":"key","name":"x-api-key"},"server":"https://api.zerodrift.ai"}},"navbar":{"links":[{"href":"mailto:support@zerodrift.ai","label":"Support"},{"href":"/changelog","label":"Changelog"}],"primary":{"type":"button","label":"Open Command","href":"https://app.zerodrift.ai"}},"footer":{},"seo":{"metatags":{"og:description":"ZeroDrift Enforcement API - Enforce regulations and policies on AI content and communications","slack-app-id":"A0CJQ2CUV8C"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"zerodrift","hasAudioNarration":false,"actualSubdomain":"zerodrift","customDomains":["docs.zerodrift.com"],"gitSource":{"type":"github","owner":"zerodriftai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b0f455395a7b0367e387aae","clientVersion":"0.0.4397","searchFilterCounts":[{"language":"default","tag":"API reference","count":25},{"language":"default","tag":"Guides","count":24},{"language":"default","tag":"Plugins","count":15},{"language":"default","tag":"Getting Started","count":10},{"language":"default","tag":"Import a Policy","count":7},{"language":"default","tag":"Rules","count":7},{"language":"default","tag":"Claude","count":5},{"language":"default","tag":"ChatGPT and Codex","count":5},{"language":"default","tag":"Enforce and Audit Content","count":5},{"language":"default","tag":"Slack","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/training-studio/train-policy","slug":"/api-reference/training-studio/train-policy","pageMetadata":{"title":"Train Policy Adapter","description":"Start a Training Studio adapter run from an activated policy import","api":"POST /api/policies/import/{import_id}/train","href":"/api-reference/training-studio/train-policy"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Start a Training Studio adapter run from an activated policy import\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,ResponseField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Start asynchronous training for an activated policy import. Training Studio\nre-reads the import’s original document, generates and judges examples, and\ntrains a policy-specific LoRA adapter.`}),`\n`,_jsxs(_components.p,{children:[`Call this after `,_jsx(_components.a,{href:`/api-reference/custom-policies/import-policy`,children:`Import Policy`}),`\nand `,_jsx(_components.a,{href:`/api-reference/custom-policies/activate-rules`,children:`Activate Rules`}),`. Import\nextracts candidate rules; training is only accepted once those rules are\nactivated (`,_jsx(_components.code,{children:`409`}),` if the import is still pending review). Then poll\n`,_jsx(_components.a,{href:`/api-reference/training-studio/get-training-status`,children:`Get Training Status`}),`\nuntil training succeeds or fails.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Training uses the original imported document, not only the extracted rule\ndefinitions. If that document has expired under your retention policy,\nre-import and activate the policy before training.`})}),`\n`,_jsx(Heading,{level:`2`,id:`path-parameters`,children:`Path Parameters`}),`\n`,_jsx(ParamField,{path:`import_id`,type:`string`,required:true,id:`param-import-id`,children:_jsx(_components.p,{children:`The activated policy import to train.`})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(_components.p,{children:[`The body is required. Every request must include the customer’s versioned\nconsent to Training Studio data use. Training sends the policy document to\nTraining Studio and its model providers. A request without valid consent\nreturns `,_jsx(_components.code,{children:`400`}),`.`]}),`\n`,_jsxs(ParamField,{body:`consent`,type:`object`,required:true,id:`param-consent`,children:[_jsx(_components.p,{children:`The customer’s explicit consent. ZeroDrift records it on the import for each\nrun, with the API key, the acting user if given, and the time.`}),_jsxs(Expandable,{title:`consent properties`,children:[_jsx(ParamField,{body:`accepted`,type:`boolean`,required:true,id:`param-accepted`,children:_jsxs(_components.p,{children:[`Must be `,_jsx(_components.code,{children:`true`}),`.`]})}),_jsx(ParamField,{body:`version`,type:`string`,required:true,id:`param-version`,children:_jsx(_components.p,{children:`Version of the consent text the user was shown. A non-empty string of at\nmost 128 characters.`})}),_jsx(ParamField,{body:`accepted_by_user`,type:`string`,id:`param-accepted-by-user`,children:_jsx(_components.p,{children:`Optional ID of the user who gave consent. A non-empty string of at most\n256 characters. The API key alone identifies only the workspace.`})})]})]}),`\n`,_jsx(ParamField,{body:`cost_cap_usd`,type:`number`,id:`param-cost-cap-usd`,children:_jsx(_components.p,{children:`Optional maximum generation spend in US dollars for this run.`})}),`\n`,_jsx(ParamField,{body:`examples_per_rule`,type:`integer`,id:`param-examples-per-rule`,children:_jsx(_components.p,{children:`Optional number of generated training examples per extracted rule.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`202 Accepted`}),` after the training run has been created.`]}),`\n`,_jsx(ResponseField,{name:`import_id`,type:`string`,id:`param-import-id-1`,children:_jsx(_components.p,{children:`Policy import being trained.`})}),`\n`,_jsx(ResponseField,{name:`training_run_id`,type:`string`,id:`param-training-run-id`,children:_jsx(_components.p,{children:`Training Studio run identifier.`})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsx(_components.p,{children:`Initial status reported for the training run.`})}),`\n`,_jsx(ResponseField,{name:`message`,type:`string`,id:`param-message`,children:_jsx(_components.p,{children:`Human-readable next step, when present.`})}),`\n`,_jsxs(ResponseField,{name:`poll`,type:`object`,id:`param-poll`,children:[_jsx(_components.p,{children:`Endpoint used to monitor this run.`}),_jsxs(Expandable,{title:`poll properties`,children:[_jsx(ResponseField,{name:`method`,type:`string`,id:`param-method`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`GET`}),`.`]})}),_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url`,children:_jsx(_components.p,{children:_jsx(_components.code,{children:`/api/policies/import/{import_id}/train`})})})]})]}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[`Consent missing or not accepted, invalid `,_jsx(_components.code,{children:`consent.version`}),` or `,_jsx(_components.code,{children:`consent.accepted_by_user`}),`, or invalid training options`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:`A full-access API key is required, or the import belongs to another customer`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:`Import not found`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`409`}),_jsx(_components.td,{children:`Import is not activated, or another training run is already in progress`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`410`}),_jsx(_components.td,{children:`Original document expired; re-import the policy`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:`Document is too short to train, or Training Studio rejected it`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Import state could not be read or updated`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`502`}),_jsx(_components.td,{children:`Training Studio request failed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:`Training is not configured in this environment`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.zerodrift.ai/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"consent\": {\"accepted\": true, \"version\": \"YOUR_CONSENT_VERSION\", \"accepted_by_user\": \"usr_42\"}}'`})]}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Train Policy Adapter","description":"Start a Training Studio adapter run from an activated policy import","api":"POST /api/policies/import/{import_id}/train","href":"/api-reference/training-studio/train-policy"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,ResponseExample,ResponseField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Start asynchronous training for an activated policy import. Training Studio\nre-reads the import’s original document, generates and judges examples, and\ntrains a policy-specific LoRA adapter.`}),`\n`,_jsxs(_components.p,{children:[`Call this after `,_jsx(_components.a,{href:`/api-reference/custom-policies/import-policy`,children:`Import Policy`}),`\nand `,_jsx(_components.a,{href:`/api-reference/custom-policies/activate-rules`,children:`Activate Rules`}),`. Import\nextracts candidate rules; training is only accepted once those rules are\nactivated (`,_jsx(_components.code,{children:`409`}),` if the import is still pending review). Then poll\n`,_jsx(_components.a,{href:`/api-reference/training-studio/get-training-status`,children:`Get Training Status`}),`\nuntil training succeeds or fails.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Training uses the original imported document, not only the extracted rule\ndefinitions. If that document has expired under your retention policy,\nre-import and activate the policy before training.`})}),`\n`,_jsx(Heading,{level:`2`,id:`path-parameters`,children:`Path Parameters`}),`\n`,_jsx(ParamField,{path:`import_id`,type:`string`,required:true,id:`param-import-id`,children:_jsx(_components.p,{children:`The activated policy import to train.`})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(_components.p,{children:[`The body is required. Every request must include the customer’s versioned\nconsent to Training Studio data use. Training sends the policy document to\nTraining Studio and its model providers. A request without valid consent\nreturns `,_jsx(_components.code,{children:`400`}),`.`]}),`\n`,_jsxs(ParamField,{body:`consent`,type:`object`,required:true,id:`param-consent`,children:[_jsx(_components.p,{children:`The customer’s explicit consent. ZeroDrift records it on the import for each\nrun, with the API key, the acting user if given, and the time.`}),_jsxs(Expandable,{title:`consent properties`,children:[_jsx(ParamField,{body:`accepted`,type:`boolean`,required:true,id:`param-accepted`,children:_jsxs(_components.p,{children:[`Must be `,_jsx(_components.code,{children:`true`}),`.`]})}),_jsx(ParamField,{body:`version`,type:`string`,required:true,id:`param-version`,children:_jsx(_components.p,{children:`Version of the consent text the user was shown. A non-empty string of at\nmost 128 characters.`})}),_jsx(ParamField,{body:`accepted_by_user`,type:`string`,id:`param-accepted-by-user`,children:_jsx(_components.p,{children:`Optional ID of the user who gave consent. A non-empty string of at most\n256 characters. The API key alone identifies only the workspace.`})})]})]}),`\n`,_jsx(ParamField,{body:`cost_cap_usd`,type:`number`,id:`param-cost-cap-usd`,children:_jsx(_components.p,{children:`Optional maximum generation spend in US dollars for this run.`})}),`\n`,_jsx(ParamField,{body:`examples_per_rule`,type:`integer`,id:`param-examples-per-rule`,children:_jsx(_components.p,{children:`Optional number of generated training examples per extracted rule.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`202 Accepted`}),` after the training run has been created.`]}),`\n`,_jsx(ResponseField,{name:`import_id`,type:`string`,id:`param-import-id-1`,children:_jsx(_components.p,{children:`Policy import being trained.`})}),`\n`,_jsx(ResponseField,{name:`training_run_id`,type:`string`,id:`param-training-run-id`,children:_jsx(_components.p,{children:`Training Studio run identifier.`})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsx(_components.p,{children:`Initial status reported for the training run.`})}),`\n`,_jsx(ResponseField,{name:`message`,type:`string`,id:`param-message`,children:_jsx(_components.p,{children:`Human-readable next step, when present.`})}),`\n`,_jsxs(ResponseField,{name:`poll`,type:`object`,id:`param-poll`,children:[_jsx(_components.p,{children:`Endpoint used to monitor this run.`}),_jsxs(Expandable,{title:`poll properties`,children:[_jsx(ResponseField,{name:`method`,type:`string`,id:`param-method`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`GET`}),`.`]})}),_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url`,children:_jsx(_components.p,{children:_jsx(_components.code,{children:`/api/policies/import/{import_id}/train`})})})]})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`202 Training Accepted`,numberOfLines:`10`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"import_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"550e8400-e29b-41d4-a716-446655440000\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"training_run_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"run-808961af\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"queued\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Training started. Poll the training status endpoint for progress.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"poll\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"method\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GET\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[`Consent missing or not accepted, invalid `,_jsx(_components.code,{children:`consent.version`}),` or `,_jsx(_components.code,{children:`consent.accepted_by_user`}),`, or invalid training options`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:`A full-access API key is required, or the import belongs to another customer`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:`Import not found`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`409`}),_jsx(_components.td,{children:`Import is not activated, or another training run is already in progress`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`410`}),_jsx(_components.td,{children:`Original document expired; re-import the policy`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:`Document is too short to train, or Training Studio rejected it`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Import state could not be read or updated`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`502`}),_jsx(_components.td,{children:`Training Studio request failed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:`Training is not configured in this environment`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.zerodrift.ai/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"consent\": {\"accepted\": true, \"version\": \"YOUR_CONSENT_VERSION\", \"accepted_by_user\": \"usr_42\"}}'`})]}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Train Policy Adapter","description":"Start a Training Studio adapter run from an activated policy import","api":"POST /api/policies/import/{import_id}/train","href":"/api-reference/training-studio/train-policy"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Path Parameters","slug":"path-parameters","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Error Responses","slug":"error-responses","depth":2,"children":[]},{"title":"Example","slug":"example","depth":2,"children":[]}],"codeExamples":{"response":{"type":"ResponseExample","children":[{"filename":"202 Training Accepted","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"10\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"import_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"550e8400-e29b-41d4-a716-446655440000\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"training_run_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"run-808961af\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"queued\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Training started. Poll the training status endpoint for progress.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"poll\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"method\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"GET\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"url\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Train Policy Adapter","path":"/api/policies/import/{import_id}/train","servers":[{"url":"https://api.zerodrift.ai"}],"method":"post","request":{"security":[{"title":"API Key Auth","parameters":{"header":{"x-api-key":{"type":"apiKey"}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{"import_id":{"schema":[{"type":"string","description":"The activated policy import to train.","required":true}]}}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"consent":[{"type":"object","properties":{"accepted":[{"type":"boolean","description":"Must be `true` .","required":true}],"version":[{"type":"string","description":"Version of the consent text the user was shown. A non-empty string of at most 128 characters.","required":true}],"accepted_by_user":[{"type":"string","description":"Optional ID of the user who gave consent. A non-empty string of at most 256 characters. The API key alone identifies only the workspace."}]},"description":"The customer’s explicit consent. ZeroDrift records it on the import for each run, with the API key, the acting user if given, and the time.","required":true}],"cost_cap_usd":[{"type":"number","description":"Optional maximum generation spend in US dollars for this run."}],"examples_per_rule":[{"type":"integer","description":"Optional number of generated training examples per extracted rule."}]}}],"examples":{"example":{"value":{"consent":{"accepted":true,"version":"\u003cstring>","accepted_by_user":"\u003cstring>"},"cost_cap_usd":123,"examples_per_rule":123}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"import_id":[{"type":"string","description":"Policy import being trained."}],"training_run_id":[{"type":"string","description":"Training Studio run identifier."}],"status":[{"type":"string","description":"Initial status reported for the training run."}],"message":[{"type":"string","description":"Human-readable next step, when present."}],"poll":[{"type":"object","properties":{"method":[{"type":"string","description":"Always `GET` ."}],"url":[{"type":"string","description":"`/api/policies/import/{import_id}/train`"}]},"description":"Endpoint used to monitor this run."}]}}],"examples":{"example":{"value":{"import_id":"\u003cstring>","training_run_id":"\u003cstring>","status":"\u003cstring>","message":"\u003cstring>","poll":{"method":"\u003cstring>","url":"\u003cstring>"}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"zerodrift","siteName":"ZeroDrift Enforcement API","title":"Train Policy Adapter - ZeroDrift Enforcement API","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-12-01T21:57:02.430Z","originalFileLocation":"api-reference/training-studio/train-policy.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Start a Training Studio adapter run from an activated policy import\">\u003cmeta data-mint-head name=\"application-name\" content=\"ZeroDrift Enforcement API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Train Policy Adapter - ZeroDrift Enforcement API\">\u003cmeta data-mint-head property=\"og:description\" content=\"ZeroDrift Enforcement API - Enforce regulations and policies on AI content and communications\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ZeroDrift Enforcement API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.zerodrift.com/api-reference/training-studio/train-policy\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://zerodrift.mintlify.site/_mintlify/api/og/v2?division=Training+Studio\u0026amp;title=Train+Policy+Adapter\u0026amp;description=Start+a+Training+Studio+adapter+run+from+an+activated+policy+import\u0026amp;theme=4a77b3342bf61dc8ad6b1fee\u0026amp;signature=359e9920d9ed5c2a1ecba8d9c594c31e60b4df323572cbf124f5958f0b2f15c5\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Train Policy Adapter - ZeroDrift Enforcement API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"ZeroDrift Enforcement API - Enforce regulations and policies on AI content and communications\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zerodrift.mintlify.site/_mintlify/api/og/v2?division=Training+Studio\u0026amp;title=Train+Policy+Adapter\u0026amp;description=Start+a+Training+Studio+adapter+run+from+an+activated+policy+import\u0026amp;theme=4a77b3342bf61dc8ad6b1fee\u0026amp;signature=359e9920d9ed5c2a1ecba8d9c594c31e60b4df323572cbf124f5958f0b2f15c5\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/zerodrift/kLkBuz49Q8U_6srQ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ZeroDrift Enforcement API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003cmeta data-mint-head name=\"slack-app-id\" content=\"A0CJQ2CUV8C\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.zerodrift.com/api-reference/training-studio/train-policy\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/training-studio/train-policy.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.zerodrift.com/#organization\",\"name\":\"ZeroDrift Enforcement API\",\"url\":\"https://docs.zerodrift.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/zerodrift/EnMFM7yTopP4lGmD/logo/ZD_White_Transparent.png?fit=max\u0026auto=format\u0026n=EnMFM7yTopP4lGmD\u0026q=85\u0026s=8a3a1cfcd216c0a056b6a1cd0c50a332\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.zerodrift.com#website\",\"name\":\"ZeroDrift Enforcement API\",\"url\":\"https://docs.zerodrift.com\",\"publisher\":{\"@id\":\"https://docs.zerodrift.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy#webpage\",\"url\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy\",\"name\":\"Train Policy Adapter\",\"description\":\"Start a Training Studio adapter run from an activated policy import\",\"dateModified\":\"2026-12-01T21:57:02.430Z\",\"isPartOf\":{\"@id\":\"https://docs.zerodrift.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"ZeroDrift Enforcement API\",\"item\":\"https://docs.zerodrift.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Train Policy Adapter\",\"item\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy#apireference\",\"headline\":\"Train Policy Adapter\",\"name\":\"Train Policy Adapter\",\"description\":\"Start a Training Studio adapter run from an activated policy import\",\"url\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy\",\"mainEntityOfPage\":{\"@id\":\"https://docs.zerodrift.com/api-reference/training-studio/train-policy#webpage\"},\"dateModified\":\"2026-12-01T21:57:02.430Z\",\"publisher\":{\"@id\":\"https://docs.zerodrift.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.zerodrift.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ZeroDrift Enforcement API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ZeroDrift Enforcement API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/training-studio/train-policy.md","siteName":"ZeroDrift Enforcement API","nav":{"global":{},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"Plugins","pages":[{"title":"Plugins","href":"/codex-plugin"}]},{"tab":"API reference","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Errors","href":"/api-reference/errors"},{"title":"OpenAPI specification","href":"/api-reference/openapi"}]},{"group":"Enforce","pages":[{"title":"Enforce Content","api":"POST /api/v3/content/validate","href":"/api-reference/validate/validate-content"},{"title":"Get Verdict","api":"GET /api/v3/jobs/{job_id}","href":"/api-reference/validate/get-results"}]},{"group":"Redact","pages":[{"title":"Redact PII","api":"POST /api/v3/content/redact","href":"/api-reference/redact/redact-text"}]},{"group":"Import a Policy","pages":[{"title":"Import Policy","api":"POST /api/policies/import","href":"/api-reference/custom-policies/import-policy"},{"title":"Get Import Presigned URL","api":"POST /api/policies/import/presigned_url","href":"/api-reference/custom-policies/import-presigned-url"},{"title":"Start Import","api":"POST /api/policies/import/start","href":"/api-reference/custom-policies/start-import"},{"title":"List Policy Imports","api":"GET /api/policies/import","href":"/api-reference/custom-policies/list-imports"},{"title":"Get Import Details","api":"GET /api/policies/import/{import_id}","href":"/api-reference/custom-policies/get-import-details"},{"title":"Edit Imported Rule","api":"PATCH /api/policies/import/{import_id}/rules/{rule_id}","href":"/api-reference/custom-policies/edit-imported-rule"},{"title":"Activate Rules","api":"POST /api/policies/import/{import_id}/activate","href":"/api-reference/custom-policies/activate-rules"}]},{"group":"Rules","pages":[{"title":"List Rules","api":"GET /api/policies/rules","href":"/api-reference/custom-policies/list-rules"},{"title":"Create Custom Rule","api":"POST /api/policies/rules","href":"/api-reference/custom-policies/create-rule"},{"title":"Get Custom Rule","api":"GET /api/policies/rules/{rule_id}","href":"/api-reference/custom-policies/get-rule"},{"title":"Edit Custom Rule","api":"PATCH /api/policies/rules/{rule_id}","href":"/api-reference/custom-policies/edit-rule"},{"title":"Delete Custom Rule","api":"DELETE /api/policies/rules/{rule_id}","href":"/api-reference/custom-policies/delete-rule"},{"title":"Deactivate Rules","api":"POST /api/policies/rules/deactivate","href":"/api-reference/custom-policies/deactivate-rules"},{"title":"Reactivate Rules","api":"POST /api/policies/rules/activate","href":"/api-reference/custom-policies/reactivate-rules"}]},{"group":"Rule Packs","pages":[{"title":"Rule Packs","api":"GET /api/rulepacks/","href":"/api-reference/rulepacks"}]},{"group":"Activity","pages":[{"title":"List Activity","api":"GET /api/activities","href":"/api-reference/activities/list-activities"},{"title":"Get Activity","description":"Get one Command activity event with timeline and rule detail.","api":"GET /api/activities/{activity_id}","href":"/api-reference/activities/get-activity"}]},{"group":"Training Studio","pages":[{"title":"Train Policy Adapter","api":"POST /api/policies/import/{import_id}/train","href":"/api-reference/training-studio/train-policy"},{"title":"Get Training Status","description":"Poll a policy import until its Training Studio adapter is ready","api":"GET /api/policies/import/{import_id}/train","href":"/api-reference/training-studio/get-training-status"}]}]}]},"basePath":"","title":"Train Policy Adapter - ZeroDrift Enforcement API","deploymentId":"dpl_GDNWf1tLGuMA7VZdZjLPVcJLRJgG","buildId":"dpl_GDNWf1tLGuMA7VZdZjLPVcJLRJgG","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DiWQR0Dw.js","snippetPresets-BmylJwUX.js","utils-C2fWuTLj.js","style-to-object-BY3JEAdk.js","utils-CSS9SJgm.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-B_HuAfYC.js","conditional-requirements-CFM0id0Q.js","cloneDeep-Bink-3az.js","_Uint8Array-DH8dt3QM.js","isObject-FP1Yky1u.js","ApiExamples-DKwL65Qp.js","usePlaygroundInputsStore-Byf7Wjg-.js","shallow-xQA3heHi.js","isEqual-CWFuCnsy.js","CodeSnippets-DrJ7GrW7.js","CodeSnippet-Bau4ZVdW.js","use-playground-group-access-BIWJdxB8.js","Page-DRR8sPxe.js","api-description-markdown-Bl6IXimh.js","DynamicMarkdown-CsDDjLGd.js","SectionHeading-CDNIUELf.js","MethodPill-B33MQrA3.js","getPastedJson-B5OQB7us.js","Check2Icon-lMIePS93.js","axios-CsQoIw0U.js"]}