← Catalog
Incident high discovered 2026-06-05

Prompt Injection in Claude Code GitHub Actions Steals CI/CD Secrets

Untrusted text in a GitHub issue or pull request steered a Claude Code GitHub Action into reading process environment variables and CI/CD secrets, then exfiltrating them — turning an automated code agent into a credential-harvesting tool.

What happened

Disclosed in June 2026, this attack targets Claude Code running as a GitHub Action. Repos that let the agent respond to issues or pull requests were exposing it to untrusted input: an attacker files an issue or PR whose text contains instructions for the agent. When the workflow runs, the agent processes that content and is steered into reading the runner’s environment variables — including CI/CD secrets and tokens — and exfiltrating them.

It is the CI/CD instance of the broader agentic prompt-injection pattern: an automated agent with real privileges (repo access, secrets, network) acting on attacker-controlled text. Because the agent legitimately has access to those secrets, the theft blends into normal automation unless the boundary between untrusted content and privileged action is enforced.

Why it maps to ATLAS

  • AML.T0051.001 — LLM Prompt Injection: Indirect: the payload arrives via issue/PR content the agent reads.
  • AML.T0055 — Unsecured Credentials: the agent reads secrets from the runner environment.
  • AML.T0098 — AI Agent Tool Credential Harvesting: the agent’s tools are used to collect credentials.
  • AML.T0086 — Exfiltration via AI Agent Tool Invocation: the harvested secrets leave via the agent’s own actions.

Detection notes

CI runners are a high-value, under-watched execution environment. Alert on agent steps that read /proc/self/environ or named secret variables, on instruction-like text in issue/PR bodies, and on any egress from a job that shouldn’t be phoning out. The structural fix is to keep untrusted content and privileged tokens in separate trust zones and egress-restrict the runner.

Detection

Log sources

  • CI/CD run logs + agent action traces
  • Environment/secret access within the runner
  • Outbound network from the CI runner

Signals

  • Agent reading /proc/self/environ or CI secret variables
  • Instruction-like text in issue/PR bodies aimed at the agent
  • Egress from a CI job to a non-allowlisted destination

Mitigations

  • Run agent workflows with least-privilege, scoped tokens; avoid broad secret exposure
  • Isolate untrusted issue/PR content from privileged tool actions
  • Egress-restrict CI runners; alert on secret-shaped strings leaving the job