Help centre
Guardrails and human escalation
Define a guardrail policy, set uncertainty thresholds, and route escalations to Slack when a human should decide.
Why guardrails sit in the harness
A guardrail policy is a set of rules the harness enforces at runtime, on every call, regardless of which prompt or model produced the output. Prompts ask a model to behave; policies make non-compliance a handled event rather than a shipped one. Because enforcement happens in the harness, a policy applies uniformly even as prompts and providers change underneath it.
Step 1: Define a policy
Policies live in hyperpriors.yaml and attach to one or more harnesses. Each rule names a condition and the action to take when it fires:
policies:
support-replies:
applies_to: [summarise-ticket, draft-reply]
rules:
- check: pii_detected
action: redact
- check: topic
outside: [billing, shipping, returns]
action: block
- check: output_length
max_tokens: 800
action: truncate
Available actions are block, redact, truncate, retry, and escalate. Blocked and escalated calls return a structured refusal to your application, so decide up front what your interface shows when that happens.
Step 2: Set uncertainty thresholds
Not every failure is a clear rule violation. Often the model is simply unsure — a judged confidence score is middling, retrieval found weak support, or the output disagrees with a prior answer to the same question. Uncertainty thresholds let you route these cases to a person instead of guessing:
- check: confidence
below: 0.6
action: escalate
Start permissive and tighten gradually. A threshold set too aggressively floods reviewers and teaches the team to ignore escalations, which is worse than having none. Watch the escalation rate in the dashboard for a week before you commit to a value.
Step 3: Wire Slack escalation
- Run
hyperpriors integrations add slackand authorise the workspace when your browser opens. - Choose the channel that receives escalations, for example
#ai-escalations. - Reference the integration from your policy:
escalation:
channel: slack
target: "#ai-escalations"
include_trace_link: true
Each escalation posts the input, the proposed output, and the rule that fired, together with a link to the full trace. Reviewers approve, edit, or reject from the thread, and every decision is recorded against the trace for audit.
Closing the loop
Escalations are training data for your process. Review them weekly: repeated approvals suggest a threshold you can relax, repeated rejections suggest a failure your eval suite should cover. A guardrail policy is not a static document — it should get quieter as your system earns trust, and louder the moment behaviour drifts.