Agents

Safety rails

Budgets, loop detection and first-use review run on every action an agent is allowed to take.

Safety rails run on every allow an agent gets from a check, since each one is an action it was cleared to take. Batch checks and dry runs are not counted. What a rail catches is recorded as an audit event, lands in the monitors inbox, and, for loops, pauses and decoys, is sent to the agent's alert channels.

RailWhat it catchesPage
BudgetMore allowed actions in a window than you setThis page
Loop detectionThe same permission on the same object over and over in one taskThis page
First-use reviewThe first time an agent is allowed a permissionThis page
Tool driftA tool definition that changed since it was first seenTool drift and decoys
Decoy toolsA call to a tool no legitimate task usesTool drift and decoys
Requester onlyAn action on someone other than the person who askedRequester only
Session trustNot a block: lets a cleared call repeat in one conversationSession trust
Content guardRedacts secrets and personal data, and catches prompt injection in tool results. A harness guard.Harness

Settings#

Budget, loop and alert settings live on the agent, in settings. Set them when you register the agent or with PATCH /v1/apps/:app_id/authz/agents/:slug.

curl -X PATCH https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/agents/billing-assistant \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{    "settings": {      "budget": { "max_actions": 200, "window_minutes": 60, "permissions": { "invoice:refund": 10 } },      "loop": { "limit": 20, "window_minutes": 10, "mode": "enforce" },      "alert_channel_ids": ["TEAM_CHANNEL_ID"]    }  }'

Out-of-range values are a 422 with a message naming the setting.

Budgets#

budget.max_actionsinteger
Allowed actions per window, across all permissions. 1 to 100000.
budget.window_minutesinteger
Window length. 1 to 1440. Default 60.
budget.permissionsobject
Per permission slug, allowed actions per window. Each 1 to 100000.

A budget needs max_actions or permissions, or both. Windows are fixed clock slots of window_minutes, counted per agent across all its tasks.

Going over pauses the agent:

  1. The check that went over answers deny with budget_exceeded, and the say line "I've been paused for a safety check, so I can't do that right now. A person will follow up."
  2. The agent is suspended with the reason Over budget: ..., and every open task ends.
  3. A paused item lands in the monitors inbox and a critical alert goes to the agent's channels.

A person has to resume the agent.

Loop detection#

loop.limitinteger
Allowed repeats in the window. 2 to 1000. Default 20.
loop.window_minutesinteger
Window length. 1 to 1440. Default 10.
loop.modestring
observe (default) records and alerts. enforce also refuses.

Loop detection is always on with the defaults. It counts allows of the same permission on the same object within one task. The first allow over the limit records the audit event app.authz.agent.loop_detected, puts a loop item in the inbox and sends a warning alert. In enforce mode every allow over the limit becomes deny with loop_detected.

First-use review#

The first time an agent is allowed a permission, Scute adds it to the agent's seen_permissions, records app.authz.agent.first_use, and puts a first_use item in the inbox. The action itself goes ahead.

Alert channels#

alert_channel_ids lists team channels of the app's workspace that get the agent's alerts. A channel from another workspace is a 422. Without channels, catches still go to the inbox and the audit log.

Counters live in the cache

Budget and loop counters are kept in Scute's cache. If the cache is unavailable, counts read as nothing and no budget or loop trips.