Embedded secrets are hard to govern because they spread across code, tickets, and pipeline configurations, then linger beyond the job that needed them. When they are copied or reused, revocation becomes slow and error-prone. The result is weaker auditability, greater exposure to theft, and more manual rotation work for security teams.
Why This Matters for Security Teams
When embedded secrets become the default integration method, pipelines stop behaving like controlled workloads and start behaving like credential distribution systems. That shifts the problem from access management to secret lifecycle management, which is harder to enforce at scale. NHI Management Group’s Guide to the Secret Sprawl Challenge frames the operational reality: secrets spread across repos, build variables, ticket trails, and runner configs, then remain valid long after the job is complete.
The core issue is not simply that secrets can leak. It is that embedded secrets create invisible, reusable trust in places where teams expect ephemeral execution. Once a token is copied into a pipeline, revocation, rotation, and attribution all become reactive. That undermines auditability and makes it difficult to prove which pipeline instance used which secret, when, and for what purpose. The OWASP Non-Human Identity Top 10 treats overexposed machine credentials as a structural control gap, not a hygiene issue. In practice, many security teams encounter secret misuse only after a pipeline compromise or repo leak has already expanded access.
How It Works in Practice
A safer model treats the pipeline itself as a workload identity, then issues access only at runtime and only for the task at hand. Instead of baking a cloud key into a CI variable, the job authenticates with a short-lived identity token, exchanges it for a scoped cloud credential, and discards it when the task completes. This aligns with the direction described in NIST SP 800-53 Rev. 5, which emphasizes least privilege, traceability, and controlled credential handling.
In operational terms, teams usually combine four controls:
- JIT issuance so the pipeline gets access only during execution.
- Short TTLs so compromise windows remain small.
- Workload identity, often using OIDC or SPIFFE-style cryptographic proof, so the system knows what is running.
- Central policy checks that decide access at request time instead of hard-coding static permissions.
This is where the distinction matters: static secrets answer “who can reuse this key,” while workload identity and runtime authorization answer “what is this job allowed to do right now.” That difference becomes critical in environments where one pipeline fans out to multiple cloud services, assumes different roles mid-run, or triggers secondary automation. NHI Management Group’s Ultimate Guide to NHIs — Static vs Dynamic Secrets is useful here because it shows why static credentials age poorly in automated systems, while dynamic secrets preserve control without blocking delivery.
These controls tend to break down when legacy CI/CD platforms cannot broker federated identity, because teams fall back to long-lived cloud keys just to keep deployments moving.
Common Variations and Edge Cases
Tighter secret controls often increase pipeline complexity, requiring organisations to balance delivery speed against integration overhead. That tradeoff is real in mixed estates where some services support federation and others still require API keys. Current guidance suggests phasing the model rather than forcing a single cutover: move new pipelines to workload identity first, then replace the highest-risk embedded secrets, then reduce residual static secrets to tightly governed exceptions.
There is no universal standard for every cloud integration path yet. Some third-party services still only support static API keys, and some build tools cannot exchange runtime identity tokens without custom wrappers. In those cases, the practical fallback is to keep the secret short-lived, centrally issued, and tightly monitored, with explicit owner, rotation SLA, and revocation playbooks. That approach is still weaker than ephemeral identity, but it is materially better than copy-pasted credentials in code or runner images.
The bigger edge case is supply chain exposure. A compromised action, plugin, or dependency can harvest any secret present in the job context, even if the pipeline itself is configured well. NHI Management Group has documented this pattern in the CI/CD pipeline exploitation case study and the Reviewdog GitHub Action supply chain attack. These controls tend to break down when third-party actions run with broad job-level visibility, because any embedded secret becomes recoverable at execution time.
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 CSA MAESTRO address the attack and risk surface, while NIST AI RMF 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-03 | Addresses overexposed machine credentials and poor secret lifecycle control. |
| OWASP Agentic AI Top 10 | A-04 | Autonomous workflows need runtime authorization, not static embedded credentials. |
| CSA MAESTRO | T1 | Covers trust boundaries and identity handling for automated cloud workloads. |
| NIST AI RMF | GOVERN | Supports accountability for AI-enabled automation using secrets and cloud services. |
| NIST CSF 2.0 | PR.AA-01 | Authentication and access control are directly impacted by embedded secrets. |
Replace embedded secrets with short-lived, scoped non-human identity credentials.
Related resources from NHI Mgmt Group
- What breaks when cloud pipelines share secrets and deployment privileges?
- What breaks when teams rely only on default login theming for complex identity journeys?
- What breaks when teams rely on manual tagging and inconsistent classification for cloud data governance?
- What breaks when secrets detection does not cover all common file formats?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 27, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org