When a call answers verify (from permissions on a step-up permission, or from verifyPerson), the person the agent works for has to prove it is them. The run does this with the task token alone, so an agent process without SCUTE_SECRET can verify its person. The run must act for someone (actsFor).
Flow#
Start the verification
const verification = await run.startVerification({ verdict, method: "email_otp" });reply(verification.say); // "I've emailed a code to a***@example.com. What's the code?"The method is the first of: the method you pass, the method the verdict asked for, the verdict's methods. Without a verdict, the run uses the last verification a guard asked for. With no method anywhere, it fails (TypeScript ScuteHarnessError code method_required; Python ValueError; Ruby ArgumentError).
Pass on what the person did
For a code (email, text, authenticator app):
const result = await run.submitCode("123456");A wrong code does not throw: it comes back with status pending, remaining_attempts and a say line. For a push, poll run.verificationStatus() (Python and Ruby: verification_status) until the status is completed.
Check the call again
Once a verification is completed, the run records it: the time (for verifyPerson) and, when the verification named a permission, the completed challenge for that permission. The next check of that permission sends the challenge to the engine and goes through. The challenge is single-use and only sent on a call no other guard stopped.
Methods#
| Method | What the person gets |
|---|---|
| email_otp | A code by email |
| sms_otp | A code by text message |
| totp | The code in their authenticator app |
| backup_code | One of their backup codes |
| entra_push | A Microsoft Authenticator request |
| push | A request on their phone |
| magic_link | A sign-in link |
Scute accepts these methods for agent verifications; any other is refused with invalid_method. A method the person or the app cannot use is refused by the start call. If the verification names a permission, that permission must exist and the task must cover it (outside_task otherwise). A task can start at most 5 verifications per hour (too_many_verifications, 429).
Verification object#
| Field | Meaning |
|---|---|
| token | The challenge token; the run keeps it as the pending verification |
| status | pending, completed, expired, denied, failed or cancelled |
| method | The method used |
| expires_at | When the challenge expires |
| remaining_attempts | Code attempts left, while pending |
| error | Why the last code was refused |
| say | A line for the person, ready to speak or write |
A verification your backend started#
When your own app verified the person (for example in its UI), hand the completed challenge token to the run:
await run.completeVerification(challengeToken);Scute checks the challenge belongs to the person the task acts for, is completed and is fresh, then marks the run's session verified (POST /v1/auth/:app_id/agent/sessions/:id/verified). Called without a token, it completes the run's own pending verification and fails with not_verified (409) if it is not done yet.
Endpoints#
All with the task token as Authorization: Bearer.
| Call | Endpoint |
|---|---|
| Start | POST /v1/auth/:app_id/agent/verifications with method, permission, session_id |
| Status | GET /v1/auth/:app_id/agent/verifications/:token |
| Submit a code | POST /v1/auth/:app_id/agent/verifications/:token/code with code (422 with the verification body when the code is wrong) |
The run creates its session (POST /v1/auth/:app_id/agent/sessions) on the first verification and sends its id with every check after that.