Independent analysis by NHI Mgmt GroupSource article: Riptides, “Your Coding Agent Should Never Hold a Token: Riptides Approach to Credential Brokering” (August 10, 2026)

TL;DR: AI coding agents can only do useful work when credentials are reachable, but that same reach creates a direct exfiltration path through prompt injection, poisoned repositories, and supply-chain abuse, according to Riptides. The security problem is not token strength alone, it is the assumption that an agent can safely hold secrets in its own execution environment.


At a glance

What this is: NHI Mgmt Group's analysis, drawing on Riptides's blog post: Reachable tokens create an immediate leak path for AI coding agents, while hidden tokens remove that exposure.

Why it matters: IAM and security teams need to treat agent credential placement as a control decision, because the access model changes as soon as an AI agent can read secrets inside its runtime.


Context

AI coding agents are software processes that make decisions at runtime, then call tools, read files, and act on repositories or external services. The governance problem starts when those processes can also reach credentials, because a prompt, package, or repository file can redirect the agent without changing the surrounding trust model.

The article focuses on credential brokering as an identity control for non-human access. Instead of placing tokens in the agent environment, it argues for binding credentials to workload identity and delivering them only on approved requests, which changes the exposure model for AI-assisted development and production workflows.


Key questions

Q: What breaks when AI agents are given broad live tokens?

A: Broad live tokens let a subverted agent reach far beyond the intended use case, so a single manipulation can expose unrelated systems, data, or workflows. The control failure is not just overpermissioning. It is putting access control inside a decision process that an attacker can influence at runtime. Narrow the token or replace it with a pre-scoped view.

Q: Why do reachable credentials increase risk for AI coding agents?

A: Reachable credentials turn the agent’s own environment into the attack surface. If the model can read the token, then any instruction that reaches the model can potentially steer it to print, copy, or transmit that credential. That risk exists even when the token itself is well scoped, because reachability precedes scope enforcement.

Q: How should security teams handle secrets in AI-generated code?

A: Security teams should treat AI-generated code as another source of credential exposure, not as a special case. The right response is broad secrets discovery, fast remediation, and ownership mapping across repositories, pipelines, chat systems, and endpoints. If the organisation cannot inventory where a secret exists, it cannot safely rotate or revoke it.

Q: Should teams rely on token rotation alone for coding agents?

A: No. Rotation helps after exposure, but it does not remove the leak path. If an agent can still read a long-lived credential, prompt injection or supply-chain abuse can exfiltrate it before rotation ever matters. Teams should combine short-lived credentials with placement controls that keep the secret outside the agent runtime.


Technical breakdown

Why reachable tokens become the real attack surface

An AI coding agent is not just another script runner. It reads context from files, tool output, repositories, and MCP responses, then chooses the next action at runtime. That means any secret placed in its shell environment, filesystem, or process memory can be consumed by malicious instructions as easily as by legitimate ones. The article’s core point is that token strength does not fix this, because the problem is reachability. Once a credential is inside the agent’s execution environment, exfiltration can happen through ordinary commands, network lookups, or poisoned dependency logic.

Practical implication: Treat token exposure as a placement problem, not only a rotation problem.

How credential brokering changes the trust boundary

Credential brokering moves the secret out of the agent and into a control plane, then injects it only when a permitted request leaves the host. In the article’s model, the agent sees a placeholder while the downstream service receives a valid credential. That means the token is never written to .env, never exported into process state, and never exposed to the model’s context. The important architectural shift is that the agent can still do useful work, but it no longer owns the credential lifecycle directly. The trust boundary moves from the agent runtime to the brokered identity policy.

Practical implication: Separate agent identity from secret possession so the runtime never holds reusable credentials.

Why workload identity matters more than proxy wrapping

The article contrasts direct credential injection with proxy-based patterns. A proxy can hide some traffic, but it also becomes a concentrator for many credentials and many sessions, which increases blast radius if it is compromised. Workload identity lets the broker bind a credential to a machine, process, or session selector and then scope it to a destination such as GitHub. That is a more precise control than a generic network gateway because it is identity-aware rather than connection-aware. It also supports revocation and reuse without changing the agent or wrapping every CLI with custom configuration.

Practical implication: Prefer workload identity bindings over broad network proxies when the goal is to keep secrets out of agent reach.


Threat narrative

Attacker objective: The attacker wants the agent to reveal or misuse credentials that were never meant to be read by the model or its tools.

  1. Entry occurs when the agent receives poisoned text from a repository, issue, or tool response that instructs it to access reachable secrets.
  2. Credential access follows because the token already exists in the agent’s environment, filesystem, or CLI auth state.
  3. Escalation happens when the agent obeys the malicious instruction and turns legitimate access into exfiltration through ordinary commands or outbound requests.
  4. Impact is credential theft, repository exposure, or unauthorized API use on behalf of the victim identity.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Reachable credentials are the design flaw, not merely the leak channel. The article shows that AI coding agents become dangerous the moment a usable token is present in their runtime, because context, tool calls, and prompt injection can all steer the next action. That makes the issue an identity placement problem before it is a malware problem. The practitioner conclusion is simple: if the agent can read the secret, the agent can leak it.

Credential brokering is a boundary-control pattern for non-human identity. The important change is not the control plane itself, but the fact that the credential is no longer part of the agent’s execution state. That redefines the trust boundary for AI-assisted development, CI, and production automation, where the same workload identity may need access to multiple services without ever seeing the underlying secret. The practitioner conclusion is that token possession and task execution should be decoupled.

Session-level exposure is the wrong unit of governance for coding agents. A single task can span repository reads, model reasoning, CLI calls, and external requests, yet each stage may touch different sockets and processes. Identity governance that assumes a stable, inspectable session misses the real risk, which is secret reachability inside the task itself. The practitioner conclusion is to govern access at issuance and binding time, not by assuming the runtime is trustworthy once started.

Short-lived tokens reduce blast radius, but they do not solve secret reachability. The article is clear that scoping and rotation help after a leak, but they still leave the leak path intact if the agent can read the credential. That distinction matters for programme design because many teams stop at rotation and treat the residual exposure as acceptable. The practitioner conclusion is that token hiding belongs ahead of token hardening in the control stack.

Identity blast radius is now a development control concept. Once a coding agent can be prompted to search for secrets, the blast radius of one credential extends into repos, cloud APIs, and downstream services the agent can reach on behalf of the user. That means identity, platform, and application teams need a shared model for what a process is allowed to see, not just what it is allowed to call. The practitioner conclusion is to map agent-visible secrets as a first-class governance surface.

What this signals

Secret reachability is the real policy boundary for AI coding agents. Developers can no longer assume that a token is safe just because it is scoped. If the credential sits inside the same runtime that executes model-directed actions, the runtime itself becomes the exfiltration surface.

Credential brokering gives identity teams a cleaner control point than post-incident rotation. The governance question shifts from how quickly a leaked token can be replaced to whether the agent was ever allowed to see it. That is the more durable control model for autonomous tool use, even when the agent is only partially autonomous.

Agent-visible secrets should be treated as a separate inventory class. Once a coding agent can browse repos, run CLIs, and call external APIs, the organisation needs a map of which credentials are reachable in that path. Without that inventory, offboarding and revocation remain reactive rather than designed.


For practitioners

  • Remove secrets from agent runtimes Keep API keys, PATs, and cloud tokens out of .env files, shell profiles, and process memory for coding agents. Use brokered delivery so the agent receives only a placeholder or transient auth state when a request is authorized.
  • Bind credentials to workload identity Define selectors for machine, process, or container identity, then bind each credential to a specific destination and purpose. This prevents an agent from carrying a reusable token across unrelated services or sessions.
  • Scope agent tokens to the narrowest service path Issue credentials that work only for the exact API, repository, or cloud service the agent needs, and reject any attempt to reuse them elsewhere. Narrow scope limits damage if a prompt, package, or tool tries to redirect the agent.
  • Review supply-chain paths that target AI CLIs Audit post-install scripts, repository content, and MCP responses for instructions that can steer an agent toward secrets. Treat any package or repository that can influence agent behaviour as part of the secret exposure surface.
  • Track agent-visible secrets as a governance inventory Maintain an inventory of which credentials are reachable by coding agents, where they are injected, and which services they can reach. That inventory is the practical basis for revocation, offboarding, and blast-radius reduction.

Key takeaways

  • AI coding agents create a secret-handling problem as soon as credentials are present in their runtime, because ordinary instructions can redirect them toward exfiltration.
  • The article’s central evidence is that the same reachable-token pattern shows up across prompt injection, poisoned packages, and misconfigured auth flows.
  • Keeping tokens out of the agent environment is the decisive control, because rotation and narrow scoping only reduce damage after a leak has already become possible.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe article is fundamentally about keeping secrets out of agent reach.
NHI-07 — Long-Lived SecretsThe article shows long-lived tokens amplifying the impact of exposure.
Recommendation — Keep NHI secrets out of agent runtimes and revoke any credential that can be read directly. Replace long-lived NHI credentials with brokered or short-lived alternatives wherever possible.
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseThe attack path depends on an agent misusing identity and access it was allowed to reach.
Recommendation — Limit agent privileges so runtime instructions cannot turn access into misuse.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementToken lifecycle and placement are central to this control family.
Recommendation — Apply authenticator management to remove exposed tokens from agent-accessible storage.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe issue is whether the right identity can reach the right credential at the right time.
Recommendation — Define and enforce agent credential entitlements so access never exceeds task scope.
MITRE ATT&CKTA0006;TA0010 — Credential Access; ExfiltrationThe article’s threat examples are built around reading and stealing reachable secrets.
Recommendation — Map agent-secret exposure paths to credential access and exfiltration techniques in your detections.

Key terms

  • Credential Brokering: Credential brokering is the process of using a trusted identity proof to issue a separate credential for a target system that cannot accept the original identity natively. It is useful for compatibility, but it also becomes a control point for scope, duration, logging, and revocation.
  • Workload Identity: The identity assigned to a software workload, such as a containerised application, serverless function, or microservice, enabling it to authenticate to other services without storing static credentials.
  • Token Reachability: Token reachability is the degree to which a credential is present in a runtime where it can be read, copied, or reused. For AI coding agents, reachability is often a bigger risk than token strength because the agent can be instructed to inspect whatever it can access.
  • Secret Exfiltration Path: Any route by which sensitive material can leave an environment after it has been read, including shell commands, web requests, diagrams, logs, or rendered outputs. In AI-assisted workflows, the exfiltration path can be created by the assistant itself if output controls are too permissive.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an identity security programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 11, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org