When a policy returns require_approval, an approval request is created and reviewers are notified. Reviewers can approve or deny the request from the dashboard or via the API.
Getting notified
Configure notification preferences in Settings → Notifications. The approvalRequired event controls when reviewers are alerted.
Supported channels:
- Email — sent to all addresses in
notification_emails
- Slack — sent to the Slack incoming webhook URL
- In-app — shown in the Sentrail dashboard notification panel
Reviewing in the dashboard
Go to Approvals in the dashboard. Pending requests appear with:
- Agent name and ID
- Tool and action
- Risk level
- Payload preview
- Time the request was created
- Expiry time (default 24 hours from creation)
Click a request to see the full payload, then click Approve or Deny. You can optionally add a review reason.
Reviewing via API
Use the approval-decision endpoint. Requires a Supabase user JWT (not an agk_ key) and at minimum the reviewer role.
# Approve
curl -X POST \
"https://<project-ref>.supabase.co/functions/v1/approval-decision" \
-H "Authorization: Bearer <supabase-jwt>" \
-H "Content-Type: application/json" \
-d '{
"approvalRequestId": "550e8400-e29b-41d4-a716-446655440000",
"decision": "approved",
"reason": "Reviewed and looks correct"
}'
# Deny
curl -X POST \
"https://<project-ref>.supabase.co/functions/v1/approval-decision" \
-H "Authorization: Bearer <supabase-jwt>" \
-H "Content-Type: application/json" \
-d '{
"approvalRequestId": "550e8400-e29b-41d4-a716-446655440000",
"decision": "denied",
"reason": "Wrong branch target"
}'
After a decision
Approved:
- Sentrail checks the kill switch is still inactive
- The stored deferred action is replayed to the tool API with the original headers and body
- The tool API response is stored in
approval_requests.execution_result
- The agent’s poll response changes to
{ status: "executed", result: {...} }
- A notification is sent for the
approvalDecided event
Denied:
- The deferred action is marked failed
- The agent’s poll response changes to
{ status: "denied" }
- A notification is sent for the
approvalDecided event
Expiry
Approval requests expire after 24 hours by default. Expired requests cannot be approved or denied. The expire-approvals cron job runs periodically and marks pending requests as expired when their expires_at timestamp has passed.
Once expired, the agent must resubmit the action. Sentrail does not auto-retry expired approvals.
Approval status values
| Status | Meaning |
|---|
pending | Waiting for a reviewer decision |
approved | Reviewer approved; execution in progress |
denied | Reviewer denied; action will not execute |
expired | Expired without a decision |
executed | Approved and tool call succeeded |
failed | Approved but tool call failed during execution |
Audit trail
Every approval decision writes two audit log entries:
- The original evaluation (
decision = require_approval)
- The reviewer decision (
decision = allow or decision = block)
Both share the same correlation_id, making it easy to trace the full lifecycle in the audit log.