Available in TypeScript and Ruby. The Python harness has no plan or preview methods.
Plans#
When the agent knows its steps up front, it files them once and a reviewer approves the whole plan instead of each call.
const plan = await run.requestPlan( [ { tool: "refund_invoice", args: { invoice_id: 1, amount: 40 } }, { tool: "refund_invoice", args: { invoice_id: 2, amount: 15 } }, ], "Two refunds for ticket 88");// plan.status: "pending"; plan.say for the person// plan.steps: [{ permission: "invoice:refund", resource: "invoice:1", details: {...}, needs: "approval" }, ...]What Scute does with it#
/v1/auth/:app_id/agent/plansTask token- Each call becomes a step with the action, object, context.args and details (the arguments), mapped like any tool call. Tools with no permission are left out.
- Scute checks every step now, as a dry run. A step the engine denies fails the whole plan with step_not_permitted (403), naming the step.
- Each step gets needs: approval (goes to the reviewer), verify (the person verifies at run time) or none.
- If no step needs approval, nothing is filed: the answer has status not_needed, no id, and the steps.
- Otherwise Scute files one plan for review, and the run remembers its id.
A plan has 1 to 20 steps. The run must act for someone.
Running the plan#
Once the plan is approved, run the calls through the usual checks (run.check, run.tools, run.wrap). When a call has no approval of its own filed, the check sends the run's plan id; the step matching the exact call supplies the approval. Each step runs once, with exactly those arguments. A call with other arguments is not covered.
Steps that need verify still need the person to verify when the call is made. See verify the person.
Plan status#
const status = await run.planStatus(); // undefined when the run has no planReturns id, status, say and steps, each step with used: true once it ran. Plan statuses are those of approvals except verify_first: pending, approved, denied, cancelled, expired, used, not_needed.
Previews#
preview asks what a call would need right now: a dry run of the engine check.
const decision = await run.preview("refund_invoice", { invoice_id: "INV-1", amount: 90 });// { decision: "allow_with_step_up", reason: "...", step_up: { method: "email_otp", ... }, dry_run: true }- It sends dry_run: true to POST /v1/auth/:app_id/agent/check. Scute logs it with via: "agent_dry_run".
- It does not count toward budgets, does not use up a verification or approval, and sends no proofs or session.
- It runs no harness guards: it is the engine's answer only.
- A tool with no permission returns allow with reason no_permission without calling Scute.
Use it to show the person, before the agent starts, which steps will need them.