Join our Newsletter — 33% off our NHI Course
Home› FAQ› Cyber Security› What fails when CI/CD pipelines are treated as…
Cyber Security

What fails when CI/CD pipelines are treated as trusted environments?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 12, 2026 Domain: Cyber Security

The failure is that teams stop watching the job while it is executing, which is exactly when malicious scripts can steal tokens, tamper with artifacts, or call out to external domains. Trusting the workflow before runtime leaves a control gap around the runner’s live identity and network behavior.

Why Trusted CI/CD Pipelines Fail at Runtime

The core failure is a false trust boundary: the pipeline is treated as safe before the job starts, so execution-time monitoring, network inspection, and artifact scrutiny become too loose exactly when hostile code can act. That is why a trusted runner can still leak tokens, alter build outputs, or reach out to attacker-controlled infrastructure.

In practice, the problem is not only “malicious code in the repo.” It is also the runner’s live authority, including the credentials it can access, the files it can write, and the outbound paths it can open while the job is active.

What Breaks in the Execution Phase

Once a pipeline job is running, it behaves like a privileged automation environment, not a passive build step. If the workflow is trusted too early, teams often allow broad token scopes, persistent credentials, permissive artifact handling, and egress that is never validated against the job’s actual intent.

That creates a gap between what the pipeline was supposed to do and what the runner can actually do. A single compromised step can read environment variables, tamper with generated artifacts, or trigger external callbacks that exfiltrate secrets or metadata.

CI/CD compromise patterns repeatedly show how fast this turns into secret theft and downstream abuse. NHIMG’s ArtiPACKED 2024 and tj-actions/changed-files compromise 2025 both illustrate how runtime exposure, not just source compromise, can surface live tokens inside pipeline execution.

Why This Is a Trust Boundary Problem, Not Just a Build Problem

The sensitive moment is the handoff from declared workflow to live execution. If the pipeline is trusted as a whole, teams may miss the difference between pre-execution review and runtime control, which is where a malicious script can quietly inherit the runner’s authority.

That is also why identity and credential handling matter so much here. The control gap is around the runner’s live identity and network behavior, which means the right question is not simply whether the YAML file was reviewed, but whether the job’s effective permissions, token exposure, and outbound behavior were constrained during execution.

NHIMG’s CI/CD Pipeline Identity Security Guide is useful here because it focuses on keyless federation, token permissions, pinned actions, and trusted publishing, all of which reduce how much authority a running job can misuse.

Risk and Threat Considerations

Trusted pipelines are attractive because they already hold the permissions, secrets, and network reach that attackers want. Once execution starts, a malicious script can use that trust to exfiltrate credentials, alter artifacts, or pivot into adjacent systems without needing a separate breach of the build platform.

Failure mechanism: the pipeline is allowed to run with standing trust, broad token scope, and insufficient runtime inspection, so hostile code can act inside the job before defenders notice abnormal outbound calls or secret access.

Impact: secret theft, poisoned artifacts, unauthorized publishing, and follow-on supply-chain compromise can spread far beyond the original repository or build run.

Standards & Framework Alignment

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

SLSA, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
SLSASupply-chain Levels for Software ArtifactsBuild provenance and artifact integrity are central when pipeline execution can be poisoned.
Recommendation — Adopt SLSA practices to verify build provenance and harden artifact integrity before release.
NIST SP 800-53 Rev 5AC-6 — Least PrivilegePipeline jobs need minimal effective permissions to limit runtime abuse of credentials and actions.
IA-5 — Authenticator ManagementShort-lived and tightly managed secrets reduce the damage from stolen CI/CD tokens and keys.
SC-7 — Boundary ProtectionOutbound network control matters because malicious jobs often exfiltrate data through external calls.
Recommendation — Apply AC-6 to reduce pipeline job permissions to the minimum required for each run. Apply IA-5 to rotate, bound, and revoke pipeline credentials aggressively. Apply SC-7 to restrict and monitor pipeline egress from build runners.
CIS Controls v8CIS-6 — Access Control ManagementPipeline trust failures often stem from excessive access and unmanaged secrets in automation.
Recommendation — Use CIS-6 to remove standing access and tightly govern pipeline credentials.

Practitioner Guidance

What to prioritize: treat runtime authority as the control point, not just repository review. If a job can access production tokens, signing material, or publish paths, its execution needs tighter observation and shorter-lived credentials than a normal build step.

What to verify: confirm that the runner cannot retain reusable secrets, that outbound network access is bounded to what the job truly requires, and that artifact generation is checked before publish or promotion. If you cannot explain why the job needs a given token or egress path, the trust assumption is already too broad.

What good looks like: the pipeline can run untrusted code only with narrow, observable permissions, and any step that can affect release integrity is isolated enough that abuse is both harder and easier to detect.

Practitioner takeaway: a CI/CD pipeline becomes unsafe the moment “trusted” is allowed to substitute for “controlled at runtime”; the operational goal is to keep execution observable, bounded, and revocable while the job is actually running.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 12, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org