Start here

Quick Start

The complete 3-step safety loop: validate before execution, report the result, verify the outcome. Agents should never assume success.

1
Preflight
Validate input + evaluate policies
2
Report
Execute, then report the real result
3
Verify
Confirm outcome against external system
Example
# The full 3-step safety loop

# Step 1: Validate before execution
curl -X POST $API_URL/action-preflight \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contract_slug": "stripe-charge",
    "action_input": {
      "amount": 9900,
      "currency": "usd",
      "customer_id": "cus_abc123"
    }
  }'

# Response
{
  "ok": true,
  "run_id": "550e8400-e29b-41d4-a716-446655440000",
  "risk_level": "high",
  "validation": {"status": "passed", "issues": []},
  "policy": {"decision": "approved", "rules_evaluated": 2, "blocking_rule": null},
  "next_step": "proceed_to_execution",
  "instructions": "Preflight passed. Proceed with the action, then call report-execution-result with run_id=..."
}

# Step 2: Execute your real-world action, then report
curl -X POST $API_URL/action-report \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "run_id": "550e8400-e29b-41d4-a716-446655440000",
    "execution_status": "completed",
    "external_ref": "ch_3abc123",
    "output": {
      "charge_id": "ch_3abc123",
      "status": "succeeded",
      "amount_captured": 9900
    }
  }'

# Step 3: Verify the outcome — provide evidence the agent collected
curl -X POST $API_URL/action-verify \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "run_id": "550e8400-e29b-41d4-a716-446655440000",
    "external_ref": "ch_3abc123",
    "claimed_outcome": {
      "charge_id": "ch_3abc123",
      "amount_captured": 9900,
      "status": "succeeded"
    }
  }'

# Response — verified
{
  "ok": true,
  "run_id": "550e8400-e29b-41d4-a716-446655440000",
  "verification_status": "verified",
  "final_outcome": "success",
  "outcome": {
    "external_ref": "ch_3abc123",
    "verified_at": "2026-05-27T10:00:00Z",
    "evidence": {"charge_id": "ch_3abc123", "amount_captured": 9900}
  },
  "instructions": "Outcome verified. Work is confirmed done."
}

Base URL

https://[your-project].supabase.co/functions/v1

Authenticate with your API key via Authorization: Bearer $API_KEY