curl -X PUT https://api.zerodrift.ai/api/policies/custom-rules-enforcement \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
{
"enabled": true
}
Rules
Set Custom Rules Default
Turn on or off running your custom rules on Max for validations that name no model_engine.
PUT
/
api
/
policies
/
custom-rules-enforcement
curl -X PUT https://api.zerodrift.ai/api/policies/custom-rules-enforcement \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
{
"enabled": true
}
Turns the workspace’s Run custom rules by default setting on or off. It’s the same switch as Guard › Custom rules in Command. Needs a full-access API key.
When it’s on:
- A validation that names no
model_engineruns on Max (anchor_3_0_max) against every active rule, custom rules included, when at least one custom rule is active. With none, it stays on Flagship. - Such a request is billed at the Max rate and reports
engine_upgrade_reason: "workspace_setting". - It fails, rather than passing, when Max can’t score one of your custom rules.
- The Claude and ChatGPT plugins block a send when such a check fails or doesn’t finish in time.
model_engine is unchanged. See Run Custom Rules by Default.
Request Body
Response
curl -X PUT https://api.zerodrift.ai/api/policies/custom-rules-enforcement \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
{
"enabled": true
}
Errors
| Status | Meaning |
|---|---|
400 | enabled isn’t a boolean. |
403 | A read-only API key, or no workspace was found for this key. |
404 | Workspace not found. |
409 | Rule activation isn’t enforced for your workspace, so the setting would have no effect. |

