Security research · AI coding agents

Workspace Trust Is Not a Boundary

Most coding agents ask once whether you trust a project. After that, every change the project receives is trusted too. In 2026 a worm used that to plant itself in public projects, and we traced what it left behind.

The finding: most coding agents ask whether you trust a folder, once. A change the folder receives later runs on that same yes.

Results at a glance
89
public repositories infected, at least: 17 original projects, 67 forks and 5 projects with a variant
82
still carry the working files today
7
popular projects with more than 1,000 stars among them
3 s
for a startup instruction added by a pull to run on Claude Code, with no prompt

How to read these numbers. Every count is a floor: GitHub's code search reads only each project's default branch and does not cover every public repository. 89 is 17 original projects, 67 forks whose own automation planted the files, and 5 projects carrying a variant described below; forks that only copied the files by syncing with an infected original are not counted. 82 is the 10 originals, 67 forks and 5 variant projects that still carry them. The 3 seconds is from our test on Claude Code 2.1.328, with a harmless marker in place of the worm.

The developer did nothing unusual. They had trusted the project once, pulled its latest changes, and opened it again. In our test on Claude Code, a planted startup instruction ran within three seconds, with no question asked.

What happened

On 24 September 2026, a popular open-source project with about 5,000 stars received an ordinary-looking change. It came from the account the project's own automated workflows use, and GitHub marked it as verified. Its description repeated the project's previous one, a version number.

The change added five files. Two of them are settings files that coding tools read when you open a project:

  • one tells Claude Code to run a script whenever you start a session;
  • one tells VS Code to run the same script when the folder opens.

The other three were that script and the program it starts: a 500 KB scrambled JavaScript file.

Nobody at the project wrote that change. Anyone who had already trusted the project in Claude Code, pulled the latest version and opened it again ran the program. Nothing on screen said so.

We reproduced that last step safely, with a harmless marker in place of the real program. On Claude Code 2.1.328, a startup instruction that arrived with git pull (the command that downloads a project's latest changes), in a project already trusted, ran within three seconds of opening the project, and no prompt appeared.

What it does to your machine

The program is a credential stealer. According to the security advisory one infected project published after analysing it, and the security firm SafeDep's analysis of the same code, on a developer's computer it:

  • collects your secrets: SSH keys, the tokens your tools use for npm, PyPI, Git and GitHub, .env files, your AWS, Azure and Google Cloud settings, Docker and Kubernetes settings, and your Claude configuration;
  • reads password managers and secret stores where you are already signed in, such as 1Password, Bitwarden, Vault, Kubernetes secrets and AWS Secrets Manager;
  • sends everything to the attacker. If that fails, it uses your own GitHub token to create a public repository and puts your secrets in it;
  • stays behind: it tries to add its own startup instructions to your personal Claude and Codex settings, and installs a background program that checks GitHub every hour for new code to download and run;
  • can delete your home folder. It can install a background service that watches the GitHub token it stole and wipes the folder when the token stops working, or when it cannot reach the npm registry.

That last point changes what you should do if you were hit. It is covered in "What to do" below.

Why the coding agent ran it

Coding agents can read instructions from the project you open: "when a session starts, run this." Because that means running code from someone else's project, most agents first ask one question: do you trust this folder?

For most of these tools, the question is asked once, about the folder, not about what is in it. Say yes, and every later change to that folder is covered by the same yes, including one that arrives months later through git pull. Reading every file before you trust a project does not help when the bad files arrive later.

This is how the main tools behave, from their own documentation and our tests on 19 November 2026:

ToolAsks before running a project's startup hooks?New instructions arrive by git pull into a folder you already trusted
Claude Code 2.1.328Yes, once per folderruns, no prompt on the next launch (our test)
CursorThe agent CLI asks (our test); the editor's trust setting is off by defaultruns "Project hooks run in any trusted workspace" (Cursor's documentation)
VS Code tasksAsks once per folder whether to allow automatic tasksruns each time the folder opens, once allowed (VS Code's documentation)
OpenAI Codex CLI 0.162.1Yesasks again before running a new or changed hook: Codex remembers a fingerprint of each hook (documented, and our test)
Gemini CLINo: its trust check is off unless you turn it onnot documented
GitHub Copilot CLIYesnot documented

Some runs skip the question entirely. When Claude Code runs without a person at the keyboard, as claude -p or through its SDK, it treats the folder as trusted and runs its instructions. Cursor's command-line agent refuses to start in a folder it has not been told to trust, and Codex's codex exec ran nothing in a folder never trusted.

Asking for trust is not a bad design. Someone who can change a project you use can already run code on your machine through its install scripts or tests. The difference here is timing: these instructions run the moment you open the project, before you have built, installed or run anything yourself.

How it got into so many projects

Many GitHub projects use small add-ons called Actions to automate chores, such as labelling issues or closing old ones. A project often refers to an Action by a version label, like v3. Unless the Action uses immutable releases, whoever controls it can move that label to new code at any time. A full commit ID, a long string that identifies one exact version, never changes.

On 18 May 2026, an attacker moved every version label of two popular issue-management Actions to new code. That code ran the worm first and then did the real job, so nothing looked broken. It took the access token the project's automation was using and used it to commit the five files into the project. Most of the projects hit in September ran them every day or whenever an issue was opened, so projects kept getting infected for months with no further work by the attacker.

  • We found 2,704 public projects still referring to those two Actions. 92 percent of them (2,494) use a movable label. The other 210 use a fixed commit ID. Since GitHub blocked both Actions, those runs now fail.
  • GitHub blocked both Actions on 24 September. Until then, every moved label pointed to the attacker's code.
  • Seven of the 17 original projects we found infected were using one of these Actions by label when they were hit. The other ten were infected through other parts of their own automation; one maintainer traced theirs to a build job that installed npm packages while the August npm worm was spreading.

Forks were hit too. A fork is someone's own copy of a project on GitHub. We checked 12,138 forks of the affected projects, every one changed since May. 67 of them were infected by their own copy of the automation, separately from the original, and all 67 still carry the files. Twelve of those are copies of a popular project that no longer uses the hijacked Action; the copies kept running the old setup.

A variant hid under .github/. Five more projects carry settings files that run .github/setup.js, a 4.5 to 5.3 MB file packed the same way as the June wave's program. Their commits carry false dates, in two cases claiming a Claude settings file was added in 2018, before Claude Code existed, and labels that tell automated checks to skip them. All five still carry the files.

What became of the infected projects

Of the 17 original projects:

What happenedProjects
still infected two to six months later10
inert the startup instructions remain, but the program they point to was deleted1
cleaned within a day to three weeks (17 days in the middle case)5
cleaned by rewriting the project's history, so the bad change disappears1

Of the six that cleaned up, only one published a security advisory: the one that rewrote its history, a day after it was hit, naming the change, the files and what the program steals. The other five that cleaned up published none, so people who had opened the project in the meantime got no advisory or alert from it. In each of those five, someone outside the project had already opened a public issue saying the files were malicious; replies ranged from a full explanation to no reply at all.

A rewritten history hides the infection. Once a project rewrites its history, the bad change no longer appears in it, and a check of the history, ours included, cannot tell the project was ever infected. We know about that one only because it was reported publicly.

What to do

The attack can be stopped at three points: when the worm gets into a project, when it plants its files, and when your coding tool runs them.

If you run a project on GitHub

  • Refer to every Action by its full commit ID, not a label, and turn on GitHub's setting that requires this for your repository or organization. We found that setting off on our own repositories until we turned it on.
  • Allow only Actions you have chosen. GitHub can limit a repository or organization to Actions from GitHub, verified creators and a list you name.
  • Give each automation job only the access it needs. An issue bot needs to write issues, not code. Set its permissions to contents: read and issues: write, and its token cannot commit files.
  • Require review for changes to the coding-tool folders: .claude/, .codex/, .cursor/, .gemini/, .vscode/, .github/hooks/, .github/workflows/, .mcp.json and .github/mcp.json, using a CODEOWNERS file and a branch rule that requires a code owner's review.
  • Check your history, not only today's files. Look for any of .claude/setup.mjs, .vscode/setup.mjs, .claude/index.js, .claude/router_runtime.js, .claude/execution.js, .claude/math_init.js or a multi-megabyte .github/setup.js ever having existed. The bad changes came from the project's own bot or carried false dates, and reused a normal-looking description, so search by file name, not by date or author.
  • If you were hit, publish a security advisory, not only a fix: say which change, which files and which dates, and what people who opened the project should do. Then rotate every secret your automation could read.
  • If you publish an Action yourself, turn on immutable releases, so your version labels cannot be moved.

If you open other people's code

  • Open unfamiliar projects somewhere isolated: a container, a virtual machine or a separate user account, so anything that runs cannot reach your keys.
  • Read what a pull changed before you reopen the project, especially the coding-tool folders: git diff ORIG_HEAD.. -- .claude .codex .cursor .gemini .github/hooks .vscode .mcp.json
  • Do not run claude -p or the Claude Agent SDK on a project you have not read. Claude Code skips the trust question in those modes and runs the project's hooks.
  • In VS Code, set task.allowAutomaticTasks to off explicitly in your user settings. The default is also called off, but it still asks once per folder, and one "Allow" lets that folder's tasks run every time after.
  • Do not wait for a warning. There is no GitHub security advisory for the two hijacked Actions, so GitHub's Dependabot alerts had nothing to report.
  • If you opened an infected project, do not revoke your tokens first, and do not disconnect the computer. Revoking the stolen token, or cutting the internet connection, can trigger the wipe. While still online, remove the background services first. On macOS, unload each one (launchctl unload <file>) and delete ~/Library/LaunchAgents/com.user.gh-token-monitor.plist, ~/Library/LaunchAgents/com.user.kitty-monitor.plist, ~/.local/bin/gh-token-monitor.sh and ~/.local/share/kitty/cat.py. On Linux, stop and delete ~/.config/systemd/user/gh-token-monitor.service and ~/.config/systemd/user/kitty-monitor.service, run loginctl disable-linger, then delete the same two files. On either system, also delete the folder ~/.config/gh-token-monitor/, which holds the stolen token. Before you start Claude Code or Codex again, remove any startup hooks the worm added to your personal Claude and Codex settings, delete ~/.claude/package and ~/.codex/package, and delete the planted files from the project; otherwise the next session runs it again. Only then revoke and replace your tokens and keys.

If you run security for a team

  • Know which computers have coding agents, which are set to run commands without asking, and whether a recent supply-chain attack reached them. Our free, open-source checker Blindspot reports this for each computer, can run from your device-management tool, and only reads files.
  • Look for the planted files together, and in history: the five the main waves used, and the variant's large .github/setup.js with its two settings files. The large program changed between attack waves; across the 17 original projects, the small VS Code task file did not. Matching only the large program against published fingerprints misses 6 of the 17; matching all five files finds all 17. The variant's files match no published fingerprint; pairing the two startup settings is what found it.
  • Require fixed commit IDs for Actions across your organization, so no project depends on someone remembering.

How we measured

Method. Every repository was read through GitHub's public interfaces in November 2026, with Sourcegraph's public code search as a second index. We downloaded no repository and ran no planted code.

  • Exposure. We searched public code for workflows using either Action, split by file size so that no single search hit GitHub's 1,000-result limit, and recorded whether each used a label or a fixed commit ID.
  • Infections. Candidates came from searches for the worm's file names, a sample of about 41,000 popular repositories (the 10,000 most-starred plus partial samples of two lower star ranges), the projects using the two Actions, and the September victims SafeDep reported. For each, we read the history of the worm's file paths, the files as planted, and the files today.
  • Forks. GitHub's code search skips most forks, so we listed them directly: every fork, pushed to since 1 May 2026, of 218 affected projects, 12,138 in all. 107 carry or carried the files. For each, we asked GitHub whether the planting change is part of the original project's history. For 40 it is: they copied the files by syncing with the original (17 still carry them, 23 no longer do). For 67 it is not: their own automation planted the files, mostly in May and September.
  • Fingerprints. For each planted file we compared Git's own identifier for its exact contents, and its SHA-256 hash, against the hashes the security teams published. No file was saved to disk or run.
  • Startup settings. We searched public code for settings files of Claude Code, Gemini CLI, VS Code, GitHub Copilot, Codex and Cursor that define a startup entry (for Cursor, any hooks file), 33,953 files in all, and read each one's startup commands. 23,939 projects run a command when they are opened. Only 31 have both a Claude Code session-start hook and a VS Code folder-open task that run a script, and 10 of those are this worm. That pairing is how we found the five variant projects.
  • Response. For each cleaned project we read its published security advisories and searched its issues and pull requests.

The 17 original projects came in four waves: May (4), June (4), August (3) and September (6). Every planting change was made by the project's own github-actions[bot] account.

Fingerprints. The 217-byte VS Code task file was identical in all 17 and matches a published hash. The large program matched a published fingerprint in 11 of the 17; the June wave's programs were 5 MB files, each different. For four projects, all from June, the small task file was the only planted file with a published hash.

The same move, through 2026. Committing coding-tool startup files into repositories was reported again and again:

ReportedCampaignFiles committed into repositories
AprilSAP / Intercom packages.claude/settings.json session-start hook, .vscode/tasks.json folder-open task, and the scripts they run
Aprillightning (PyPI)The same pair plus .claude/router_runtime.js, committed under the name claude
MayTanStack packagesA .claude/settings.json session-start hook and .claude/router_runtime.js; one of our 17 carries a copy matching a published hash
MayAntV npm account takeoverThe five files, committed through the GitHub API
Augustkeyv / cacheable packages.claude/settings.json and .vscode/tasks.json startup hooks plus .claude/math_init.js, change description "chore: update config"
SeptemberHijacked actions-cool GitHub ActionsThe five files

Other 2026 attacks targeted coding agents without committing files: SANDWORM_MODE added a malicious MCP server to agent settings on infected machines, and the Bitwarden CLI and Nx Console payloads listed agent settings such as ~/.claude.json among the files to steal.

Tools that re-check. git never takes hooks from a cloned project ("client-side hooks are not copied when you clone a repository"). direnv stores its approval under a hash of the file's path and contents, so an edited .envrc is blocked until approved again. Codex records trust against each hook's hash.

Limitations.

  • Every count is a floor. GitHub search reads only default branches, skips most forks and misses some public projects; a rewritten history hides an infection; and the 2,704 leaves out projects that had already removed the Action. We checked forks only of the 218 affected projects, changed since May.
  • We did not measure how many developers opened an infected project.
  • We did not decode the June wave's program or the variant's; the June task file and setup script, and the variant's matching packing, identify them.
  • Agents were tested on one Mac at fixed versions, with harmless markers; editors against their documentation only.

The boundary that holds

Coding agents now act on whatever a project tells them to, the moment it is opened. In 2026 a worm used that to plant itself in at least 89 public repositories, in files a coding agent runs when the project opens. The trust question these tools ask is answered once, and files that arrive later are covered by that answer.

A boundary that holds has to look at the change, not the folder: a fingerprint that must still match before a hook runs, as Codex does for hooks; a person who must approve changes to these folders before they are accepted; and a check on the computer itself that sees what actually runs when an agent starts.

Trusting a project once should not mean trusting every change it ever receives.

Sources. The campaigns were first reported by the teams named below. This piece adds the aftermath, the exposure count, the fork count, the fingerprint results and the comparison across agents. September wave, the Action hijack, the planted files, the payload and the wiper: SafeDep, "Mini Shai-Hulud Is Still Infecting GitHub Repositories", 24 September 2026, and the security advisory published by one infected project. Order of clean-up (remove the token monitor before revoking): Socket and Wiz. Earlier waves: Wiz (SAP / Intercom; TanStack; keyv), Socket (SANDWORM_MODE; lightning; keyv / cacheable), StepSecurity (Bitwarden CLI; TanStack; Nx Console), SafeDep (AntV). Agent behaviour: the vendors' own documentation for Claude Code, OpenAI Codex, Cursor, Gemini CLI, GitHub Copilot CLI and VS Code, and our tests of Claude Code 2.1.328, Codex CLI 0.162.1 and Cursor agent CLI 2026.11.19 on 19 November 2026. GitHub settings: GitHub Docs. git: Pro Git, "Git Hooks". direnv: its source code. Counts: our own reading of GitHub's public interfaces in November 2026; they are floors.