Before each action the agent asks Scute with its task token. Scute allows the action only when all three hold:
- One of the agent's ceiling roles grants the permission (and that role's conditions on it hold).
- The person the task acts for is allowed it, by the full authorization engine: their roles, roles on the object, conditions, verification and approval.
- The task's actions and resources lists cover it.
The person's answer can add a step: allow_with_step_up (they verify first) or allow_with_approval (a reviewer approves first). Only allow means go ahead.
Check one action#
/v1/auth/:app_id/agent/checkTask tokencurl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/agent/check \ -H "Authorization: Bearer $TASK_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "action": "refund", "resource": "invoice:42", "details": { "amount": 40 } }'{ "decision": "allow_with_step_up", "allowed": false, "reason": "verification_required", "permission": "invoice:refund", "roles": ["customer"], "step_up": { "method": "any", "authorizes_action": "invoice:refund" }, "agent": { "agent": "billing-assistant", "task": "4f1e...", "chain": ["billing-assistant"], "roles": ["billing_agent"] }, "explanation": "Billing assistant, acting for sam@example.com: ...", "say": "Before I do that, I need to verify it's you."}| Field | Meaning |
|---|---|
| decision | allow, deny, allow_with_step_up or allow_with_approval |
| allowed | true only for allow. Code that tests allowed never skips a verification. |
| reason | Why. See the tables below. |
| step_up | What verification is needed, when allow_with_step_up |
| approval | What approval is needed, when allow_with_approval |
| agent | The agent, task, chain and the agent roles that granted it |
| explanation | A sentence for logs and people |
| say | A line the agent can speak or write to the person as is. Missing on a plain allow. |
Every check is written to the app's decision log.
Deny reasons from the agent and task#
| reason | Meaning |
|---|---|
| agent_suspended | The agent is suspended |
| task_closed | The task is completed, revoked or expired |
| unknown_permission | No such permission in the app's policy |
| permission_disabled | The permission is turned off for everyone |
| outside_task | The task's actions or resources do not cover it |
| agent_role | None of the agent's roles grant it |
| condition_failed | The agent's role grants it only under conditions that do not hold |
| person_inactive | The person the task acts for is deactivated |
| needs_human | The task acts for nobody, and the permission needs a person (see below) |
| budget_exceeded | The agent went over its budget and was paused. See Safety rails. |
| loop_detected | Loop detection in enforce mode refused a repeat |
| target_required | A requester only permission was called without saying who it is for |
When the person's own check denies, the decision is the person's deny, with the agent added and the explanation prefixed with who is acting for whom.
Tasks that act for nobody#
An autonomous task (no acts_for) can use a permission only when the app marked it autonomous_allowed and it needs neither verification nor approval, and it is not requester_only. There is nobody to verify or ask. Anything else is denied with needs_human.
Check many actions#
/v1/auth/:app_id/agent/check-batchTask tokenAnswers { "results": [...] } in the same order. Batch checks are for listing what the agent could do: they take no challenge or approval, and they do not count toward budgets or loops. More than 100 checks is a 422 with batch_too_large.
Errors#
| Status | error_code | When |
|---|---|---|
| 401 | invalid_task_token | Token missing, expired or revoked, or the person is banned or suspended |
| 422 | invalid | No action, or checks is not a list |