---
title: What identity should an AI agent use when no user is present?
url: https://opencontroller.lyzr.com/blog/identity-for-ai-agents-that-run-without-a-user
published: 2026-11-16
updated: 2026-11-16
author: Lyzr
---

# What identity should an AI agent use when no user is present?

**An AI agent that runs with no user in the loop should authenticate as itself: a dedicated workload identity, with narrow scopes and a named human owner. It should never borrow the builder's account, a personal access token or a shared service account. Delegated "on-behalf-of" identity only applies when a real person started the task.**

Many agents never see a user. A nightly reconciliation agent, a ticket-triage agent fired by a webhook, a queue worker that summarises documents: each acts with nobody signed in. These are the agents most likely to end up running on whatever credential was handy when someone first built them.

## What are the two identity modes for AI agents?

Every agent action falls into one of two modes. Getting the mode right decides which credential to use.

- **Delegated mode.** A user asked for something. The agent acts for that user and should carry the user's identity, narrowed to the task. Token exchange (IETF RFC 8693) is the standard way to turn the user's token into a scoped token for the agent. See [on-behalf-of delegation](/blog/ai-agent-identity-on-behalf-of-delegation).
- **Autonomous mode.** No user started the action. A schedule, an event or another system did. The agent acts as itself and needs its own identity.

Many agents do both. A support agent may answer a customer's chat in delegated mode, then run a nightly clean-up job in autonomous mode. Treat these as two identities, or at least two clearly separated sets of scopes, so the audit log shows which mode applied.

## Which credential should an autonomous agent use?

The choice depends on where the agent runs. The table below orders options from strongest to weakest.

| Option | How it works | Long-lived secret? | Use when |
|---|---|---|---|
| Cloud workload identity federation | Platform-issued token (AWS IAM role, Azure managed identity, Google Cloud service account via federation) | No | Agent runs on a cloud platform or Kubernetes |
| SPIFFE / SPIRE workload ID | Short-lived X.509 or JWT SVID tied to the workload | No | Multi-cloud or on-premises workloads |
| OAuth 2.0 client credentials with certificate | Agent authenticates as an OAuth client (RFC 6749 section 4.4) with a private key | Key, but not shared | SaaS APIs that only support client credentials |
| OAuth client credentials with secret | Same, with a client secret | Yes | Only when nothing better is supported; rotate often |
| Personal access token or user password | Agent pretends to be a person | Yes | Never |

Federation wins because there is nothing to leak. The runtime proves what it is, and the identity provider issues a short-lived token. Our guide to [workload identity federation for AI agents](/blog/workload-identity-federation-for-ai-agents) covers the setup per cloud.

## Why not use a shared service account?

A shared service account is the most common shortcut. It fails in four ways:

1. **No attribution.** Logs show "svc-ai" did something. You cannot tell which of ten agents it was.
2. **Union of permissions.** Each new agent adds scopes. The account ends up with everything every agent ever needed.
3. **All-or-nothing revocation.** Disabling one misbehaving agent breaks the other nine.
4. **No owner.** Nobody reviews an account that belongs to everyone.

One agent, one identity. If the platform makes that hard, at least give each agent its own credential under the shared principal and log the credential ID. More detail in [should AI agents share a service account?](/blog/should-ai-agents-share-a-service-account)

## How do you keep a human accountable for an autonomous agent?

An autonomous identity still needs a person behind it. Record these attributes on every agent identity:

- **Owner**: a named employee, resolved from your identity provider, not a free-text name.
- **Backup owner or team**: so the agent is not orphaned when one person leaves.
- **Purpose**: one sentence on what the agent is for, used to judge whether a scope is justified.
- **Trigger**: schedule, event source or upstream system.
- **Scopes and resources**: the exact APIs, data sets and tools it may touch.
- **Review date**: when the owner must re-confirm the agent is still needed.

When the owner is disabled in the identity provider, the agent should be flagged for reassignment, not silently keep running. See [what happens to AI agents when the owner leaves](/blog/what-happens-to-ai-agents-when-the-owner-leaves).

## Decision checklist: which identity for this action?

Use this checklist when reviewing an agent:

1. Did a specific user start this action in the last few minutes? If yes, use delegated identity with that user's permissions narrowed to the task.
2. Is the action triggered by a schedule, event or another system? If yes, use the agent's own workload identity.
3. Does the agent run on a platform that offers workload identity federation? If yes, use it and delete any static keys.
4. If a secret is unavoidable, is it stored outside the model's context, scoped to one agent and rotated on a schedule?
5. Does the identity have a named owner and a review date?
6. Can you revoke this one agent without affecting any other?

If any answer is no, fix that before the agent goes to production.

## How Opencontroller does this

Opencontroller supports agent workload identity federation for autonomous agents and delegated on-behalf-of identity for user-initiated actions, with OIDC SSO for people. Each agent sits in a governed registry with its owner, versions, tools and MCP servers. Posture flags risky permissions and configurations, and per-agent Block and Quarantine controls act through the connected platform, so one agent can be stopped without touching the others. For the wider model, see [what is an AI agent control plane](/blog/what-is-an-ai-agent-control-plane) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can an AI agent that runs overnight use the identity of the person who built it?**
It should not. Builder credentials outlive the builder's intent, break when they leave, and make audit logs show a human doing work they never saw.

**Is OAuth client credentials safe for autonomous AI agents?**
It is acceptable when the secret or key is kept outside the model context, rotated and narrowly scoped. Federated workload identity is better because there is no long-lived secret.

**Who is accountable when an autonomous AI agent acts with no user?**
The named owner recorded against the agent's identity. Review ownership in access reviews and reassign it when the owner leaves.

## Key facts

An AI agent that runs with no user session (scheduled jobs, event triggers, queue workers) should authenticate as its own workload identity, not as a person and not with a shared service account. Common mechanisms are cloud workload identity federation, OAuth 2.0 client credentials (RFC 6749 section 4.4) and SPIFFE IDs. Every autonomous agent identity needs a named human owner for accountability. Delegated on-behalf-of identity (RFC 8693 token exchange) applies only when a real user started the task. Opencontroller supports agent workload identity federation, delegated on-behalf-of identity and OIDC SSO, and keeps owners in a governed agent registry. Opencontroller pricing starts from $250K per deployment per year.

## Related

- [How does workload identity federation work for AI agents?](https://opencontroller.lyzr.com/blog/workload-identity-federation-for-ai-agents.md)
- [Should multiple AI agents share one service account?](https://opencontroller.lyzr.com/blog/should-ai-agents-share-a-service-account.md)
- [What happens to AI agents when their owner leaves the company?](https://opencontroller.lyzr.com/blog/what-happens-to-ai-agents-when-the-owner-leaves.md)
- [More on Agent identity and access](https://opencontroller.lyzr.com/blog/cluster/agent-identity-and-access)
