Harness

Agent harness

Wrap the tool calls of an agent you build in Scute guards, in TypeScript, Python or Ruby.

The harness sits between your agent and its tools. Before a tool runs, a list of guards looks at the call (tool name and arguments) and decides whether it runs, runs with other arguments, waits for a person, or is refused. After it runs, guards can redact or withhold the result before the model reads it. The harness hooks the tool calls, not the model, so it works with any model provider and any agent loop.

The main guard, permissions, asks Scute's engine. A call goes through only if the agent's roles, the person the agent works for, and the current task all allow it. The registry, task tokens and monitors behind that check are described under Agents.

Packages#

LanguagePackageEntry point
TypeScript@scute/harness (0.2.0-next.2, Node 18+)createHarness, guards
Pythonscute (3.10+)scute.harness.Harness, scute.harness.guards
Rubyscute gem (Ruby 3.2+)Scute::Harness, Scute::Guards

Install#

npm install @scute/harness@next

The TypeScript package is a prerelease published under the next tag. The Python package and the Ruby gem are installed from GitHub; the harness ships inside them.

Credentials#

Set these on the server that runs the agent. Neither value ever reaches the model.

VariableUseDefault
SCUTE_APP_IDThe app the agent belongs toRequired
SCUTE_SECRETStarts and closes tasksRequired unless the run gets a task token
SCUTE_BASE_URLAPI hosthttps://api.scute.io

Register the agent in Scute first, with an owner and roles. The harness refers to it by its slug.

Minimal example#

import { createHarness, guards } from "@scute/harness";const harness = createHarness({  agent: "support-bot",  guards: [guards.approval(), guards.permissions()],  tools: { refund_invoice: { tier: "high" } },});const run = harness.run({  id: "chat-123",  actsFor: "USER_ID",  task: { actions: ["invoice:read", "invoice:refund"] },});const refund = run.wrap("refund_invoice", async (args: { invoice_id: string; amount: number }) => {  return { refunded: args.invoice_id, amount: args.amount };});console.log(await refund({ invoice_id: "INV-1", amount: 90 }));

What happens on the call:

  1. refund_invoice maps to the permission invoice:refund on the object invoice:INV-1 (tool mapping).
  2. The run starts a Scute task on first use, acting for USER_ID and limited to the two listed actions (runs).
  3. approval sees a high tier tool the person has not confirmed and answers approve.
  4. permissions runs last and asks Scute's engine.
  5. The strictest answer wins. If the engine allows the call, the winner is approve: the wrapped function does not run, and refund returns the message for the model, Confirm: refund_invoice (invoice_id INV-1, amount 90) Ask them to confirm, then try again. If the engine denies it, deny wins and the message starts with Not allowed:.

Once the person confirms in your UI, call run.confirm("refund_invoice", args) with the same arguments and the next identical call goes through once (approvals).

Where to go next#

How a call is decided
Decision values, ranking and modes.
Guards
One page per built-in guard.
Vercel AI SDK
Tools, approvals and step control for AI SDK v7.
Any agent loop
check, after and wrap.
People in the loop
Verification, confirmation and reviewer approval.
Language differences
What each SDK has.