Join our Newsletter — 33% off our NHI Course

What breaks when secret stores, environment variables, or projected tokens are readable from a production workload?

A file read inside a workload can become a full identity compromise if secrets are stored in places the workload can already access. Environment variables, mounted tokens, and inline credentials provide no meaningful isolation once the process or pod is compromised. If a read path exists, assume the credential is exposed and can be reused immediately elsewhere.

Why This Matters for Security Teams

When a production workload can read its own secret store, environment variables, or projected service token, the boundary between runtime access and identity compromise collapses. A compromised process does not need to “break out” in a dramatic way to become dangerous. It only needs a read path to a usable credential. That is why static secret, mounted tokens, and inline credentials are high-risk in any environment where workloads accept code, plugins, or untrusted inputs.

The practical problem is not storage alone, but reusability. Once a token or key is exposed, it can often be replayed from elsewhere, chained into other APIs, or used to discover additional privileges. NHIMG research on the Guide to the Secret Sprawl Challenge shows how widely distributed secrets create compounding exposure, and the 2025 State of NHIs and Secrets in Cybersecurity found that 44% of NHI tokens are already exposed in the wild.

For practitioners, the issue is not whether the workload is “trusted enough” to hold secrets. It is whether the runtime can ever be assumed clean after one read primitive exists. In practice, many security teams discover this only after token reuse has already enabled lateral movement or data access outside the original workload.

How It Works in Practice

The failure mode starts with placement. Environment variables are easy to inject, but they are also easy to leak through crash dumps, debug endpoints, process inspection, and misconfigured telemetry. Projected tokens reduce some risks by shortening lifespan, but they still become equivalent to standing credentials if the workload can read and exfiltrate them before expiry. Secret stores help centralise control, but they do not solve compromise if the runtime identity can already query the store.

The safer pattern is to separate workload identity from long-lived secrets. Current guidance increasingly favours cryptographic workload identity, such as the model described in the SPIFFE workload identity specification, combined with short-lived, automatically revoked credentials issued per task. That means the workload proves what it is, the policy engine decides what it may do at request time, and the credential only exists long enough to finish the operation.

In operational terms, teams should treat any credential readable by the workload as already exposed to that workload’s blast radius. Useful controls include:

  • Issuing ephemeral credentials with tight TTLs and automatic revocation after task completion.
  • Binding secrets access to workload identity rather than host or namespace alone.
  • Applying request-time policy checks instead of assuming the mounted secret is safe because it was provisioned by a trusted platform.
  • Logging secret retrieval events separately from application logs so misuse can be detected quickly.

NHIMG’s Ultimate Guide to NHIs — Static vs Dynamic Secrets is a useful reference for the operational difference between credentials that persist and credentials that disappear when the task ends. These controls tend to break down when a shared runtime, such as a CI runner or multi-tenant pod host, allows one compromised workload to observe another workload’s mounted material.

Common Variations and Edge Cases

Tighter secret controls often increase operational overhead, requiring organisations to balance fast deployment against revocation, rotation, and policy complexity. That tradeoff is real, especially in older systems that expect one secret to survive for weeks or months.

There is no universal standard for this yet, but current guidance suggests different handling by workload type. Batch jobs can usually tolerate very short-lived credentials because the task boundary is clear. Long-running services need renewal flows that do not force operators to reintroduce static fallbacks. Agentic or tool-using workloads are harder still, because their behaviour changes at runtime; a secret readable by the workload can be reused in ways the original designer did not anticipate. That is why the OWASP Non-Human Identity Top 10 remains relevant even when the initial issue looks like a simple file read.

Edge cases also matter. Projected tokens are safer than hardcoded credentials, but only if the token audience, scope, and expiry are narrow enough to limit reuse. Secret stores are safer than inline variables, but only if the application cannot turn a read into an export event. In cloud-native estates with sidecars, shared volumes, or compromised build agents, the same pattern recurs: once the runtime can read it, the runtime can lose it. NHIMG’s reporting on the 230M AWS environment compromise shows how quickly exposed cloud credentials can become infrastructure-level access.

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 AI RMF, NIST Zero Trust (SP 800-207) and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-01 Readable secrets turn NHI credentials into immediate compromise risk.
CSA MAESTRO A1 Agentic and runtime access paths need identity-aware, time-bound controls.
NIST AI RMF Secret exposure in autonomous runtimes is an operational AI risk issue.
NIST Zero Trust (SP 800-207) SC-7 Zero trust assumes internal runtime access is not automatically safe.
NIST CSF 2.0 PR.AC-1 Access control must limit what a compromised workload can read and reuse.

Eliminate readable long-lived NHI secrets and replace them with short-lived, task-bound credentials.