Docs / Governance
Budgets and risk controls
Spend and action limits, monitoring, findings and emergency stop.
Budgets
curl -X POST $RAI_BASE_URL/v1/risk/budgets -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ai_system_id": "'$SYSTEM_ID'",
"name": "Daily order value",
"scope_type": "AI_SYSTEM",
"metric": "AMOUNT",
"amount_parameter_path": "amount",
"limit_value": 10000,
"window_seconds": 86400,
"warning_threshold": 0.8,
"effect_on_exceed": "DENY",
"enforcement_mode": "MANDATORY"
}'| Field | Values |
|---|---|
metric | ACTION_COUNT, TOOL_COUNT, AMOUNT, TOKEN_USAGE, COST |
effect_on_exceed | MONITOR, REQUIRE_APPROVAL, DENY, SUSPEND_RUNTIME_IDENTITY |
enforcement_mode | BEST_EFFORT may skip what it cannot measure; MANDATORY fails closed |
Use the metric names exactly as listed and confirm a new budget by exceeding it in a test. A MANDATORY amount budget denies a call whose amount it cannot measure, including model calls through the provider gateway that fall in its scope.
All budgets that apply are checked. A narrower budget never replaces a broader one.
Findings and monitoring
Runtime activity can raise risk findings, with severity and confidence. Monitor rules watch signals such as unusual tool frequency, repeated denials or high-value bursts, and mark a scope for closer monitoring. See GET /v1/risk/findings and GET /v1/risk/monitor-rules?ai_system_id=….
Emergency controls
curl -X POST $RAI_BASE_URL/v1/risk/emergency/runtime-identities/$IDENTITY_ID/suspend \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"reason":"Unexpected behavior","confirm":true}'A suspended identity fails closed. POST /v1/risk/emergency/ai-systems/{id}/stop stops a whole system. Reactivation is a separate, authorized action.