Create a guardrail
Makes version 1. Where it applies is a list of conditions that all have to hold; what it requires is a list of requirements. A relaxing guardrail holds one fast path and waives the approvals other guardrails ask for where it holds. Taking `guardrail:manage` on the organization.
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
Idempotency-Key?stringMakes retries safe. A repeated key with the same request returns the first result and sets
Idempotent-Replayed: true. The same key with a different request answers 409
idempotency.key_reused, and while the first request is still running 409
idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack
of sign-in or permission are not kept, so a retry runs again.
^[A-Za-z0-9_.:-]+$1 <= length <= 255application/json- body
fromPreset?stringThe preset the guardrail is made from; kept for the editor's "From preset" chip.
length <= 120name*string1 <= length <= 80description?stringlength <= 300kind?string"rule""relax"ownerTeamId?stringmode*string"enforce""warn""off"scope?array<>items <= 20requires*array<>1 <= items <= 20actions?array<>The actions it governs; left out, release and rollback.
items <= 4summary?stringWhat changed, for the history.
length <= 200The new guardrail.
application/json- response
actions*array<>The actions it governs. A guardrail saved before it named any reads as release and rollback, which is what it has always governed.
id*stringuuidname*stringdescription*stringkind*string"rule""relax"mode*string"enforce""warn""off"builtin*booleanfromPreset?stringThe preset it was made from, when it was.
builtinKey?stringSet on the guardrails Wardn ships, such as protected_branch and freezes.
ownerTeamId?stringThe team that owns it and alone may add exceptions; absent for the organization and for a caller who may not read the team.
ownerTeamName?stringThe owning team's name, shown to anyone who reads the guardrail.
cover?exceptionsInEffect?integerExceptions in effect on places the caller may see. Present on a single guardrail read, with cover.
scope*array<>requires*array<>version*newestVersion*integerarchived*booleancreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X POST 'https://wardn.example.com/api/v1/guardrails' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "mode": "enforce", "requires": [ { "id": "string", "kind": "approval" } ]}'{ "actions": [ "release" ], "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "kind": "rule", "mode": "enforce", "builtin": true, "fromPreset": "string", "builtinKey": "string", "ownerTeamId": "string", "ownerTeamName": "string", "cover": { "deployments": 0, "apps": 0, "clusters": 0, "leftOut": 0, "summary": "string", "lowered": [ "string" ] }, "exceptionsInEffect": 0, "scope": [ { "field": "class", "op": "is", "value": "string", "label": "string" } ], "requires": [ { "id": "string", "kind": "approval", "count": 1, "humanOnly": true, "group": "security", "level": "propose", "when": "freeze", "branch": "string", "system": "servicenow", "afterSeconds": 60, "days": 1, "label": "string" } ], "version": { "version": 1, "summary": "string", "mode": "enforce", "createdBy": { "id": "string", "name": "string" }, "createdAt": "2019-08-24T14:15:22Z" }, "newestVersion": 0, "archived": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}List guardrails GET
Every guardrail at its newest version with what it reaches (deployments, apps, clusters, after its exceptions), the exceptions in effect and, for a warn-only one, how many decisions it noted in the last 30 days: what the Guardrails board draws. `counts` are the tiles and `tabs` the counts on the Rul
Get a guardrail GET
The guardrail at its newest version, or at `version` for the history and for a stored decision that used it.