Update an existing rule by ID without an organization path prefix. The rule's organization is resolved from the rule record itself. Platform-scope rules (those with no organization) require the `MANAGE_PLATFORM_RULES` capability on your current organization. Only the fields you send are changed.

## Path parameters

**`rule_id`** string required

Rule ID (prefixed with `rule_`).

## Request body

**`name`** string optional

New rule name.

**`content`** string optional

New rule content/body.

**`description`** string optional

New description.

**`category`** string optional

Category. Values: `safety`, `professional`, `creative`, `technical`, `custom`, `viz_hints`.

**`rule_type`** string optional

Rule type. Values: `behavior`, `guardrails`, `formatting`, `context`, `content_policy`, `constraint`.

**`scope`** string optional

Rule scope. Values: `platform`, `organization`, `model`, `assistant`, `user`, `vector_store`.

**`apply_mode`** string optional

When the rule is applied. Values: `always`, `auto`, `manual`.

**`is_public`** boolean optional

Whether the rule is public.

**`is_active`** boolean optional

Whether the rule is active.

## Returns

Returns the updated rule object with an incremented `version`.

Request

```bash cURL
curl -X PUT "https://api.aitronos.com/v1/rules/rule_abc123" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "description": "Updated safety policy", "is_active": true }'
```


```python Python SDK
# A first-class SDK method for this endpoint is coming soon.
# In the meantime, call the endpoint directly with the SDK's HTTP client:
from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")
response = client._client_wrapper.httpx_client.request(
    "rules/rule_abc123",
    method="PUT",
    json={"description": "Updated safety policy", "is_active": True},
)
print(response.json())
```


```python Python
import os, requests

response = requests.put(
    "https://api.aitronos.com/v1/rules/rule_abc123",
    headers={
        "Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}",
        "Content-Type": "application/json",
    },
    json={"description": "Updated safety policy", "is_active": True},
)
print(response.json())
```


```javascript JavaScript
await fetch("https://api.aitronos.com/v1/rules/rule_abc123", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ description: "Updated safety policy", is_active: true }),
});
```

Response

```json 200 OK
{
  "id": "rule_abc123",
  "name": "Safety Guidelines",
  "description": "Updated safety policy",
  "content": "Always cite sources and avoid speculation beyond the provided context.",
  "content_length": 412,
  "category": "safety",
  "rule_type": "content_policy",
  "scope": "organization",
  "apply_mode": "always",
  "organization_id": "org_abc123",
  "created_by": "usr_abc",
  "is_public": false,
  "is_active": true,
  "version": 3,
  "usage_count": 3,
  "can_edit": true,
  "created_at": "2026-06-20T09:15:00Z",
  "updated_at": "2026-06-29T14:30:00Z"
}
```


```json 403 Forbidden
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "You do not have permission to perform this action.",
    "system_message": "Insufficient permissions for this operation",
    "type": "authorization_error",
    "status": 403,
    "details": { "rule_id": "rule_abc123" },
    "trace_id": "req_abc123xyz",
    "timestamp": "2026-04-15T10:00:00Z"
  }
}
```

## Related Resources

- [Update a rule](/docs/api-reference/rules/update)
- [List rules (query param)](/docs/api-reference/rules/list-query)
- [Delete a rule (by ID)](/docs/api-reference/rules/delete-by-id)
- [Toggle rule activation](/docs/api-reference/rules/toggle-active)