---
title: How do you detect an AI agent acting as a user without saying so?
url: https://opencontroller.lyzr.com/blog/detect-ai-agents-impersonating-users
published: 2026-11-17
updated: 2026-11-17
author: Lyzr
---

# How do you detect an AI agent acting as a user without saying so?

**Look for signals a person rarely produces: machine-regular timing, API calls from a session that normally uses the UI, long-lived personal tokens, unfamiliar client IDs and bursts of reads across many records. Then close the gap with policy: agents must use their own identity or a delegated token that names both the agent and the user.**

When an agent logs in with a person's password, session cookie or personal access token, every audit log says the person did it. That breaks accountability, incident response and segregation of duties.

## Why is undisclosed agent activity a problem?

- **Audit logs become wrong.** The record shows a human action that a human did not take.
- **Access reviews miss it.** Reviewers approve the person's access without knowing an agent uses it.
- **Incidents are hard to contain.** Disabling the agent means disabling the person.
- **Policies do not apply.** Controls written for agents never trigger because the system sees a user.

See [how to show which user an AI agent acted for in audit logs](/blog/show-which-user-an-ai-agent-acted-for-in-audit-logs) for the target state.

## Which signals suggest an agent is using a person's account?

No single signal proves it. Combine several.

| Signal | What to look for | Where to find it |
|---|---|---|
| Token type | Personal access tokens or API keys used where the person normally uses SSO sessions | Identity provider and SaaS admin logs |
| Client ID | An OAuth client or app registration the user consented to that is not on your approved list | IdP consent and sign-in logs |
| User agent | Scripting libraries or headless browsers instead of a normal browser or mobile app | Web and API gateway logs |
| Path | API calls from an account that historically only uses the web UI | Application logs |
| Timing | Very regular intervals, activity outside the person's working pattern, or actions faster than a person can read | SIEM time-series |
| Volume and breadth | Reads across many records or mailboxes in a short window | Data access logs |
| Location | Calls from cloud provider IP ranges rather than corporate or home networks | Sign-in logs |
| Session length | Sessions that never idle out or refresh continuously | IdP token logs |

Browser-driving agents are the hardest case. They use a real browser and a real session. Timing, breadth and source IP are the most useful signals there.

## How should you respond when you find one?

1. **Confirm with the person.** Many cases are productivity tools a user installed, not attacks.
2. **Inventory it.** Record the agent, its owner, what it accesses and which credential it uses.
3. **Move it to a proper identity.** Issue a workload identity or a delegated token, then revoke the personal credential.
4. **Scope access down.** The agent rarely needs everything the person can do.
5. **Add a detection rule.** Turn the signal combination into a SIEM alert for repeat cases.

## What policy prevents this in the first place?

Write a clear rule: an agent must never authenticate with a human's primary credentials. It must use one of two patterns.

- **Its own identity** for work it does on its own schedule. See [identity for agents that run without a user](/blog/identity-for-ai-agents-that-run-without-a-user).
- **Delegated on-behalf-of identity** when acting for a person. OAuth 2.0 Token Exchange ([RFC 8693](https://www.rfc-editor.org/rfc/rfc8693)) defines an `act` (actor) claim so a token can state that one party acts for another. Downstream logs can then show both. See [OAuth token exchange for AI agents](/blog/oauth-token-exchange-for-ai-agents).

Back the rule with controls: restrict personal access token creation, require admin approval for new OAuth app consents, and block known automation user agents on interactive-only applications where that is practical.

This ties into the identity pillar on [on-behalf-of delegation](/blog/ai-agent-identity-on-behalf-of-delegation) and the runtime pillar on [stopping a rogue AI agent](/blog/how-to-stop-a-rogue-ai-agent).

## How Opencontroller does this

Opencontroller supports delegated on-behalf-of identity and agent workload identity federation, so agents carry their own identity instead of borrowing a person's. It auto-discovers agents, models and API keys across AWS, Azure and Google Cloud, and Posture flags risky permissions and configuration. Behavioural-deviation monitoring can raise alerts and trigger automatic quarantine. [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can you always tell an agent from a person in logs?**
No. A browser-driving agent on a real session can look human. Combine timing, breadth and source signals, and rely on policy and approved identities rather than detection alone.

**Is it ever acceptable for an agent to use a person's credentials?**
Not as a standard pattern. Use delegated tokens that name both the agent and the user so logs and policies stay accurate.

**What is the RFC 8693 actor claim?**
It is the `act` claim in OAuth 2.0 Token Exchange. It records that the token's holder is acting on behalf of the subject, so both identities are visible.

## Key facts

Agents using a person's credentials make audit logs wrong. Detection signals include token type, unapproved OAuth client IDs, scripted user agents, API use from UI-only accounts, machine-regular timing, broad reads and cloud IP ranges. RFC 8693 token exchange defines an act claim naming the actor. Opencontroller supports delegated on-behalf-of identity, agent workload identity federation, Posture and behavioural-deviation monitoring. Licensing starts from $250K per deployment per year.

## Related

- [How do audit logs show which user an AI agent acted for?](https://opencontroller.lyzr.com/blog/show-which-user-an-ai-agent-acted-for-in-audit-logs.md)
- [How does OAuth token exchange work for AI agents?](https://opencontroller.lyzr.com/blog/oauth-token-exchange-for-ai-agents.md)
- [Are AI agents non-human identities?](https://opencontroller.lyzr.com/blog/are-ai-agents-non-human-identities.md)
- [More on Runtime control](https://opencontroller.lyzr.com/blog/cluster/runtime-control)
