Join our Newsletter — 33% off our NHI Course

Credential Mediation

Credential mediation is a pattern that keeps real secrets out of the agent runtime. The system injects scoped credentials only when needed, so the agent never holds reusable keys that could be leaked, replayed or abused outside the intended call path.

Expanded Definition

Credential mediation is an identity control pattern that separates an agent’s execution authority from its secret-bearing authority. Rather than embedding reusable keys, tokens, or certificates inside the agent runtime, a mediation layer issues narrowly scoped credentials only at the moment of need and only for the intended action. This is especially important in NHI environments where agents, services, and automation workloads operate continuously and can be inspected, copied, or redirected. The pattern aligns closely with the direction described in the OWASP Non-Human Identity Top 10, even though vendor implementations vary and no single standard governs the exact control flow yet. In practice, mediation often sits between the agent and the target system, brokering ephemeral access through policy, workload identity, or delegated trust. It is not simply secret storage, and it is not the same as generic vault access. The most common misapplication is treating secret retrieval as credential mediation, which occurs when long-lived credentials remain available to the agent after the intended call path ends.

Examples and Use Cases

Implementing credential mediation rigorously often introduces orchestration overhead, requiring organisations to weigh tighter secret containment against added latency, policy complexity, and debugging effort.

  • An AI agent calls a ticketing API through a broker that mints a one-time token for that request, then revokes it after completion, matching the dynamic approach discussed in Ultimate Guide to NHIs — Static vs Dynamic Secrets.
  • A build system uses workload identity to exchange an attested runtime claim for scoped repository access, reducing the chance that source code logs or crash dumps reveal reusable secrets.
  • A data-processing agent reaches a cloud storage bucket only through a mediation service that enforces purpose-bound access and short expiry, rather than carrying a permanent access key.
  • A security team replaces shared API keys with mediated access so that every request can be traced to a specific agent action, similar to the failure modes highlighted in the Guide to the Secret Sprawl Challenge.
  • In more mature deployments, mediation is combined with identity assurance guidance from NIST SP 800-63 Digital Identity Guidelines to decide how much trust a workload must prove before it receives access.

Why It Matters in NHI Security

Credential mediation reduces the blast radius of compromised agents, exposed logs, memory scraping, and replay attacks because the agent never becomes a durable holder of secrets. That matters in NHI security, where one leaked token can be reused by an attacker faster than many teams can revoke it. NHIMG research shows that when AWS credentials are exposed publicly, attackers attempt access within an average of 17 minutes, and as quickly as 9 minutes in some cases, underscoring how little time there is to recover from secret exposure. The same research community has repeatedly documented secret sprawl in incidents such as the Cisco Active Directory credentials breach and the Shai Hulud npm malware campaign, where exposed credentials become attacker leverage. Credential mediation also complements control expectations in NIST SP 800-53 Rev 5 Security and Privacy Controls by enforcing least privilege in a way that is operationally realistic for autonomous systems. Organisations typically encounter the need for credential mediation only after a token is replayed, a runtime is compromised, or an agent action is abused, at which point the pattern becomes operationally unavoidable to address.

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 and CSA MAESTRO address the attack and risk surface, while NIST SP 800-63, NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-02 Credential mediation reduces secret exposure and limits reusable credentials in agent runtimes.
NIST SP 800-63 AAL2 Assurance guidance helps size how strongly a workload must prove itself before token issuance.
NIST CSF 2.0 PR.AC-4 Least-privilege access control maps directly to mediated, just-in-time credential delivery.
NIST Zero Trust (SP 800-207) N/A Zero trust assumes no ambient trust and fits brokered, per-request authorization.
CSA MAESTRO N/A Agentic systems guidance emphasizes guarded tool access and ephemeral authorization.

Require the workload to prove identity at an assurance level fit for the requested access.