- Book: Event-Driven Architecture Pocket Guide
- The series: Pocket Guides for Developers — 8 short books on agents, RAG, prompts, observability, events, databases and system design — the whole series
- My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools
- Me: xgabriel.com | GitHub
If your repo has an ANTHROPIC_API_KEY secret so a coding agent can run in CI, a stolen GitHub token with push access could be enough to read it. It takes no exploit and no malicious package, only a push to a private repo.
On October 25, Wiz Research published its report on Gheist, an automated campaign it has tracked since September 15. Wiz says it recovered more than 13,500 planted branches from more than 850 compromised accounts, with figures current as of October 24. RuntimeWire reported the same numbers the same day.
The campaign takes its name from the gheist user agent its tooling sends to GitHub's API, per Wiz. It has no command-and-control server. The secrets leave through GitHub's own API, so there is no attacker domain for you to block.
What a Gheist push looks like
For every repository a stolen token can reach, the tool creates a branch named ci-sync- plus six random characters and commits one file, .github/workflows/sync-check.yml, with the message "ci: sync config", according to Wiz. The commit is authored as the token's owner and unsigned.
The push triggers the workflow. The workflow prints the environment and the whole secrets context to its own run log, encoded as base32. Wiz explains why that matters: GitHub masks a secret in logs only when the exact value appears, so an encoded copy prints in full. The tool then downloads the log and deletes the run seconds later.
The workflow also sets permissions: {}, per the report, which restricts the GITHUB_TOKEN but does nothing to stop a job from reading secrets. And if the repository has deployment environments, one variant runs a job matrix over them, so environment-scoped secrets, often your production credentials, get printed too.

One push, one workflow, one log: the secrets leave through the run output, then the run is deleted.
Where did the tokens come from? Wiz says the sources it could trace fit two patterns: infostealer logs, and tokens exposed in earlier supply-chain compromises, such as the Trivy compromise in March.
Where your AI keys come in
Coding agents in CI usually authenticate with a repository secret. Anthropic's own Claude Code GitHub Actions docs say setup saves the credential as a repository secret named ANTHROPIC_API_KEY for an API key or CLAUDE_CODE_OAUTH_TOKEN for a subscription token. Nothing is wrong with that setup. But a workflow that dumps the entire secrets context takes whatever is in it, and an AI provider key is spendable money.
The later variant goes further. Wiz says it added a sync-host job aimed at self-hosted runners, which searches the home directory, workspace and system paths for 31 token formats, "including keys for AI providers such as Anthropic, Hugging Face, Groq and NVIDIA." The same job collects cloud metadata and runner and Kubernetes service account credentials, and tries the Docker socket to reach the host's root filesystem. Wiz also calls it buggy: it looks for the wrong runner key file and doesn't collect GCP or Azure tokens.
If this sounds familiar, it rhymes with a story from earlier this month: an infostealer that grabs .claude.json and Codex's config.toml. Stealers feed token dumps, and token dumps feed campaigns like this one.
GitHub's approval hold worked, on public repos
Since July 28, GitHub Actions holds potentially malicious workflow runs until a collaborator with write access approves them. Wiz says every public Gheist run it checked sat at action_required. In its words: "The control worked, and the malicious payloads never ran."
The catch is scope. GitHub's changelog says the protection "currently applies to public repositories on github.com only," and GitHub Enterprise Server does not have it. In private repositories, Wiz reports that runs completed and were deleted, and cloud logs showed organizations' own workflows assuming AWS roles on attacker branches. In enterprise organizations, the tool cycled through several users' and automation accounts within minutes and cloned private repositories. Hours later, Wiz says, cloud credentials from the same organization were used to enumerate AWS Secrets Manager.
Do not approve a held sync-check run, and do not run code from a ci-sync branch. Both are on Wiz's list of response steps.
Check your org for planted branches
Wiz publishes the branch pattern ^ci-sync-[0-9a-z]{6}$. This loop uses the GitHub CLI to list matching branches across an organization's repositories:
ORG=your-org for r in $(gh repo list "$ORG" --limit 1000 \ --json nameWithOwner --jq '.[].nameWithOwner'); do gh api --paginate "repos/$r/branches" --jq '.[].name' \ | grep -E '^ci-sync-[0-9a-z]{6}$' \ | sed "s|^|$r: |" done A match whose only change is .github/workflows/sync-check.yml is the signature Wiz describes. An empty result is not a clean bill of health, though. Wiz says about two-thirds of the implicated accounts were no longer available on GitHub as of October 24, and a cleaned-up branch leaves no trace in this list.
So also look where deletion doesn't reach. Wiz's hunt steps: in your GitHub audit log, search for runs on ci-sync-* branches deleted within a minute of completing, and for activity with the gheist user agent. If your workflows use OIDC, check cloud audit logs for role assumptions whose subject includes a ci-sync- branch. On self-hosted runners, search for the files .gdmp_pat, .gdmp_patg and .gdmp_sweep, and for the string gdmp-pivot.

Branch names can be deleted. Audit logs and cloud role-assumption logs are where the trace stays.
If you find a hit, Wiz is blunt: rotate every secret available to the affected repositories, including organization and environment secrets. Deleting the run or the branch does not remove the exposure. Revoke the token that pushed the commit, check its owner's machine for an infostealer, and treat any self-hosted runner that ran a ci-sync branch, and its instance role, as compromised.
Rotation means the provider side too. Anthropic's docs note that if you delete a repository secret, "the credential it held stays valid". Revoke the key in the provider's console, then store the new one.
Take the long-lived secrets out of the repo
The durable fix is to give a stolen token less to find. A few changes, each backed by its vendor's docs:
- Federate the agent's auth. The Claude Code GitHub Action can exchange the workflow's OIDC token for Claude API access through a Claude Console service account, so you store no long-lived Anthropic secret. It needs the
id-token: writepermission. - Pin cloud trust to a branch or environment. GitHub's AWS OIDC guide shows a trust condition on
token.actions.githubusercontent.com:sub. A subject likerepo:your-org/app:environment:productionwill not match aci-sync-branch. - Put reviewers on production environments. Per GitHub's environments docs, jobs reach environment secrets only "after any configured rules (for example, required reviewers) pass."
- Shorten the life of your
ghtoken. Since v2.103.0, the GitHub CLI can opt into expiring, auto-refreshing OAuth tokens withgh auth login --expiring. GitHub says a leaked access token then "becomes unusable within hours instead of lasting indefinitely."
Wiz adds two more: prefer GitHub Apps or short-lived fine-grained tokens over personal access tokens, and run self-hosted runners as ephemeral hosts without Docker socket or unrestricted metadata access.
If your agent's CI key is still a plain repository secret, the OIDC exchange in the first bullet is the change that takes it out of the secrets context entirely.
If this was useful
Gheist rides on something event-driven systems take for granted: a push is an event, and whatever consumes it trusts the producer. Thinking about who gets to emit an event and what a consumer can reach is part of the ground the Event-Driven Architecture Pocket Guide covers. It's one of 8 short books in the Pocket Guides for Developers series, on agents, RAG, prompts, observability, events, databases and system design. I also build Hermes IDE, an IDE for running Claude Code, Codex and other coding agents side by side, each on its own branch.
