Security teams should treat CI/CD as a primary attack surface, not just a delivery system. The strongest approach is layered detection: scan dependencies, review lockfile diffs, flag obfuscated or packed code, inspect pipeline configuration changes, and monitor build logs for unusual network calls or unexpected processes. Secret scanning and integrity checks should be enforced automatically to catch tampering early.
Why This Matters for Security Teams
CI/CD compromise is dangerous because it turns a trusted delivery path into an attacker-controlled distribution channel. When pipeline code, build steps, or dependencies are altered before production, the result can be malicious functionality that arrives with the organisation’s own release process and inheritance of trust. Security teams therefore need to treat build and release systems as high-value assets, not just engineering tooling. NIST Cybersecurity Framework 2.0 is useful here because it frames pipeline security as a governance, protect, detect, and recover problem rather than a single scanner problem, and the control logic in NIST Cybersecurity Framework 2.0 maps well to prevention plus early detection. The practical mistake is assuming that once code passes tests, it is safe. Attackers often target the gaps between source control, build runners, artifact stores, and deployment automation. That means indicators of compromise can appear in dependency changes, build scripts, environment variables, runner behaviour, or signed artifacts that no longer match expected content. In practice, many security teams encounter CI/CD compromise only after a release has already been promoted, rather than through intentional build-path monitoring.How It Works in Practice
Effective detection depends on correlating signals across the pipeline, not relying on a single control. Teams should baseline normal repository, runner, and artifact behaviour, then alert on deviations that suggest tampering or execution abuse. Source control events, pipeline configuration updates, and dependency changes should be watched together because malicious activity often starts with a small change that looks routine in isolation. A workable detection stack usually includes:- Dependency and lockfile comparison to catch unexpected version drift or new transitive packages.
- Secret scanning in commits, build logs, and artifact outputs to identify exposed tokens or injected credentials.
- File integrity checks for pipeline definitions, build scripts, and release artifacts.
- Runtime telemetry from build agents to spot unusual child processes, shell invocation, or outbound connections.
- Policy checks for unsigned artifacts, suspicious privilege use, and changes to release approvals.
Common Variations and Edge Cases
Tighter pipeline monitoring often increases developer friction and alert volume, requiring organisations to balance release speed against tamper visibility. That tradeoff is real, especially in fast-moving environments where frequent changes are normal and false positives can quickly become ignored. Best practice is evolving for teams using reusable workflows, self-hosted runners, or software supply chain automation across multiple repositories. In those environments, a single compromised template can affect many builds at once, so the question is not just whether a specific job is suspicious, but whether a trusted control point has been altered. Current guidance suggests treating shared pipeline components as privileged assets with stronger review, change control, and integrity validation than ordinary application code. Edge cases also matter. In container-heavy workflows, malicious code may not appear as a traditional binary but as a small script inside a build image layer, a package post-install hook, or a dependency pulled from a compromised registry. For organisations adopting agentic AI in the delivery chain, additional scrutiny is warranted for tool-using agents that can modify code, open pull requests, or trigger deployments. The line between automation and compromise is not always obvious, so teams need clear approval boundaries and strong provenance checks. A useful recent warning on attacker tradecraft in AI-enabled operations is the Anthropic — first AI-orchestrated cyber espionage campaign report, which reinforces how quickly automation can be turned against defenders when guardrails are weak.Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | DE.CM-8 | Pipeline telemetry and build integrity monitoring are central to this detection question. |
| NIST AI RMF | AI-assisted development and automation add governance and monitoring risk to CI/CD. | |
| OWASP Agentic AI Top 10 | Agentic tools in delivery pipelines can alter code or trigger actions with execution authority. |
Collect and correlate pipeline telemetry so suspicious build and release activity is detected early.
Related resources from NHI Mgmt Group
- How should security teams hunt for malicious logic in code repositories and CI/CD pipelines before it reaches production?
- How should security teams respond when a widely used package is published from a compromised maintainer account and malicious code reaches CI/CD systems?
- How should security teams handle broad exception catching in Python production code and CI/CD pipelines?
- How should security teams reduce malicious package risk in CI/CD pipelines?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 1, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org