requesterOnly (Python and Ruby: requester_only) checks that an argument naming a person (an email, a phone number, a user id) belongs to the person asking. A helpdesk agent that resets MFA for "the caller" cannot be talked into resetting it for someone else.
guards.requesterOnly({ arg: ["email", "phone"], when: { tools: ["reset_mfa"] } });Options#
Who counts as the requester#
The run's known identities, compared case-insensitively:
- every value of the run's requester option (email, phone, app_user_id, name), and
- every value added with run.identify(...), for example the caller's email once they verified.
const run = harness.run({ id: call.id, requester: { phone: "+14155550123" } });run.identify("ada@example.com");Identities also count as grounded values for grounding. Values added with identify live in the run object in memory, not in the store: add them again on each request.
Decisions#
The guard skips arguments that are missing or empty. For each checked argument:
| Situation | Decision | Reason | Message |
|---|---|---|---|
| The run knows no identities | deny | requester_unknown | I can't tell who is asking, so I can't act on a specific person yet. |
| The value is not one of them | deny | not_requester | This can only be done for the person asking, not for <value>. |
| The value matches | proceed |
It fails closed: with no known requester, any call that names a person is refused.