Skip to Content
Audit rules

Update audit rule

Update an existing audit rule.

PATCH
/audit-rules/{rule_id}

Update an existing audit rule.

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

manage_audit_rules

Path Parameters

rule_id*string
Formatuuid

Request Body

application/json
  1. body

Fields that may be changed on an existing audit rule. Scope fields sent replace the stored ones; omitted fields keep their value.

name?string

Short label for the rule, shown in the rule list.

description?|

Optional note explaining why the rule exists.

status?RuleStatus

Whether a rule takes part in evaluation.

Value in"active""draft""disabled"
scope?

Which calls an audit rule covers.

Response Body

The request has succeeded.

application/json
  1. response

A rule that records more about the calls it covers than the audit log keeps by default. Every active rule whose scope matches a call applies; one is enough.

id*uuid
Formatuuid
name*string

Short label for the rule, shown in the rule list.

description?|

Optional note explaining why the rule exists.

type*"prompt_logging"

Fixed when the rule is created.

Value in"prompt_logging"
status?RuleStatus

Whether a rule takes part in evaluation.

Value in"active""draft""disabled"
scope*

Which calls an audit rule covers.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X PATCH 'https://your-org.aisecurity.services.us.connect.secureauth.com/api/v1/audit-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "type": "prompt_logging",  "status": "active",  "scope": {    "type": "llm_call",    "agent_slugs": [      "string"    ],    "agent_instance_ids": [      "bc3f18ff-0dcd-4cc7-8f61-6ca61814f10b"    ],    "user_ids": [      "2d98503d-4ab4-41bd-8fc6-78cc006fd2db"    ],    "groups": [      "string"    ],    "agent_slug_tag_ids": [      "e428595a-d9dd-4887-8327-2d9cad5b7425"    ],    "autonomous": true,    "model_provider_ids": [      "c92f7331-1c69-4ee3-b28e-c54580a1cbcb"    ],    "model_patterns": [      "string"    ]  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}