Harness

Requester only

Let the agent act only on the person who asked, by matching an argument against the requester's identity.

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#

argstring or list
The arguments to check. Default email.
whenobject or function
Which calls it applies to. Default: every call.
modeenforce, monitor or observe
Overrides the harness mode.

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:

SituationDecisionReasonMessage
The run knows no identitiesdenyrequester_unknownI can't tell who is asking, so I can't act on a specific person yet.
The value is not one of themdenynot_requesterThis can only be done for the person asking, not for <value>.
The value matchesproceed

It fails closed: with no known requester, any call that names a person is refused.