Documentation Index
Fetch the complete documentation index at: https://docs.polaxis.io/llms.txt
Use this file to discover all available pages before exploring further.
Human Approvals
Require a human decision before high-risk agent actions execute.
How it works
- Agent calls
guard.evaluate("charge_card", {...})
- Policy matches — action is
escalate
- Polaxis sends a Slack notification to your team
- SDK pauses and waits (up to 10 minutes by default)
- Human clicks Approve or Reject in Slack
- Agent proceeds or
BlockedError is raised
No code change needed beyond the initial evaluate() call.
Set up Slack notifications
- Go to Dashboard → Settings → Slack
- Click Connect Slack
- Choose the channel where approvals should appear
- Test with the Send test notification button
Or via API:
POST /api/v1/auth/test-slack
{ "webhook_url": "https://hooks.slack.com/services/..." }
What the Slack message looks like
🚨 Polaxis — Approval Required
Agent: billing-agent
Tool: charge_card
Input: { "amount": 4999, "currency": "usd", "customer": "acme-corp" }
Policy: escalate_large_charges
[✅ Approve] [❌ Reject]
One click. The agent either continues or stops.
Handle approval in your code
from polaxis import Polaxis, BlockedError, PendingApprovalError
guard = Polaxis(api_key="ag_prod_...", agent_id="billing-agent")
try:
result = await guard.evaluate("charge_card", {
"amount": 4999,
"customer_id": "cust_123"
})
# Execution reaches here only after human approval
print("Approved — proceeding with charge")
except BlockedError as e:
print(f"Rejected: {e.reason}")
except PendingApprovalError as e:
print(f"Timed out waiting for approval: {e.approval_id}")
Approval timeout
Default timeout is 10 minutes. Configure per agent:
guard = Polaxis(
api_key="ag_prod_...",
agent_id="billing-agent",
timeout_seconds=300 # 5 minutes
)
View approval history
GET /api/v1/approvals/history
Every approval and rejection is logged with timestamp, approver, and reason.