Non-Human Identity Security for AI Agents: Why Intent-Based Access and Behavior Controls Are the Missing Layer

In November 2026, Cursor reported that an attacker had used a single access key, issued to its inference vendor Fireworks AI and exposed there, to copy historical coding-agent traces. Some of those traces contained unredacted credentials, which gave the attacker access to internal tools and, from there, the ability to publish a tampered Claude Code extension to Cursor's marketplace. Every step in that chain used a credential that was valid at the time. The Cursor security incident shows how much access non-human identities carry in AI development environments, and how little checks they make once they are issued.
Security teams have spent years bringing non-human identities under control. Service accounts, API keys and OAuth tokens were inventoried and scoped to least privilege, with credentials rotated on a schedule. The approach worked because the workloads behind those identities were predictable. A service account running a nightly backup does the same thing every night, so deciding what it may access is the same as deciding what it will do.
AI agents were brought under the same approach. They were given service accounts and tokens of their own, or they borrowed the credentials of the employee running them, and they appeared in the identity provider next to every other machine identity.
That approach assumes a workload behaves the same way every time it runs, and agents do not. An agent decides at runtime which of its permitted actions to take, and that decision is shaped by the documents and tool results it reads along the way. Two runs with the same credentials can produce different actions. An agent's identity can be scoped and rotated correctly, and the agent can still do something nobody intended.
Closing that gap takes a control that evaluates what the agent does, in addition to what it is allowed to do.
The Role of Identity in Agentic Systems
An identity system has to answer four questions about any agent:
- Who owns it?
- What can it reach?
- On whose behalf it is acting?
- When, and in which sequence of actions, is an approved action no longer legitimate?
Existing identity controls answer the first three. They have no answer to the fourth, and it is the one that matters most for agents because the same action can be routine in one task and malicious in another.
Agents get their access in a few ways. A coding agent or desktop assistant usually runs with the permissions of the employee who launched it, so it can read and change whatever that person can. An agent built by an engineering team typically runs under a service account or an OAuth client with scopes chosen at deployment. Either kind can then connect to MCP servers, skills and tools, and each connection carries its own credentials.
The result is a chain of delegation. A user authorizes an agent, the agent calls an MCP server, and the server calls a tool or an API. Each hop presents a valid identity. The downstream system sees an authenticated request and has no information about the task that produced it.
Where Identity Controls Fall Short for Agents
Access is decided once. Permissions are evaluated when a role is assigned or a token is issued. After that, every action inside the granted scope is allowed, and no control checks whether a given action belongs to the task the agent was given. The Cursor incident followed this pattern: the exposed vendor key and the credentials found in agent traces were accepted wherever they were presented, because each one was valid.
Agents are over-privileged by default. An agent that inherits a user's permissions holds far more access than any single task needs. A service account scoped at deployment tends to be scoped for every task the agent might ever perform.
Behavior changes while permissions stay the same. A prompt injection in a retrieved document or a poisoned tool response can redirect an agent in the middle of a task. The agent's credentials are unchanged, so every action it takes after being redirected is still authorized.
Attribution gets lost across the chain. When an action reaches a mailbox or a database through several hops, the log shows the last identity in the chain. Tying the action back to the agent, the task and the owning user takes manual reconstruction.
These four problems share a cause. Identity controls describe what an identity may do. An agent's risk depends on what it is doing at a given moment and why.
The Missing Layer: Intent-based Access and Behavior Controls
Intent-based access adds a second decision to the one the identity system already makes. The identity system decides whether the agent holds the permission. The intent layer decides, for each action, whether that action is consistent with what the agent is meant to do. An action goes ahead only when both answers are yes.
This requires a definition of intended behavior for each agent: its purpose, the tools and data it normally uses, and the kinds of actions its tasks involve. That baseline is what each action is compared against.
The Same Permission in Two Chains of Actions
Agents are non-deterministic. Given the same task and the same credentials, an agent can take a different sequence of steps on each run, so a permission cannot be judged on its own. It has to be judged within the chain of actions it appears in.
Take an agent that holds read access to a customer database and permission to send email. Reading a customer’s record to answer that customer’s support ticket, then replying to them, is the work the agent was deployed for. Reading the same record after processing a document that contains injected instructions, then emailing it to an outside address, uses exactly the same two permissions. The identity system sees the same identity and the same scopes in both cases, and allows both. Only the chain of actions tells them apart.
Static NHI Permissions Compared with Intent-based NHI Permissions
Identity and Intent Inform Each Other
The two layers are not independent. Information has to flow in both directions.
Identity informs the intent decision. An identity’s profile and permissions determine how much damage a wrong action could do, so they set the risk of each interaction. An agent acting for a domain administrator, or holding write access to production systems, warrants stricter evaluation and stronger controls than one limited to reading public documentation. The same deviation can justify an alert for the second agent and a block for the first.
Intent informs the identity system. When an agent’s behavior departs from its intended task, that signal should reach the identity provider, where the agent’s permissions can be changed or revoked. Without it, the identity provider keeps granting access to an agent that the runtime layer already knows is off task.
When Behavior Changes, Access Should Change With It
On the other hand, a single out-of-scope action can be blocked on its own. A pattern of them indicates that the agent is no longer working on its task, whether because of an injection, a compromised tool or drift over a long session. At that point the response is to reduce what the agent can do: restrict it to read-only operations, remove access to the tools involved, or suspend it until someone reviews the session.
Agents act faster than a human reviewer can respond, so this reduction has to be automatic. It also depends on the intent baseline. Without a definition of expected behavior there is nothing to measure a deviation against, and misalignment goes unnoticed until its effects show up somewhere else.
Enforcement at the Time of Action (AKA the Execution Layer)
Intent-based control is only useful if it can stop an action before it executes. That places enforcement at the point where the agent calls a tool, an MCP server or an API, in addition to the login. The decision takes the agent's own permissions into account along with the permissions of the identity that owns it, so an agent cannot do more than its owner could. Each decision is recorded against the agent, the task and the owner, which restores the attribution that delegation chains lose.
How Lasso Approaches Non-Human Identities Security for AI Agents
Lasso applies this model across the agents employees use and the agents and LLM applications that teams build. It does so by connecting to the identity provider to read users and non-human identities, and enforces inline through agent hooks, AI gateways, the Lasso SDK and the public API. On employee devices, coverage is rolled out through the endpoint tooling an organization already runs, such as MDM or EDR.
- Every agent is linked to an identity. Lasso does not replace the identity provider. It reads users and non-human identities from it, and links each agent it discovers to the user or endpoint it runs under.
- Every agent is mapped to an owner. Lasso builds an AI-BOM of every agent, MCP server and skill each user has access to, and maps their connections to models, tools and databases. The map ties each agent to its owner and defines its potential blast radius: the systems and data it could affect if it were misused or compromised.
- Every action is checked against intent. Lasso’s Intent Security Engine compiles each agent’s layered instructions, including the system prompt, instruction files and context from plans and task management services, into an intent baseline, and checks every action against it. The identity’s permissions and the agent’s blast radius set the risk of each interaction and determine which control applies. Policies are set per agent, and when an action deviates, Lasso alerts, masks or blocks inline in under 50 milliseconds. The same signal can be passed to the identity provider to change or revoke the agent’s permissions on the fly.
- Permissions are changed or revoked just-in-time. The same connection makes just-in-time permissions practical for agents. Standing permissions give an agent everything it might ever need, all the time. With just-in-time access, the agent receives a permission when a task requires it, scoped to that task, and loses it when the task ends. The intent baseline supplies what this needs: a statement of what the current task is, and therefore which access it justifies.

Evaluating AI Agent Access in the Future
Identity remains the starting point for securing agents, because every control depends on knowing which agent is acting and who owns it. What identity cannot provide is a judgment about a specific action in a specific task. Reviewing agent access by grant alone leaves that judgment unmade. Evaluating each action against intent, and reducing access when behavior changes, brings agent permissions in line with what agents do. The two work as one control: identity sets the risk of an action, and intent decides whether the action belongs to the task.
To see how Lasso maps and controls the agents in your environment. Book a demo.
.avif)



