Join our Newsletter — 33% off our NHI Course

Who is accountable when a trusted dependency steals build-time secrets?

Accountability is shared across application owners, platform teams, and identity governance. Application teams own dependency review, platform teams own runner hardening, and identity teams own the scope and lifetime of the credentials exposed to those environments. If the same secrets are available everywhere, ownership has not been translated into control.

Why This Matters for Security Teams

Build-time secrets are often exposed in places that feel operationally safe, such as CI runners, package hooks, plugin ecosystems, and reusable build actions. The problem is not only theft, but ambiguity: once a trusted dependency reads a token, it is rarely clear whether the failure belongs to application engineering, platform engineering, or identity governance. That ambiguity slows response and weakens accountability for the controls that should have limited the blast radius in the first place.

Security teams should treat this as a governance question with a technical root cause. If dependency trust is implicit, build credentials are effectively shared by every component that can reach the pipeline. The relevant control objective is not just detecting malicious code, but reducing what any dependency can see, use, or exfiltrate. Guidance in the NIST SP 800-53 Rev 5 Security and Privacy Controls remains useful here because it ties access restriction, auditing, and configuration management to operational accountability.

In practice, many security teams discover weak ownership only after a dependency has already touched the secret store, rather than through intentional dependency governance.

How It Works in Practice

Accountability becomes real when each team owns a distinct control layer. Application owners should approve which dependencies are allowed, which build steps can invoke them, and whether a package lockfile or provenance check is required. Platform teams should harden the runner, isolate jobs, restrict outbound egress, and prevent one job from reading another job’s workspace or environment variables. Identity teams should scope credentials to the smallest feasible workload, shorten token lifetime, and ensure the secret is usable only in the specific build context that needs it.

This is where non-human identity governance matters. A build token, signing key, or artifact publishing secret is an NHI in practice, even if the team has not labeled it that way. The OWASP Non-Human Identity Top 10 is relevant because it frames the real issue as identity sprawl, excessive privilege, and unmanaged lifecycle. A trusted dependency should not be able to inherit the same standing access as the build system itself.

  • Separate dependency trust from credential trust.
  • Bind secrets to job identity, repository, branch, and environment where possible.
  • Use short-lived tokens rather than long-lived static secrets.
  • Log secret access at the runner and identity provider, not just at the application layer.
  • Require provenance or integrity checks for packages that execute during build.

The operational question is whether a dependency can influence build execution without also inheriting build authority. If the answer is yes, the control design is still too broad. These controls tend to break down in monorepos with shared runners and legacy CI templates because the same reusable pipeline logic spreads privileged credentials across unrelated builds.

Common Variations and Edge Cases

Tighter build isolation often increases pipeline friction, requiring organisations to balance release speed against reduced secret exposure. That tradeoff is especially visible in environments that rely on dynamic package installs, generated code, or private registries. Best practice is evolving, but current guidance suggests that secrets should not be injected globally into build environments unless every step in that environment is equally trusted.

There is also a distinction between a dependency that steals a secret and a dependency that merely causes a secret to be presented to an external service. In both cases, the control failure may be similar, but accountability can differ. If platform hardening was missing, the platform team owns the isolation gap. If a secret was over-scoped or never rotated, identity governance owns the lifecycle failure. If unreviewed dependencies were allowed into production builds, application ownership failed the trust decision.

Edge cases often appear in ephemeral CI, container builds, and agentic automation. When an AI agent or automation workflow can call tools during build-time, it should be treated as an execution principal with bounded authority, not as a passive script. That intersection is increasingly important, but there is no universal standard for this yet. The practical rule is simple: every secret should have a named owner, a named runtime, and a reason it cannot be narrower.

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

Framework Control / Reference Relevance
NIST CSF 2.0 PR.AC-4 Build secrets need least-privilege access and scoped authorization.
OWASP Non-Human Identity Top 10 NHI-01 Build tokens and signing keys are non-human identities with lifecycle risk.
NIST AI RMF Agentic build automation can expand secret exposure and accountability gaps.
NIST Zero Trust (SP 800-207) SC-7 Isolation and segmented trust reduce lateral access from compromised dependencies.
MITRE ATLAS AML.T0020 Supply-chain compromise patterns help map dependency abuse to control gaps.

Treat each build job as untrusted by default and segment network and runtime access.