A lot of SaaS platforms today have AI agents using their APIs. Some were built in-house, some were created by customers, some came through integrations nobody fully reviewed.
The tooling to build an agent that calls your API, pulls data, and takes actions on behalf of a user is widely available and easy to use. What's not easy is knowing which agents are active, what credentials they're using, what they can access, and who's responsible for them.
That gap between agents showing up and teams having an identity story for them is what this post is about. Not "should you worry about AI agents" but "your agents are already here, and here's what identity management looks like when the client is an LLM powered application."
And that gap is growing. The number of agents calling SaaS APIs is increasing faster than most teams can track, and every week without an identity strategy is another week of credentials being issued with no review, no expiration, and no owner.
What AI Agent Identity Covers
When people say "agent authentication," they usually mean something broader than authentication alone. It helps to break it down into what's actually involved:
- Who is this agent? Refers to authentication. The agent proves its identity to an authorization server.
- What can it do? Refers to authorization. The agent receives scoped permissions for specific APIs and actions.
- How are its secrets managed? Credential lifecycle. Provisioning, rotation, expiration, revocation.
- What did it do? Auditing. Tracing actions back to the specific agent that performed them.
This matters because the credentials involved serve different purposes, and managing them requires different strategies.
Types of credentials
There are many ways to authenticate a client, some of the most common credential types are:
API keys are the simplest credential type. The agent presents a key directly to the API, which identifies the caller and grants access in a single step. Easy to set up, but they give you the least control: API keys are typically long-lived, unscoped, and don't separate identity from access.
Moving from API keys to OAuth2 access tokens gives you a more dynamic model that separates authentication from authorization using client secrets and access tokens.
Client secrets authenticate the agent to an authorization server (like Auth0 or Okta). A client secret is how the agent proves it is who it claims to be. The authorization server verifies the secret and, if valid, issues a token.
Access tokens are what the agent presents to an API to access resources. An access token doesn't authenticate the agent to the API. It proves that an authorization server already verified the agent's identity and granted specific permissions. Access tokens carry scopes (what the agent is allowed to do) and an expiration time.
How the agent gets an access token depends on whether it's acting as itself or on behalf of a user. The client credentials grant covers the first case: the agent authenticates with its client secret and gets a token scoped to its own permissions. No user involved. Delegated flows like the authorization code grant or the device code grant cover the second: the user authorizes the agent to act with specific scopes, and the resulting token represents the user's permissions, not the agent's.
Why Identity Management Is Harder with Agents
If these flows sound familiar, they should. They're the same ones any backend service would use. The identity challenges below aren't unique to agents either. Any machine client can have them.
The difference is the risk profile. When you have a traditional client application, you can make the same API calls for the same input, and you can audit its behavior by reading the source code. An agent decides at runtime which APIs to call based on LLM reasoning, picks tools dynamically from whatever's available, and can take completely different actions depending on the prompt. That non-determinism makes scoping, auditing, and credential management harder. On top of that, agents are getting deployed faster than traditional services, often by individual developers without the same infrastructure or security review.
The identity problems aren't new, but agents amplify each one:
- API key and client secret sprawl. One agent becomes ten, ten becomes a hundred. Each one has its own API key or client secret. Nobody has a complete list, and nobody's reviewing them on a regular cycle. Agents make this worse because they're being deployed faster and with less oversight than traditional services.
- Long-lived API keys as the default. Access tokens expire by design, but API keys typically don't. Teams default to API keys because they're simple, and those keys stick around far longer than they should. For an agent that decides at runtime which APIs to call, a long-lived, unscoped API key is an open-ended risk.
- Overprivileged access tokens. Scoping tokens correctly takes time. It's easier to request broad scopes and move on to the next task. With a traditional service, overprivileged tokens are a known, bounded risk because the service always calls the same endpoints. With an agent, you can't predict which tools it will use, so broad scopes mean a broader and less predictable attack surface.
- No audit trail that distinguishes agent from user. When an agent acts on behalf of a user, most systems log the client ID or the user's identity from the token, but not both in a way that tells you which agent made the decision. You can see that an action happened, but you can't easily trace whether the user did it directly or an agent did it on their behalf.
Each of these is manageable on its own but gets worse when combined. An agent with broad scopes, a long-lived API key, and no attribution in the logs is three problems stacked on top of each other.
Why SaaS Platforms Are More Exposed
If you're building a SaaS product, agents are already calling your API. And next quarter there will be more. A customer's sales agent pulls leads from your CRM API. A support automation reads and responds to tickets through your helpdesk API. A workflow agent chains your project management API with Slack and Google Calendar in a single execution.
Platforms like Salesforce, Zendesk, Jira, Stripe, Slack (any SaaS with a public API) are seeing agent traffic alongside human traffic. The difference is that SaaS platforms are multi-tenant, API-first, and designed for third-party integrations. That combination makes the agent identity problems above harder to manage, so let's analyse why:
You don't control the agents calling your API. Customers build their own agents, install marketplace integrations, and chain third-party tools into your API. You define the OAuth scopes and issue the credentials, but you don't control how many agents use each credential, how customers store their secrets, or whether they rotate them. A customer might create one OAuth client and share that client secret across five different agents built by different teams.
Multi-tenancy raises the stakes. A badly scoped access token in a single-tenant app is a contained problem. In multi-tenant SaaS, it has a wider blast radius. If a customer's agent credential is compromised or overprivileged, the damage can cross tenant boundaries if your authorization layer doesn't enforce isolation at every request.
APIs are the surface area. SaaS products expose broad APIs because that's the product. Developers integrate against them, build automations on top of them, and now point agents at them. A platform like Stripe might expose payment, customer, subscription, and reporting endpoints, but if there's an agent that only needs to read invoice status but has a token scoped to the full API, then it can do a lot more than intended.
Every customer multiplies the agent count. Ten customers with three agents each is thirty sets of credentials to track and scope. You can see the credentials you issued, but you can't see how many agents are behind each one or what those agents are doing. That visibility gap scales with your customer base.
What to Do About It
- Audit what you have. List every credential issued to agents working on their own behalf that are calling your APIs. In Auth0, check the Applications page for M2M clients, where you can see each one's authorized APIs and scopes. In your API gateway, look for active API keys with no expiration or generic names. If you can't tell which credentials belong to agents versus other integrations, that's the first thing to fix.
- Move from API keys to OAuth. Replace long-lived API keys with short-lived access tokens issued through an authorization server. This gives you expiration, scoping, and revocation by default. For agents acting on behalf of users, Token Vault manages the delegated tokens from authorization code or device code flows, handling refresh and rotation so the agent never stores user credentials directly.
- Scope access to the task. Instead of requesting broad scopes upfront, scope permissions to the specific task the agent is performing. The agent gets permission to call the tools it needs for this task, and those permissions go away when the task is done. Fine-Grained Authorization and OpenFGA make this possible without building a custom authorization layer.
- Close the audit gap. When an agent acts on behalf of a user, your audit trail should capture both: which agent made the decision and which user's permissions it was using. The
client_id(which agent) and thesubclaim (which user) are both in the access token. Your API layer needs to extract and log them together on every request, not one or the other. - If you're a SaaS platform: enforce identity from your side. Don't rely on customers to manage their agents well. Require per-agent client registration so you can scope and revoke individually. Set maximum token lifetimes on your authorization server so even a poorly built agent gets tokens that expire. Monitor API call patterns by client ID. An agent making unexpected combinations of calls is a signal that scoping alone won't catch.
- Gate sensitive actions with human approval. High-stakes actions (purchases, data deletion, permission changes) should require explicit authorization from a person on a trusted device. Asynchronous Authorization enables this without breaking the agent's workflow.
If you're building agents or running a SaaS that agents connect to, the identity layer is no longer optional. It's the thing that determines whether your agents are an asset or a liability. Auth0 for AI Agents handles token management, fine-grained authorization, delegated access, and human-in-the-loop approval in one platform.
Thanks for reading!
Frequently Asked Questions
About the author

Carla Urrea Stabile
Staff Developer Advocate
I've been working as a software engineer since 2014, particularly as a backend engineer and doing system design. I consider myself a language-agnostic developer but if I had to choose, I like to work with Ruby and Python.
After realizing how fun it was to create content and share experiences with the developer community I made the switch to Developer Advocacy. I like to learn and work with new technologies.
When I'm not coding or creating content you could probably find me going on a bike ride, hiking, or just hanging out with my dog, Dasha.
