Skip to main content

Guardrails

Guardrails live at Dashboard → Guardrails: the policy rules that decide what agents do alone and what comes to a person. Agents act on their own by default — a guardrail is the rule that interrupts them. All calls need a Bearer JWT and an X-Workspace-Id header.

Rules

A rule has a name, a rule_kind, an optional action_kind scope (empty means the rule applies to every action kind), a verdict, a required_approvals count, and an enabled flag. The rule kinds the evaluator understands:

  • spend_cap / approval_threshold — fires when the action amount exceeds threshold_cents
  • flagged_account — fires when the action's account ref contains the rule's account_ref
  • first_of_kind — fires when the action kind has not been taken before in the workspace

The form also accepts an optional window (e.g. 1d, 1h) and max_count for rate-style rules, and thresholds are entered in dollars and stored as cents. Verdicts are allow / approve / block — anything else is rejected when the rule is saved.

The portal rule list shows each rule's on/off state, kinds, verdict, and a one-line summary ("over $500 · per 1d · max 10 · 2 approvers"), with Enable/Disable, Edit, and two-click Delete actions.

Evaluation: strictest matching rule wins

Evaluating a proposed action (action kind + amount + optional account ref and actor) checks every enabled rule in the workspace. When several rules match, the strictest verdict wins: block > approve > allow.

The response carries the verdict, a human reason ("Large spend: $1,200 is over the $500 cap"), the winning policy id, and its required-approvals count. When nothing matches, the action is allowed — and if the amount tops $10,000 with no spend rule in place, the response suggests adding one. Every evaluation is recorded in the log, including dry runs from the tester.

The Evaluate tester on the portal page previews a verdict without acting: enter an action kind, optional amount, account, and actor, and the verdict chip, policy id, approver count, and reason render inline.

Evaluation log and handoffs

The log lists every check — action, actor, timestamp, amount, verdict, and reason — with a verdict filter. Blocked and approval-routed work lands in Dashboard → Decisions("Needs you"), where a person resolves what the agent could not do alone. Guardrail-gated sends are also the approval layer behind Sequences outreach.

API pointers

MethodPathWhat it does
GET/api/guardrails/rulesList rules; optional enabled filter
POST/api/guardrails/rulesCreate a rule (verdict must be allow/approve/block)
GET/api/guardrails/rules/{id}Single rule
PATCH/api/guardrails/rules/{id}Edit a rule, incl. enable/disable
DELETE/api/guardrails/rules/{id}Delete a rule
POST/api/guardrails/evaluateCheck an action; strictest match wins; verdict + reason + policy id
GET/api/guardrails/evalsEvaluation log, newest first; optional verdict filter