Skip to content

Interview question · Guardrails, Identity & Policy

An agent acts for Alice but must not inherit everything Alice can do. Design the delegation.

Alice's permissions are the ceiling, not the grant. The agent gets the overlap of what Alice can do, what this agent may ever do and what this task needs, as a short-lived credential naming both of them.

hardEssentialNewUpdated Nov 2026

TL;DR: Give the agent its own identity and a role that caps what any instance may do. For each task, have the identity system issue a short-lived delegated token whose permissions are the intersection of Alice's rights, the agent role and the task's needs, naming Alice as the subject and the agent as the actor. Services check the token and the resource per call. Escalation within a task (needing a right outside the grant) goes back to Alice for consent or to policy, never silently widened. Delegations are revocable, expire with the task, and every action is logged with both identities.

How to approach it

Show why both obvious options fail, then define the intersection, the credential, step-up for more rights, revocation and audit.

A strong answer

Why not Alice's own session? The agent would hold everything Alice can do: approving payments, changing payroll, exporting data. A task about summarising expenses would carry all of it, and anything that steers the agent inherits it.

Why not a service account? It usually exceeds Alice: every employee's data, every action. Services then filter by user in their own code, which is the confused-deputy design.

The intersection. Effective rights = Alice's rights ∩ agent role ∩ task scope. The agent role is the most any instance of this agent may do (an expense assistant can read expenses and receipts and draft comments; it can never approve). The task scope is what this request needs. The result is often one or two permissions.

The credential. Issued by the identity system through a token exchange: subject Alice, actor the expense agent, scopes from the intersection, audience the expense service, lifetime the task's expected length. The agent never sees Alice's own token.

Per-call checks. Services authorize each call against the token and the resource (Alice's department's expenses only), and a policy engine applies business rules.

Step-up. If the task turns out to need more (Alice asks the agent to also file a correction), the agent requests the extra scope through the host; policy checks it is within the agent role; Alice consents; a new token is issued. Anything outside the agent role is refused, whoever consents.

def delegate(user_perms, role_max, task_needs):
    granted = user_perms & role_max & task_needs
    refused = sorted(task_needs - granted)
    return sorted(granted), refused

alice = {"expenses:read", "expenses:approve", "payroll:write", "reports:file"}
role = {"expenses:read", "receipts:read", "reports:file"}
print(delegate(alice, role, {"expenses:read"}))  # => (['expenses:read'], [])
granted, refused = delegate(alice, role, {"expenses:read", "expenses:approve"})
print(granted, refused)  # => ['expenses:read'] ['expenses:approve']

Approving is Alice's right but outside the agent's role, so it is refused even though she asked; she approves herself.

Revocation and audit. Each delegation has an id; revoking it (task done, Alice cancels, incident) kills the agent's tokens without touching Alice's sessions. Logs record subject, actor, delegation id and the policy decision for every action.

What interviewers probe next

"Alice is offline and the task runs overnight." The delegation's lifetime covers the task; step-ups wait for her or expire. Nothing widens while she is away.

"What if the agent calls another agent?" The sub-agent receives a further-narrowed delegation: the intersection again, with the calling agent recorded in the chain.

"How do you define agent roles?" Like any service role: reviewed, least privilege, owned by the team that runs the agent, with changes going through the same review as other access changes.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

Alice's expense agent receives a delegated token for expenses:read only.

  1. Start here

    What if Alice loses her finance role mid-task?

How it's scored

Weak: The agent uses Alice's session or a service account.

Hire: Delegated, scoped, short-lived tokens with least privilege.

Strong Hire: Rejects both obvious options with reasons, defines the three-way intersection with an agent role as a hard cap, issues tokens by exchange naming subject and actor, checks per call, handles step-up within the role with consent, narrows further for sub-agents, revokes on role changes, and logs both identities.

Common mistakes

  • Treating the user's permissions as the agent's grant.
  • No agent role, so the cap is whatever the user has.
  • Widening scopes silently when a task needs more.
  • Audit logs that cannot tell the agent from the user.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.