> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerodrift.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Custom Rules Default

> Turn on or off running your custom rules on Max for validations that name no model_engine.

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_engine` runs 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.

A request that names a `model_engine` is unchanged. See [Run Custom Rules by Default](https://docs.zerodrift.com/guides/custom-rules-by-default.md).

## Request Body

**enabled** `boolean` *required*

`true` to run custom rules by default, `false` to stop.

## Response

**enabled** `boolean`

The setting after the change.

```bash cURL theme={null}
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}'
```

```json 200 OK theme={null}
{
  "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. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.