Approve production API calls before they run
Use this pattern when an agent is about to call a production API, trigger a job, send a webhook, mutate a database record, or touch an internal system.
When to use this
Use this pattern when an agent is about to call a production API, trigger a job, send a webhook, mutate a database record, or touch an internal system.
Where Stacksona fits
Place Stacksona immediately before the production call. The agent should prepare the request, ask Gate for a decision, and only run the call when the decision allows it.
What the reviewer should see
- endpoint
- method
- affected system
- payload summary
- full payload or safe redacted payload
- expected impact
- rollback plan
- reason the agent wants to call the API
- risk or review reason
Minimum fields to send
agent_idworkflow_idtool_name: call_production_apiaction_type: production_api- method
- endpoint
affected_systempayload_summaryrollback_plan- reason
callback_url, if using async review
Example request
json
{
"agent_id": "ops-agent-01",
"workflow_id": "production-api-review",
"tool_name": "call_production_api",
"action_type": "production_api",
"method": "POST",
"endpoint": "https://api.internal.example.com/accounts/cus_99/recalculate",
"affected_system": "billing-ledger",
"payload_summary": "Recalculate account balance after support adjustment.",
"rollback_plan": "Run ledger_restore with request_id if the recalculation is incorrect.",
"reason": "Agent detected a mismatch between CRM balance and billing ledger.",
"callback_url": "https://app.example.com/stacksona/api-callback"
}How to branch after the decision
| Status | Behavior |
|---|---|
allowed or approved | Call the API. |
pending_review | Pause, poll, or wait for callback. |
rejected | Do not call the API. |
expired or error | Fail closed by default. |
What to log after execution
- decision_id
- endpoint
- method
- provider request id or internal request id
- response status
- execution_status
- executed_at
- rollback_id if applicable
Common mistakes
- hiding the payload from reviewers
- approving without showing affected system
- not logging the API response result
- failing open on timeout