verifyPerson (Python and Ruby: verify_person) answers verify until the person has completed a verification in this run within maxAge seconds. Use it for calls that need proof of who is on the other end even when the policy does not ask for step-up.
A permission marked as needing verification in Scute gets the same answer from permissions without this guard.
guards.verifyPerson({ when: { tools: ["change_email"] }, methods: ["email_otp", "sms_otp"], maxAge: 600 });Options#
whenobject or function
Which calls it applies to: tier (one or a list), tools (names), or a function of the call. Default: every call.
methodsstring list
Methods to offer, passed in the decision's verify.methods. run.startVerification() uses the first one when you do not name a method.
maxAge / max_agenumber
How recent the verification must be, in seconds. Default 900.
messagestring
What the model and person read. Default: The person has to verify it's them before this.
modeenforce, monitor or observe
Overrides the harness mode.
What counts as verified#
The run records the time of the last completed verification. It is set when:
- run.submitCode(code) returns status completed,
- run.verificationStatus() returns status completed (a push the person approved), or
- run.completeVerification(token) accepts a challenge your backend started.
The time lives in the run's state, so it carries across requests that reuse the run id. Starting the verification and the person's side of it are on verify the person.
Decision#
{ "kind": "verify", "reason": "verification_required", "message": "The person has to verify it's them before this.", "verify": { "permission": "email:change", "methods": ["email_otp", "sms_otp"] } }