Skip to main content
POST
Creates a template-scoped guardrail. Content shapes by type: Hook events: PreToolUse, PostToolUse, UserPromptSubmit, Notification, Stop, SubagentStop, SessionStart, SessionEnd, PreCompact. Command hooks require script; prompt hooks require prompt. On the wire the async field is spelled async. Required scope: guardrails:write

Path Parameters

string
required
The template ID.

Request Body

string
required
allowlist_rule_v0, hook_v0, or network_rule_v0.
string
required
Guardrail name (1 to 128 characters).
string
Human-readable name.
string
Short description (max 1024 characters).
object
required
The typed content object (see the table above).
boolean
default:"true"
Whether the guardrail is enforced.
integer
default:"0"
Ordering position; lower applies first.

Errors