Your agent can create a Kubernetes cluster, rotate secrets, and merge a PR — but you still cannot answer a basic production question: who did what, under which policy boundary, and with what approval. That mismatch is the agent identity gap: the workflow is “secure” in design docs, but operationally untraceable.
This isn’t theoretical. Recent practitioner commentary has started calling out identity fragmentation and lack of visibility as a blocker to getting agentic AI into production, largely because teams are forced to stitch IAM, infra and secrets together ad hoc. (techradar.com)
What the agent identity gap actually is
In most companies, “identity” means a well-understood chain:
- A human authenticates (SSO + MFA).
- They assume a role (least privilege).
- They take actions through systems that emit audit logs.
- You can reconstruct intent, authorisation and impact after the fact.
Agentic automation breaks that chain in two ways.
First, the actor is now composite. A single “agent run” is a pipeline of LLM generations, tool calls, retries, handoffs, and guardrails. SDKs increasingly reflect this reality: for example, OpenAI’s Agents SDK has built-in tracing that records LLM generations and tool calls during a run. (openai.github.io)
Second, the action surface is cross-domain. A single task might touch:
- Cloud IAM (AWS/GCP/Azure)
- Kubernetes (cluster authn/authz)
- CI/CD (build, sign, deploy)
- Secrets managers
- Datastores
- Third-party SaaS with its own admin roles
Each domain has identity primitives, but they do not automatically compose into one end-to-end principal you can audit. The result is a run that “looks like” a bot in five different systems and a human in none.
The failure mode you see in production
The pattern is predictable:
- The prototype uses a shared API key or a broad service account because it’s fast.
- The team adds a few safety checks (prompt constraints, allowlists, “confirm before destructive actions”).
- The agent starts doing real work (infra changes, data access, code changes).
- An incident happens — not necessarily a breach. It might be a cost spike, data leak, or a bad deploy.
- Post-incident, you cannot reconstruct a defensible chain of accountability.
The painful part is that everything seems “logged” until you try to answer operational questions:
- Was this tool call initiated on behalf of a specific user, or was it autonomous?
- Which policy allowed it at the time, and has that policy since changed?
- What inputs did the agent see (including tool outputs) when it decided to act?
- If the model retried or switched tools, which attempt actually executed the change?
OWASP’s work on LLM and agentic risks keeps circling the same operational mitigations: reduce excessive agency, enforce least privilege on downstream identities, and log and monitor agent extensions / tool usage. (owasp.org) The MCP ecosystem has also explicitly called out lack of audit and telemetry as a core risk category. (owasp.org)
Why “just log everything” does not fix it
Teams often respond with “we’ll add tracing”. Tracing is necessary, but it’s not identity.
Tracing gives you an execution narrative. Identity gives you an accountable principal bound to policy. Without that binding, you can end up with beautiful traces that still do not prove authorisation.
Also: logs are only as useful as their integrity and their join keys.
The join-key problem
If tool calls, cloud actions, and approvals do not share a stable identifier, you cannot reliably join them.
You see this when:
- The agent calls a tool with an internal call ID, but the cloud action is attributed to a generic service role.
- The approval system records “approved by Alice”, but the downstream action is “performed by agent-sa@prod”.
- A run spans multiple services, each generating different correlation IDs.
Even within agent tooling, it’s easy to mix up what is stable identity versus transient invocation. OpenAI’s own guidance distinguishes tool-definition identity (what the tool is) from invocation identity (a particular call). (github.com) If you conflate those, you will build an audit system that cannot answer basic questions after retries, fallbacks, or tool version changes.
The integrity problem
If an agent can write to its own logs (directly or indirectly), your audit trail is not an audit trail.
The minimum bar is that your authoritative logs are:
- Append-only (or effectively immutable)
- Exported off the execution host
- Access-controlled separately from the runtime identity that performs actions
If you cannot guarantee this, do not let the agent take high-impact actions. Keep it in “advisor mode” (read-only + recommendations) until you can.
A practical model: three identities, one chain of custody
You need to separate and then explicitly bind three identities:
- Requestor: the human or system that asked for the work.
- Agent runtime: the compute identity running the agent (pod, VM, function, worker).
- Action identity: the credential actually used for each tool / API call.
Production-ready systems make the bindings explicit:
- Every run has a run ID.
- Every tool call has a tool-call ID.
- Every external action carries the run ID and tool-call ID as metadata where possible (tags, headers, annotations).
- Every external action uses an action identity that is scoped to a policy boundary (least privilege + environment boundaries).
This sounds obvious, but it’s where most implementations fall apart. People ship the agent, but not the identity plumbing.
Controls that close the gap (without killing velocity)
This is the checklist we’ve found works in practice. It is intentionally boring.
1) Per-run, per-tool credentials (no shared ‘agent key’)
If your agent uses one long-lived credential to do everything, you have already lost.
Use short-lived credentials and tie them to:
- Environment (dev/staging/prod)
- Tool class (read vs write)
- Scope (repo A, cluster B, database C)
- A run ID (so you can revoke and attribute)
When you cannot do per-tool credentials, enforce hard allowlists at the tool gateway and accept that you are operating below “production-grade”.
2) A tool gateway that is the policy boundary
Do not let the model call infrastructure APIs directly.
Put a gateway in front of tools that:
- Authenticates the agent runtime
- Authorises each tool call against policy
- Logs a tamper-resistant event with the requestor/run/tool-call identifiers
- Enforces argument schemas and allowlists (and rejects anything off-policy)
If you are using MCP-style tooling, treat the gateway as the enforcement point, not the model. The OWASP MCP Top 10 explicitly highlights tool poisoning and lack of audit/telemetry; a gateway is where you mitigate both with controlled tool inventories and centralised telemetry. (owasp.org)
3) Explicit approval points for irreversible actions
Approvals are not a UI checkbox. They must be cryptographically and operationally meaningful.
Good approvals bind:
- The exact action intent (what will be done)
- The parameters (what will be touched)
- The identity of the approver
- A time window (expires)
- The run/tool-call IDs that are allowed to execute
OWASP’s “Excessive Agency” guidance repeatedly pushes toward human approval routines for high-impact operations, implemented inside the extension/tool layer rather than relying on prompting. (owasp.org)
4) Traceability across the agent lifecycle
Use tracing, but treat it as supporting evidence, not the source of truth.
At minimum, capture:
- Model inputs/outputs (with redaction where needed)
- Tool call arguments and results
- Tool call errors and retries
- Guardrail decisions (blocked/allowed + reason)
Agent frameworks are starting to make this easier (for example, built-in tracing for LLM generations and tool calls). (openai.github.io) But you still need to correlate those traces to your tool gateway and cloud audit logs.
5) Do not mix “automation” and “exploration” in the same agent
This is a design rule, not a security product.
- Exploration agents can browse, read docs, inspect logs, and draft plans.
- Automation agents can execute tightly scoped actions.
When you combine them, the context window becomes a compromise surface and you will eventually run an unreviewed plan against production.
If you cannot explain the agent’s effective permissions in one paragraph, you have not defined the boundary.
When the right answer is “do not do this”
There are cases where agentic automation is the wrong tool today.
Do not allow autonomous write access when:
- You cannot issue short-lived, scoped credentials.
- You do not have centralised, append-only logging outside the agent runtime.
- Your tools are not idempotent or safe to retry.
- There is no clear owner for the workflow (no-one on call, no incident path).
- The business impact of a single bad action is existential.
In those environments, deploy an agent as a recommender: it can propose diffs, generate runbooks, and draft commands — but execution stays with a human (or with deterministic automation you already know how to secure).
Why this is showing up now (and why it will get worse)
The “new compromise surface” framing is becoming mainstream precisely because agentic systems don’t just generate text — they execute. Practitioner discussions in late August / early September 2026 have explicitly highlighted identity fragmentation and poor visibility as production blockers, not nice-to-haves. (techradar.com)
Separately, standards bodies are starting to treat software and AI agent identity as a first-class problem. NIST’s NCCoE has published a concept paper focused on software and AI agent identity and authorisation, including questions about verifiable, tamper-resistant logging of agent actions and intent. (nccoe.nist.gov)
The direction of travel is clear: audits and regulators will increasingly ask you to explain not only model choice and data handling, but operational control of agent action.
A build approach that doesn’t paint you into a corner
If you are deciding whether to build this in-house, build it as a thin layer with strong contracts:
- Define your action taxonomy (read, write, destructive, irreversible).
- Put every tool behind a gateway with explicit schemas.
- Make credentials short-lived and scoped; ban shared agent secrets.
- Bind approvals to intent and to run/tool-call IDs.
- Export logs/traces to an immutable store and rehearse an incident reconstruction.
This is not glamorous work, but it is the difference between “cool demo” and “system you can run”.
If you want help, codeversols can build the unsexy parts: tool gateways, identity plumbing, trace correlation, and the guardrail/approval surface, alongside the product work. We do not have a magic agent framework; we build the boundary so you can ship safely.
Close
Agentic automation fails in production less often because models are “unsafe” and more often because identity is undefined at the moment it matters. Close the agent identity gap by making the principal, policy boundary, and audit trail explicit for every tool call — or keep the agent out of the execution path until you can.



