Agents

Task tokens

Create a task for one job, hand its token to the agent, and complete or revoke it when the job ends.

A task is one job an agent runs. Its token (sct_...) is all the agent holds: who it works for, which actions it may take, on which objects, and until when. Scute stores only a digest of the token, so it is returned once, when the task is created.

Your backend creates tasks with the app key. The agent uses the token as its bearer: Authorization: Bearer sct_.... Never send a task token to a browser.

Create a task#

POST/v1/apps/:app_id/authz/agents/:slug/tasksApp key
acts_forstring
The app user id of the person the agent works for. Leave it out for an autonomous task, which acts for nobody.
actionsstring[]
Permission slugs the task may use, for example invoice:refund. Leave it out for no extra limit. An empty list allows nothing.
resourcesstring[]
Objects the task may touch: a type (invoice) covers every object of that type, invoice:42 covers one. Leave it out for no extra limit. An empty list allows nothing.
requesterobject
Who asked for the job, when that is not the person the task acts for: any of app_user_id, email, phone, name. Used by requester only permissions.
ttl_secondsinteger
Lifetime in seconds. Default 1800 (30 minutes). Clamped to 60 seconds at least and 86400 (24 hours) at most.
refstring
Your own reference for the job, such as a ticket number. Up to 200 characters. Shown in deny explanations and lists.
parent_task_idstring
Make this a sub-agent's task inside an open task. See Delegation.
acts_for_operatorstring
For operator tooling: the id or email of a dashboard user who is a member of the app's workspace. The task works for that person instead of an app user.
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/agents/billing-assistant/tasks \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{    "acts_for": "APP_USER_ID",    "actions": ["invoice:read", "invoice:refund"],    "resources": ["invoice:42"],    "ttl_seconds": 900,    "ref": "ticket-8812"  }'

Scute answers 201:

{  "id": "4f1e...",  "agent": "billing-assistant",  "agent_name": "Billing assistant",  "status": "open",  "acts_for": "APP_USER_ID",  "acts_for_person": { "id": "APP_USER_ID", "email": "sam@example.com", "name": "Sam Lee" },  "actions": ["invoice:read", "invoice:refund"],  "resources": ["invoice:42"],  "ref": "ticket-8812",  "chain": ["billing-assistant"],  "expires_at": "2026-11-19T10:15:00Z",  "created_at": "2026-11-19T10:00:00Z",  "token": "sct_..."}

Action slugs are lowercased and both lists are sorted and de-duplicated. token appears only in this answer.

Errors#

Statuserror_codeWhen
404not_foundNo such agent, or parent_task_id is not a task of this app
404user_not_foundacts_for is not a user of this app, or acts_for_operator is not a member of the workspace
403user_banned, user_suspendedThe person is banned or suspended. No task can act for them.
409agent_suspendedThe agent is suspended
422invalidttl_seconds is not a whole number, the person is deactivated, or a child task reaches outside its parent

Status#

A task is in one of four states. status is computed on every read.

StatusMeaning
openUsable
completedYour backend marked it done
revokedRevoked, or its agent was suspended, or its parent task ended
expiredPast expires_at

A token works only while the task is open, the agent is active, every parent task is open, and the person it acts for is not banned or suspended. A ban or suspension of that person ends their open tasks, with a revoke_note saying why.

What the agent can read#

GET/v1/auth/:app_id/agent/whoamiTask token

What this task may do right now: the agent's ceiling roles intersected with the person's permissions and the task's lists.

curl https://api.scute.io/v1/auth/$SCUTE_APP_ID/agent/whoami \  -H "Authorization: Bearer $TASK_TOKEN"
{  "agent": "billing-assistant",  "task": "4f1e...",  "acts_for": "APP_USER_ID",  "chain": ["billing-assistant"],  "agent_roles": ["billing_agent"],  "permissions": ["invoice:read", "invoice:refund"],  "ceiling": ["invoice:read", "invoice:refund"],  "conditional": [],  "step_up": ["invoice:refund"],  "approval": [],  "actions": ["invoice:read", "invoice:refund"],  "resources": ["invoice:42"],  "expires_at": "2026-11-19T10:15:00Z",  "expires_in": 840,  "warnings": []}
FieldMeaning
permissionsWhat the task may do now
ceilingThe most it could ever do: enabled permissions its roles grant, within the task's actions. Use it to hide tools.
conditionalPermissions the person holds only under conditions
step_upAllowed permissions that need the person to verify first
approvalAllowed permissions that need a reviewer's approval
warningsexpires_soon when under 5 minutes are left

An invalid, expired or revoked token answers 401 with invalid_task_token.

List tasks#

GET/v1/apps/:app_id/authz/agents/:slug/tasksApp key

One agent's tasks, newest first, up to 200. ?status=open for open tasks only.

GET/v1/apps/:app_id/authz/tasksApp key

Every agent's tasks in the app, newest first, paged. Query: status (open, completed, revoked, expired), agent (a slug), limit (default 50, at most 200) and before (the next of the previous page).

GET/v1/workspaces/:workspace_id/authz/tasksWorkspace member

The same list across every app of a workspace. Adds app_id to pick one app. Each task has an app field.

Complete a task#

POST/v1/apps/:app_id/authz/agents/:slug/tasks/:id/completeApp key

Marks an open task done. Its token stops working. A task that is not open answers 409 with task_closed.

Revoke a task#

POST/v1/apps/:app_id/authz/agents/:slug/tasks/:id/revokeApp key
revoke_notestring
Why it was ended. Optional, up to 2000 characters. Kept on the task and on the audit event.

Every open task inside it (its sub-agents' tasks, at any depth) ends with it. They come back in also_revoked. The task records who revoked it in revoked_by.

curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/agents/billing-assistant/tasks/TASK_ID/revoke \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{ "revoke_note": "Customer closed the ticket" }'
Statuserror_codeWhen
404not_foundNo such task for this agent
409task_closedAlready completed, revoked or expired
422invalidrevoke_note is not text

The task as a JWT#

For systems that want a signed JWT instead of the opaque token, Scute signs the delegation with the app's key. See Delegation.