Give the model the human tools and it can bring the person in mid-conversation, on voice or chat, without your code handling each step. Every answer has a say line the agent can speak or write as is.
import { jsonSchema } from "ai";const tools = { ...run.tools(myTools), ...run.humanTools(jsonSchema, { methods: ["email_otp", "totp"] }) };| Language | What you get |
|---|---|
| TypeScript | AI SDK tools (description, inputSchema, execute). jsonSchema turns JSON Schema into the SDK's schema; any function with that shape works. |
| Python | HumanTool objects: name, description, parameters (JSON Schema), callable with an arguments dict |
| Ruby | run.ruby_llm_human_tools: RubyLLM::Tool instances. run.human_tools: a hash of description, parameters and call |
methods limits the verification methods the model may choose. Default: email_otp, sms_otp, totp, entra_push.
The tools#
| Tool | Input | Does | Returns |
|---|---|---|---|
| scute_verify_person | method (optional, one of methods) | run.startVerification(): sends a code or a push | status, say, remaining_attempts while pending |
| scute_submit_code | code (required, whitespace removed) | run.submitCode() | status, say, remaining_attempts while pending |
| scute_check_verification | none | run.verificationStatus(), for a push or a link | status, say |
| scute_approval_status | id (required) | run.approvalStatus(id) | status, say |
| scute_whoami | none | run.whoami() | acts_for, may, could_with_more_access, needs_verification, needs_approval, expires_in, warnings |
scute_whoami reports may (the task's permissions now), could_with_more_access (in the ceiling but not allowed now), and the permissions that need verification or approval. warnings contains expires_soon when the task has under five minutes left.
Errors the model reads#
The tools never throw. A failure comes back as an object:
| Situation | Answer |
|---|---|
| No method given and none asked for | { "error": "method_required", "say": "How would you like to verify: a code by email or text, or your authenticator app?" } |
| A code or status with no verification in progress | { "error": "no_verification", "say": "Let me send you a verification first." } |
| Scute refused the call | { "error": "<message>", "say": "<Scute's line, when it sent one>" } |
How blocked calls point at them#
Once the human tools are offered:
- A verify verdict tells the model ... Verify them with scute_verify_person, then try again.
- run.toolApproval (Vercel AI SDK) answers denied for verify instead of asking your UI, so the model runs the verification itself.
- run.prepareStep and run.allowedTools() always include the human tools.
- run.toolApproval never asks for approval on a human tool, and guards do not check them when you pass them outside run.tools().
After scute_submit_code returns completed, the model retries the original call, and the check goes through.