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

# Rules

> Rules that constrain what an agent may say and do.

# Rules

A rule is a named constraint on agent behaviour — the guardrails that decide when an agent may
act on its own, and when it must defer.

Rules are how you encode policy without changing code. For the reasoning that *evaluates* them
against a decision, see [NSR verified decisions](/stateset-nsr-decisions).

## Shape

| Field         | Type   | Notes                  |
| ------------- | ------ | ---------------------- |
| `id`          | string | Unique identifier      |
| `type`        | string | The kind of rule       |
| `name`        | string | Human-readable name    |
| `description` | string | What the rule enforces |
| `created_at`  | string | Creation timestamp     |
| `updated_at`  | string | Last modification      |

## Endpoints

| Method   | Path        |                                                |
| -------- | ----------- | ---------------------------------------------- |
| `GET`    | `/v1/rules` | [List](/response-api-reference/rules/list)     |
| `GET`    | `/v1/rules` | [Get](/response-api-reference/rules/get)       |
| `POST`   | `/v1/rules` | [Create](/response-api-reference/rules/create) |
| `PUT`    | `/v1/rules` | [Update](/response-api-reference/rules/update) |
| `DELETE` | `/v1/rules` | [Delete](/response-api-reference/rules/delete) |

## Example

```bash theme={null}
curl https://api.stateset.com/v1/rules \
  -H "Authorization: Bearer $STATESET_API_KEY"
```

```bash theme={null}
curl -X POST https://api.stateset.com/v1/rules \
  -H "Authorization: Bearer $STATESET_API_KEY" \
  -H 'content-type: application/json' \
  -d '{
    "name": "Escalate refunds over $100",
    "type": "escalation",
    "description": "Any refund at or above $100 requires human approval before execution."
  }'
```

<Tip>
  Write the rule so a human can audit it. The `description` is what appears in a review queue when
  the rule fires, so "Any refund at or above \$100 requires human approval" is more useful than
  "refund guard".
</Tip>

## Where rules are enforced

| Layer                                                            | Mechanism                                                    |
| ---------------------------------------------------------------- | ------------------------------------------------------------ |
| [ResponseCX](/stateset-response/response-public-api)             | Rules attached to an agent                                   |
| [Workflow Studio](/stateset-response/responsecx-workflow-studio) | Review gate and High-Value Action threshold                  |
| [NSR](/stateset-nsr-decisions)                                   | `permit` / `deny` / `review` effects with cited proofs       |
| [Temporal engine](/next-temporal/configuration)                  | `action_rules` — blocked, require\_review, max\_auto\_amount |

## Related

* [Verified Decisions](/stateset-nsr-decisions)
* [Policy Engine & Decision Gate](/next-temporal/policy-engine)
