Harness

Tools and permissions

How a tool name becomes a Scute permission and object, and how to override it per tool with the tools map.

Every tool the agent calls maps to a permission in Scute and, usually, an object. permissions asks the engine about that permission on that object.

The naming convention#

The first word of the tool name is the action; the rest is the resource type. Camel case is split into words.

Tool namePermissionAction sent to the engineResource type
refund_invoiceinvoice:refundrefundinvoice
resetUserMfauser_mfa:resetresetuser_mfa
searchsearchsearchnone

A tool name with no letters or digits is still checked (and denied as an unknown permission), never skipped. TypeScript exports the function as toolPermission(name), Python as permission_for(name), Ruby as Scute::Harness::ToolSpec.permission_for(name).

The object#

For a permission with a resource type, the harness looks for the object's key in the arguments, in this order:

  1. <type>_id (invoice_id)
  2. <type>Id in camel case (invoiceId)
  3. id

The first non-empty string or finite number wins. refund_invoice({ invoice_id: "INV-1" }) is checked as invoice:refund on invoice:INV-1. Without a key, the check is on the type alone (invoice).

Arguments go as context, not attributes#

The full arguments reach the engine as context.args, so a policy condition can read them (context.args.amount < 500). They never become the object's attributes: the object's attributes come from what Scute stores for it, which the model cannot override. Use the attributes option below to pass attributes from arguments on purpose; Scute's stored attributes still win.

Run-wide values in the run's context option, and per-call values from permissions({ context }), are merged into context too.

The tools map#

Override the convention per tool. Every field is optional.

createHarness({  agent: "support-bot",  tools: {    send_money: { permission: "payment:create", key: "to", tier: "high" },    refund_invoice: { tier: "high", attributes: (args) => ({ currency: args.currency }) },    get_weather: false, // no permission check  },  defaultTier: "low",});
permissionstring or false
The permission this tool needs. Default: from the name. false: no permission check, the tool passes permissions untouched.
tierlow, medium or high
How much the tool can hurt. Guards select on it (approval defaults to high) and budget can count per tier. Default: the harness defaultTier (default_tier), which defaults to low.
keystring
The argument that names the object. Default: the type followed by _id, the camel-case type followed by Id, then id.
attributesfunction
Arguments to object attributes for policy conditions. Off by default. Attributes Scute stores for the object win over these.
resourcefunction
Build the whole resource yourself: arguments in, type, key and attributes out. Overrides key and attributes.

Setting the tool to false instead of a map is the same as permission: false.

Tiers#

The harness has three tiers: low, medium and high. A tool's tier only matters to guards that read it:

  • approval asks the person to confirm high tier calls unless you pass another when.
  • budget with perHour as a map counts executions per tier.
  • when: { tier: ... } on verifyPerson, approval, requesterOnly and grounding selects calls by tier.

In Ruby, tiers are symbols (:high); in Python, strings.