Guardrails
The kill switch, spending limits, and the owner verification check that apply to every request.
Guardrails are enforced on every authenticated request, after the credential has been checked. They take effect immediately, even for tokens that are still valid.
Configure
curl -X PATCH https://api.aytwin.ai/api/v1/agents/$AGENT_ID/config \
-H "Authorization: Bearer $AY_OIDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{"kill_switch": false, "daily_limit_eur": 50, "max_spend_per_tx_eur": 10}'| Field | Effect |
|---|---|
kill_switch | true blocks every call with 403 AGENT_HALTED. The agent stays registered and can be resumed. |
daily_limit_eur | When today's spend reaches the limit, calls fail with 403 DAILY_LIMIT_EXCEEDED. null removes the limit. Read daily_spent_eur from GET /api/v1/agents/{id} to see where you stand. |
max_spend_per_tx_eur | Upper bound for a single transaction. null removes the limit. |
GET /api/v1/agents/{id} and GET /api/v1/agents/me return the configuration and daily_spent_eur. GET /api/v1/agents/{id}/transactions lists the transactions behind the spend.
Owner verification
A business agent works only while the business's verification credential is valid. AY checks this on every request. A suspended or revoked business gets 403 OWNER_NOT_VERIFIED; if the check itself is unavailable, the response is 503 verifier_unavailable and the request is not served.
Recommended defaults
- Keep the kill switch reachable from your own incident tooling: one
PATCHstops the agent everywhere. - Set a daily limit before you enable an agent in production.
- Watch for
403responses in your agent's logs. They mean a guardrail fired, not a bug in your code.