Harness

Verify the person

Send the person a code or a push from inside the run, pass on the code they read out, and let the next check go through.

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#

  1. 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).

  2. 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.

  3. 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#

MethodWhat the person gets
email_otpA code by email
sms_otpA code by text message
totpThe code in their authenticator app
backup_codeOne of their backup codes
entra_pushA Microsoft Authenticator request
pushA request on their phone
magic_linkA 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#

FieldMeaning
tokenThe challenge token; the run keeps it as the pending verification
statuspending, completed, expired, denied, failed or cancelled
methodThe method used
expires_atWhen the challenge expires
remaining_attemptsCode attempts left, while pending
errorWhy the last code was refused
sayA 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.

CallEndpoint
StartPOST /v1/auth/:app_id/agent/verifications with method, permission, session_id
StatusGET /v1/auth/:app_id/agent/verifications/:token
Submit a codePOST /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.