Join our Newsletter — 33% off our NHI Course

Workflow Definition File

The configuration file that tells a CI system what to run, when to run it, and what permissions the job receives. In GitHub Actions, this file is effectively privileged code because changes to it can alter access to secrets, network reach, and cloud federation paths.

Expanded Definition

A workflow definition file is the execution policy for a CI pipeline: it specifies triggers, job order, runner selection, environment inputs, and the permissions granted to each job. In GitHub Actions and similar systems, it is not merely configuration; it is privileged code because a change to the file can alter secret access, token scope, network reach, and cloud federation paths.

Usage in the NHI domain is still evolving, but the security boundary is clear. The file can create or enlarge the authority of non-human identities such as build agents, deployment bots, and ephemeral runners. That makes it closely related to controls for least privilege, secret handling, and trust boundaries described in NIST Cybersecurity Framework 2.0. It also intersects with workflow attestation, branch protection, and reviewer enforcement, especially when a pipeline can mint short-lived credentials or assume cloud roles.

The most common misapplication is treating the workflow file as low-risk repository metadata, which occurs when teams allow broad write access to pipeline definitions without the same review and protection applied to application code.

Examples and Use Cases

Implementing workflow definitions rigorously often introduces governance overhead, requiring organisations to weigh delivery speed against the risk that a single YAML change can redirect trust or expose secrets.

  • A release workflow that only runs on tagged commits and uses read-only job permissions, reducing the blast radius of a compromised pull request.
  • A deployment pipeline that separates build and publish stages, so the build job cannot directly access production secrets or cloud roles.
  • A pull request validation workflow that blocks changes to the workflow file itself unless approved by designated maintainers, preventing silent privilege escalation.
  • A federated deployment job that requests short-lived cloud credentials only at the final step, using the same discipline described in the Ultimate Guide to NHIs — What are Non-Human Identities.
  • An incident response pipeline that archives evidence and notifies responders after a suspicious workflow edit, similar to patterns discussed in the GitHub Action tj-actions Supply Chain Attack analysis.

Why It Matters in NHI Security

Workflow definition files often become the most direct route from source control into privileged machine identity. When they are too permissive, attackers can turn a routine code change into secret theft, token issuance, lateral movement, or unauthorized deployment. NHIMG research shows that 96% of organisations store secrets outside of secrets managers in vulnerable locations including code, config files, and CI/CD tools, which makes workflow files an obvious target for abuse.

This matters because the workflow itself can define how a non-human identity is created, scoped, and retired. If a job can obtain credentials without strong review, then compromise of the repo becomes compromise of the runtime trust chain. The operational lesson aligns with the NIST Cybersecurity Framework 2.0: protect identities and access paths as part of resilient system design, not as an afterthought. The same governance logic applies when teams compare workflow hardening with broader NHI lifecycle controls in the Ultimate Guide to NHIs — What are Non-Human Identities.

Organisations typically encounter credential exposure only after a pipeline modification, at which point workflow definition files become operationally unavoidable to investigate and lock down.

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

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-02 Workflow files often control secret exposure and privilege scope for machine identities.
OWASP Agentic AI Top 10 A-04 Agentic workflows can grant tools and actions that expand autonomous execution authority.
NIST CSF 2.0 PR.AC-4 Addresses least-privilege access and authorization boundaries for system and service identities.
NIST Zero Trust (SP 800-207) JSON null Zero Trust limits implicit trust in pipelines and the identities they mint or consume.
NIST SP 800-63 AAL2 Credential assurance is relevant when workflows mint or use short-lived machine credentials.

Restrict workflow edits, minimize job permissions, and review secret paths as privileged NHI controls.