Harness

Permissions guard

Ask Scute's engine whether the agent, the person it works for and the task all allow a tool call.

permissions sends each call to Scute's engine with the run's task token. The engine allows the call only if the agent's roles, the person the agent acts for (their roles, object roles, conditions, verification and approval rules) and the task's own limits all allow it. It is the default guard list when you pass none, and it always runs after every other guard.

guards.permissions({ fileRequests: true, context: (call) => ({ tier: call.tier }) });

Options#

modeenforce, monitor or observe
Overrides the harness mode for this guard.
fileRequests / file_requestsboolean
File a reviewer access request when the engine says a reviewer has to approve. Default true. Requests are only filed in enforce mode.
contextfunction
Extra context.* for policy conditions, per call. Merged with the run's context and the call's args.

What it sends#

For a call to refund_invoice({ invoice_id: "INV-1", amount: 90 }):

POST/v1/auth/:app_id/agent/checkTask token
{  "action": "refund",  "resource": { "type": "invoice", "key": "INV-1" },  "context": { "args": { "invoice_id": "INV-1", "amount": 90 } },  "session_id": "..."}

When no earlier guard stopped the call and the guard is in enforce mode, the request also carries the run's proofs: challenge (the completed verification for this permission), approval (the reviewer approval filed for this exact call) or plan (the run's approved plan), with details set to the arguments. These proofs are single-use, which is why this guard runs last.

Tools with no permission (tools: { name: false }) are not sent; the guard answers proceed.

Engine answers#

Engine decisionGuard decisionNotes
allowproceed
allow_with_step_upverifyverify.method and verify.permission come from the engine's step_up. See verify the person.
allow_with_approvalapprove (by reviewer)Files the request, see below
denydenyreason is the engine's reason (outside_task, budget_exceeded, ...); the message is the engine's explanation

The engine's say line goes into the verdict for the person.

Reviewer approvals#

When the engine answers allow_with_approval and fileRequests is on:

  1. The guard files a Scute access request for this exact call (POST /v1/auth/:app_id/agent/approvals). The arguments go with it as details, reviewers see them, and the request is tagged with the agent and task. Repeating the same call finds the open request instead of filing another.
  2. The verdict is approve with approve.requestId set and the request's say line ("I've asked for approval...").
  3. Once a reviewer approves, the next check of the same call sends the approval and goes through, once. A call with different arguments is a new request.

Details and the human side are on approvals.

Runs that end#

An engine answer with reason task_closed or budget_exceeded closes the run for good. See runs.

Failure#

If Scute cannot be reached, or the task cannot be started (no SCUTE_SECRET and no token), the guard throws and the call is denied with reason guard_error.