Subscribe to the Non-Human & AI Identity Journal

What breaks when secrets and bots are not governed inside GitHub?

When secrets and bots are not governed inside GitHub, organisations lose track of who or what can act, where those credentials are stored, and whether access still matches the intended task. The result is access sprawl, orphaned privilege, and delayed revocation, which can turn a repository issue into a broader cloud compromise.

Why This Matters for Security Teams

GitHub is no longer just source control. It is where bots, CI jobs, deploy keys, service accounts, and AI-assisted workflows often obtain the ability to read, write, and ship code. When those identities are not governed, secrets become durable access paths instead of temporary task credentials, and repository hygiene turns into cloud risk. The operational issue is not simply leaked text in a file. It is uncontrolled machine action.

That is why guidance from the OWASP Non-Human Identity Top 10 and the NIST Cybersecurity Framework 2.0 increasingly treats non-human access as a governance problem, not just a secrets-scanning problem. NHIMG research on the State of Secrets Sprawl 2026 shows 64% of valid secrets leaked in 2022 are still exploitable today, which is a reminder that detection without revocation leaves live pathways behind.

In practice, many security teams discover the issue only after a bot token is reused to reach a deployment target, rather than through intentional identity design.

How It Works in Practice

Governance inside GitHub needs to distinguish between human contributors and machine actors. A bot that opens pull requests, merges code, triggers workflows, or comments on issues should not inherit broad repository or cloud permissions just because it is “part of the pipeline.” The better pattern is workload identity plus task-scoped access: prove what the bot is, evaluate what it is trying to do, and issue only the minimum secret or token needed for that action.

That typically means replacing long-lived personal access tokens and shared service credentials with short-lived, JIT-issued credentials. Modern guidance also favours policy-as-code at request time, so access decisions are based on repository, branch, environment, event type, and approval state. For GitHub-based automation, that can include narrowly scoped GitHub Apps, ephemeral OIDC-based cloud federation, and automatic revocation when the job ends. The Ultimate Guide to NHIs explains why static secrets create a standing privilege problem, while Reviewdog GitHub Action supply chain attack shows how a compromised workflow can turn routine automation into mass secret exposure.

  • Use per-workflow or per-job identities, not shared bot accounts.
  • Issue short-lived tokens with explicit repository and environment boundaries.
  • Scan for secrets, then revoke or rotate them automatically.
  • Separate code-review automation from release automation.
  • Log every non-human action with enough context to reconstruct intent.

These controls tend to break down in large monorepos with inherited workflow permissions because a single approval path can unintentionally authorize many downstream jobs.

Common Variations and Edge Cases

Tighter GitHub identity controls often increase operational overhead, requiring organisations to balance release velocity against stronger privilege boundaries. That tradeoff becomes sharper when teams rely on marketplace actions, reusable workflows, or cross-repository automation.

Current guidance suggests treating third-party actions as untrusted until pinned, reviewed, and limited by scope. It also suggests that internal repositories are not automatically safe; NHIMG’s State of Secrets Sprawl 2026 notes internal repos are far more likely to contain secrets than public ones, which means private visibility does not equal control. The CI/CD pipeline exploitation case study is a useful reminder that compromise often starts in automation, then pivots into cloud credentials, not the other way around.

There is no universal standard for GitHub bot governance yet, but best practice is evolving toward zero standing privilege, per-task authorization, and continuous revocation. Teams should also watch for edge cases such as fork-based pull requests, self-hosted runners, and AI coding assistants that can mint or reuse secrets faster than human review can intervene.

When those conditions line up, a repository incident stops being a code-quality issue and becomes a multi-system identity failure.

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 define the specific risk controls and attack patterns relevant to this topic.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-01 Directly addresses non-human identities and their access paths in GitHub.
OWASP Agentic AI Top 10 A-03 Covers autonomous tool use and runtime access decisions for bots.
CSA MAESTRO GOV-02 Relevant to governance for machine identities in automated pipelines.

Inventory every GitHub bot and service identity, then scope and review each credential separately.