Field names below are the TypeScript ones. Python and Ruby use snake case where it differs (call_id, request_id).
Decision#
What one guard answers. See how a call is decided.
| Field | Type | Meaning |
|---|---|---|
| kind | proceed, transform, approve, verify, guide, redirect, deny | The decision |
| reason | string | A short code for logs and tests |
| message | string | Words for the model (guide, deny, redirect) or the person (verify, approve) |
| say | string | A line for the person |
| args | object | transform: the arguments to run with |
| result | any | From an after-guard: what the model reads instead of the tool's result |
| verify | object | method, methods, permission |
| approve | object | by (user or reviewer), requestId |
| redirect | object | to |
| engine | object | Scute's engine decision behind it |
Python: scute.harness.Decision (a dataclass; an unknown kind raises ValueError). Ruby: Scute::Harness::Decision.new(kind:, ...) (an unknown kind raises ArgumentError).
Verdict#
What run.check() returns.
| Field | Meaning |
|---|---|
| kind | The final decision |
| decision | The winning guard's decision, with guard set to its name |
| args | The arguments to run with, transforms applied |
| message | For the model, when the call does not run |
| say | For the person, when there is something to tell them |
| results | Every guard's answer (GuardResult) |
| callId | The tool call id |
| tool | The tool name |
Python adds the property runs; Ruby adds runs?. Both are true for proceed and transform.
GuardResult#
| Field | Meaning |
|---|---|
| guard | The guard's name |
| mode | The mode it ran in |
| decision | Its answer |
| error | What it threw, when it threw |
Engine decision#
What POST /v1/auth/:app_id/agent/check returns, and what run.preview() returns.
| Field | Meaning |
|---|---|
| decision | allow, deny, allow_with_step_up or allow_with_approval |
| allowed | Whether it is a plain allow |
| reason | The engine's reason code |
| permission | The permission checked |
| roles | The roles that granted it |
| conditions | Conditions that applied |
| step_up | method, ttl, authorizes_action |
| approval | permission, resource |
| agent | agent, task, chain, roles |
| explanation | A sentence on why |
| say | A line for the person, when it is not a plain allow |
| dry_run | true on a preview |
Ruby preview returns it as an Authz::Decision.
Store#
| Method | Meaning |
|---|---|
| get(key) | The stored string, or null / None / nil |
| set(key, value, ttl) | Store a JSON string; ttl in seconds, optional |
TypeScript store methods return promises.
Verification#
Returned by startVerification, submitCode, verificationStatus: token, status (pending, completed, expired, denied, failed, cancelled), method, expires_at, remaining_attempts, error, say. Python and Ruby return it as a dict or hash with string keys.
Approval#
Returned by approvalStatus and filing: id (absent when nothing was filed), status (pending, approved, denied, cancelled, expired, used, not_needed, verify_first), details, permission, resource, expires_at, say.
Plan#
Returned by requestPlan and planStatus: id (absent when nothing needed approval), status (pending, approved, denied, cancelled, expired, used, not_needed), say, steps (each permission, resource, details, needs of none, approval or verify, and used).
Whoami#
See task tokens.
Errors#
| Language | Error | Fields |
|---|---|---|
| TypeScript | ScuteHarnessError | message, status, code, body (the API's answer) |
| Python | scute.APIError (Scute answered with an error), scute.ConfigurationError, ValueError | status, code, body on APIError |
| Ruby | Scute::APIError, Scute::ConfigurationError, ArgumentError | status, code, body on APIError |
Codes the harness itself produces:
| Code | Status | When | Python / Ruby |
|---|---|---|---|
| no_credentials | 401 | A task has to be started or closed without SCUTE_SECRET | ConfigurationError when starting a task |
| task_closed | 409 | The run's task was closed | APIError with the same code |
| method_required | 422 | startVerification without any method | ValueError / ArgumentError |
| no_challenge | 422 | submitCode, verificationStatus or completeVerification with no verification in progress | ValueError / ArgumentError |
| not_verified | 409 | completeVerification on a pending verification that is not done | APIError with the same code |
Codes from Scute that affect the run:
| Code | Status | Effect |
|---|---|---|
| invalid_task_token | 401 | The token is missing, expired or revoked. Before expiry, or on a token run, the run closes. |
| outside_task | 403 | A verification named a permission the task does not cover |
| too_many_verifications | 429 | More than 5 verifications started by the task in an hour |
| invalid_method | 422 | Unknown verification method |
| step_not_permitted | 403 | A plan step the engine denies |
| not_permitted | 403 | An approval asked for a call the engine denies |
Endpoints#
The harness calls these. Task endpoints use the app secret; agent endpoints use the task token as Authorization: Bearer.
| Endpoint | Credential | Used by |
|---|---|---|
| POST /v1/apps/:app_id/authz/agents/:agent/tasks | App secret | Starting a task |
| POST /v1/apps/:app_id/authz/agents/:agent/tasks/:id/complete | App secret | run.complete() |
| POST /v1/apps/:app_id/authz/agents/:agent/tasks/:id/revoke | App secret | run.revoke() |
| GET /v1/auth/:app_id/agent/whoami | Task token | run.whoami(), allowedTools, prepareStep |
| POST /v1/auth/:app_id/agent/check | Task token | permissions, run.preview() (dry_run: true) |
| POST /v1/auth/:app_id/agent/sessions | Task token | The run's session |
| POST /v1/auth/:app_id/agent/sessions/:id/verified | Task token | run.completeVerification(token) |
| POST /v1/auth/:app_id/agent/sessions/:id/end | Task token | complete, revoke |
| POST /v1/auth/:app_id/agent/verifications | Task token | run.startVerification() |
| GET /v1/auth/:app_id/agent/verifications/:token | Task token | run.verificationStatus() |
| POST /v1/auth/:app_id/agent/verifications/:token/code | Task token | run.submitCode() |
| POST /v1/auth/:app_id/agent/approvals | Task token | Reviewer requests |
| GET /v1/auth/:app_id/agent/approvals/:id | Task token | run.approvalStatus() |
| POST /v1/auth/:app_id/agent/plans | Task token | run.requestPlan() |
| GET /v1/auth/:app_id/agent/plans/:id | Task token | run.planStatus() |
| POST /v1/auth/:app_id/agent/tools | Task token | run.reportTools() |
| POST /v1/auth/:app_id/agent/decoys | Task token | decoy |
| GET /v1/auth/:app_id/agent/properties/:name | Task token | run.property() |
| POST /v1/auth/:app_id/agent/properties/:name/sign | Task token | run.sign() |
All requests and answers are JSON. The base URL is https://api.scute.io unless baseUrl (SCUTE_BASE_URL) says otherwise.