They assume ephemeral means safe by default. Ephemeral infrastructure still becomes dangerous if the workflow has broad permissions, can access metadata services, or can mint federated tokens before the job ends. The lifetime is short, but the trust granted during that lifetime may be too large.
Why This Matters for Security Teams
Ephemeral build infrastructure is often treated as inherently safer because it disappears after the job finishes, but the real risk lives inside the workflow that runs on it. If the build runner can read cloud metadata, assume federation, or retrieve broad secrets, the short lifetime does not matter much. Current guidance around least privilege and identity-aware access is still the right starting point, as reflected in the NIST Cybersecurity Framework 2.0, but teams must apply it to the workload, not just the host.
That distinction matters because ephemeral compute is usually created for speed and automation, which makes it easy to over-grant access during setup. A job that only needs to fetch dependencies can accidentally inherit permissions for deploying, signing, or reading production state. NHIMG’s Ultimate Guide to NHIs — Static vs Dynamic Secrets is useful here because the same logic applies: short-lived does not mean low-risk if the credential scope is broad. In practice, many security teams discover the problem only after a build runner has already minted a token and touched systems it never should have reached.
How It Works in Practice
The safer pattern is to treat ephemeral infrastructure as a short-lived workload identity, not as a trusted blank slate. That means the pipeline should authenticate the job, issue a narrowly scoped token, and evaluate access at request time based on the job’s purpose, environment, and stage. This is where dynamic secrets, federation, and policy-as-code matter more than VM lifetime. A runner can live for five minutes and still be dangerous if it can exchange its identity for a long-lived cloud role or pull credentials from a shared vault path.
In practice, teams reduce risk by combining several controls:
- Issue JIT credentials with tight TTLs and automatic revocation when the job completes.
- Use workload identity rather than instance trust, so the job proves what it is before it gets access.
- Block metadata service access unless the workflow explicitly requires it.
- Scope federated roles to a single repository, branch, artifact type, or deployment stage.
- Evaluate permissions at runtime using policy-as-code instead of relying only on static CI roles.
That model aligns with the operational direction discussed in NHIMG’s The 2026 Infrastructure Identity Survey, where static credentials and over-privilege remain common even as autonomy increases. For implementation detail, the SPIFFE overview is a useful reference for workload identity, and NIST Cybersecurity Framework 2.0 remains the best common language for mapping those controls to governance and operations. These controls tend to break down when build systems can self-provision cloud roles, because the first credential they mint often becomes the last one anyone reviews.
Common Variations and Edge Cases
Tighter build controls often increase pipeline friction, requiring organisations to balance delivery speed against blast-radius reduction. That tradeoff is especially visible in high-velocity environments where developers expect every job to reach package registries, artifact stores, and cloud APIs by default. Best practice is evolving here: there is no universal standard for how much autonomy an ephemeral runner should have, especially when signed builds, test data, and deployment automation all share the same estate.
One common edge case is the “ephemeral” host that still depends on persistent bootstrap secrets. Another is the runner that is short-lived but placed on a network path that can reach internal metadata, control planes, or privileged service endpoints. Teams also get tripped up by shared build templates, where one broad role is reused across many projects because it is simpler to maintain. NHIMG’s research on dynamic credentials shows why that pattern persists: organisations know static secrets are weak, but they still under-scope the access boundary. The right question is not whether the machine disappears, but whether the identity it carried could have done damage before it vanished. In highly regulated environments, that becomes even harder when audit evidence is split across CI logs, cloud IAM, and secret managers.
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-01 | Ephemeral runners still need strong workload identity and scoped trust. |
| OWASP Agentic AI Top 10 | Dynamic, autonomous execution patterns mirror the privilege risks seen in build automation. | |
| CSA MAESTRO | Agentic workload governance principles apply to ephemeral automation and tool use. | |
| NIST AI RMF | Risk governance must account for autonomous automation that can act beyond intent. | |
| NIST CSF 2.0 | PR.AC-4 | Least-privilege access is the key control gap in ephemeral build environments. |
Establish runtime oversight, accountability, and escalation paths for automated infrastructure changes.
Related resources from NHI Mgmt Group
- What do security and fraud teams get wrong about post-incident response?
- What do security teams get wrong about evaluating WebView bridge safety?
- What do security teams get wrong about connector credentials in infrastructure automation?
- What do security teams get wrong about simplifying identity infrastructure?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 1, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org