Python SDK

Agents

Register the AI agents you build, start short-lived tasks for them, and suspend or resume an agent from your backend.

scute.agents manages agents with the secret key. An agent has roles from your policy, which are its ceiling. Each job runs as a task: a short-lived grant that names the person the agent works for and narrows what it may do. Every tool call is checked against the agent's roles, the person and the task. For the concepts, see Agents.

scute.agents.create("support-bot", roles=["support"], settings={"budget": {"max_actions": 50}})task = scute.agents.start_task("support-bot", acts_for=user_id, actions=["invoice:read"])task["token"]  # returned once: hand it to the agent process, never to the model

Methods return the API's JSON. The paths are under /v1/apps/:app_id/authz/agents.

Register an agent#

scute.agents.create(slug, *, name=None, description=None, roles=None, owner_user_id=None, team_role=None, settings=None)
slugstrrequired
The agent's id in Scute, for example support-bot.
namestr | None
Display name.
descriptionstr | None
What the agent does.
roleslist[str] | None
Role slugs from your policy. The agent can never do more than these allow.
owner_user_idstr | None
A person who can reach the app's workspace and answers for the agent.
team_rolestr | None
Sent as team_role.
settingsdict | None
Safety rails, for example {"budget": {"max_actions": 50, "window_minutes": 60}}.

Arguments left as None are not sent.

Read, update, delete#

scute.agents.list() -> list[dict]scute.agents.get(slug)scute.agents.update(slug, **attributes)scute.agents.delete(slug) -> None

update sends its keyword arguments as the JSON body of a PATCH.

Suspend and resume#

scute.agents.suspend(slug, reason=None)scute.agents.resume(slug)

suspend is the kill switch: every open task of the agent ends at once. An agent that goes over its budget is also paused; resume lets it start tasks again.

Tasks#

scute.agents.start_task(slug, *, acts_for=None, actions=None, resources=None, requester=None, ttl=None, ref=None, parent_task_id=None)scute.agents.tasks(slug, status=None) -> list[dict]scute.agents.complete_task(slug, task_id)scute.agents.revoke_task(slug, task_id)scute.agents.assertion(slug, task_id)

start_task arguments:

acts_forstr | None
The app user the agent works for. Omit for an agent acting on its own.
actionslist[str] | None
Permission slugs the task may use, for example ["invoice:read"]. None means everything the agent and the person may do; an empty list means nothing.
resourceslist[str] | None
Resources the task may touch, for example ["invoice:42"]. Same None and empty-list rule.
requesterdict | None
Who asked, for example {"email": ..., "phone": ..., "name": ...}.
ttlint | None
Task lifetime in seconds. Sent as ttl_seconds.
refstr | None
Your reference, such as a conversation id.
parent_task_idstr | None
The task that started this one (a sub-agent).

The answer carries the task token once, in token. Give it to the agent process. Never put it in a prompt or tool result.

  • tasks(slug, status="open") lists live tasks only.
  • complete_task and revoke_task end a task.
  • assertion returns the delegation as a signed JWT: sub is the person, act is the agent chain (RFC 8693).

Checking tool calls#

The task token is what the agent uses for its checks, verification of the person and approvals. In Python, the harness does this: it mints the task on first use (with the secret) or runs on a token your backend minted:

from scute.harness import Harnesstask = scute.agents.start_task("support-bot", acts_for=user_id, actions=["invoice:read"], ttl=300)run = Harness(agent="support-bot").run(token=task["token"])