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#
| Language | Package | Entry point |
|---|---|---|
| TypeScript | @scute/harness (0.2.0-next.2, Node 18+) | createHarness, guards |
| Python | scute (3.10+) | scute.harness.Harness, scute.harness.guards |
| Ruby | scute gem (Ruby 3.2+) | Scute::Harness, Scute::Guards |
Install#
npm install @scute/harness@nextThe 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.
| Variable | Use | Default |
|---|---|---|
| SCUTE_APP_ID | The app the agent belongs to | Required |
| SCUTE_SECRET | Starts and closes tasks | Required unless the run gets a task token |
| SCUTE_BASE_URL | API host | https://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:
- refund_invoice maps to the permission invoice:refund on the object invoice:INV-1 (tool mapping).
- The run starts a Scute task on first use, acting for USER_ID and limited to the two listed actions (runs).
- approval sees a high tier tool the person has not confirmed and answers approve.
- permissions runs last and asks Scute's engine.
- 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).