Impersonation ≠ Delegation: Don’t Let Agents Spoof Your Users

Jun 10, 2025

2 mins

Matt (Co-Founder and CEO)

One of the most dangerous traps in securing AI agents is confusing impersonation with delegation. It's tempting to grant an agent the full access of the user it's acting for, essentially allowing it to "impersonate" the user. This is a critical security flaw that can lead to catastrophic breaches. Understanding the difference—and implementing true delegation—is paramount.

The Problem with Impersonation (Giving Agents Full User Access)

When you let an agent "impersonate" a user, you're essentially handing over the user's keys to the kingdom. This typically manifests in a few ways:

  • Shared Credentials: Giving an agent the user's password or a long-lived, full-scope API key that belongs to the user.

  • User Session Reuse: Allowing the agent to hijack or directly use an active user session.

  • Overly Permissive Service Accounts: Creating a service account for the agent and linking it to a user, but giving that service account all of the user's permissions.

Here's why this is so dangerous:

  • Massive Blast Radius: If an impersonating agent is compromised, the attacker gains all the permissions of the impersonated user. This means access to sensitive data, financial accounts, administrative functions, and more, far beyond what the agent actually needed for its task.

  • Audit Trail Obscurity: In your logs, every action performed by the agent will look like it was performed directly by the user. This makes it incredibly difficult to audit, trace back unauthorized actions, or comply with security regulations.

  • Bypassed Security Controls: If your user has MFA, IP restrictions, or other security policies, an impersonating agent might bypass these if it's using a pre-authenticated session or a powerful, static token.

  • Loss of User Control: Users have no granular control over what specific actions the agent performs, only whether it can act "as them" at all.

What Secure Delegation Really Looks Like

Delegation, in contrast, is about granting an agent specific, constrained authority to perform defined actions on a user's behalf, for a limited time, and with full auditability. It's like giving someone a specific key to open only one specific door, rather than giving them your entire keyring.

Here's how to achieve secure delegation:

1. Explicit, Granular User Consent

The user must explicitly authorize the agent for specific tasks or goals, not just generally "act on my behalf." This consent defines the initial scope of delegation. Think: "Allow Agent X to send emails about my recent order for the next 24 hours," not just "Allow Agent X to send emails."

2. Agent Identity as a First-Class Citizen

The agent itself must have its own distinct, auditable identity (as discussed in "Agent Identity 101"). When an action occurs, the audit log should clearly show: User Y delegated to Agent Z, which performed Action A. This allows for clear accountability.

3. Purpose-Bound (Intent-Based) Authorization

The agent's access should be tied directly to the purpose or intent of the delegated task. If the user asked the agent to "summarize my unread emails," the agent gets read access to emails. It does not get access to send emails, delete them, or access other data. This requires a robust policy engine that can evaluate requests against the user's original intent.

4. Least Privilege and Dynamic Scoping

Agents should always operate with the absolute minimum privileges required for the current action. Permissions should be dynamically granted and revoked as the agent progresses through its task, rather than being static and overly broad.

5. Short-Lived, Non-Transferable Credentials

The credentials an agent uses should be:

  • Short-lived: Expire after a very brief period (minutes or seconds).

  • Single-use (where possible): For sensitive operations, credentials might be valid for only one API call.

  • Non-transferable: Designed so they cannot easily be passed around or hijacked by other processes or attackers.

6. Comprehensive Audit Trails

Every action performed by an agent must be logged, explicitly linking the agent's identity, the user who delegated, the specific delegated intent, and the outcome of the action. This ensures that you can always trace back who authorized what action by which agent.

By understanding that impersonation is a security anti-pattern and embracing true, constrained delegation, you can unlock the power of AI agents while maintaining robust security and user control.