A coding agent can be careful about shell permissions and still get surprised by a command it did not appear to run.
That is the uncomfortable lesson from the newly disclosed GitSpawn class of vulnerabilities affecting multiple AI coding tools.
Security researchers at Manifold Security found that several agents automatically ran ordinary Git commands such as git status or git diff to understand a repository. Git itself can execute repository-configured helper programs during those operations. In affected agents, that helper could run outside the agent’s command sandbox and without the normal approval flow.
The most important practical detail is also reassuring:
An ordinary Git clone does not preserve the source repository’s local .git/config, so this specific attack path requires a project to arrive with its .git directory already intact — for example through a shared archive, synced folder, drive copy or USB transfer.
That means developers can reduce a lot of risk with a boring process change: treat a received repository directory differently from a repository you cloned yourself.
Security check date: September 3, 2026. Manifold published its research September 1. Some affected products were patched before publication; several paths were still reported unpatched in Manifold’s September 1 retests. Tool versions can move quickly, so verify your vendor’s current release before relying on the version table below.
What actually went wrong?
AI coding agents need context before they can help.
They want to know things like:
- which branch is checked out;
- which files changed;
- what is staged;
- what belongs to the repository;
- whether the working tree is clean.
So the agent may call Git automatically, sometimes before you type the first prompt.
The problem is that Git is not always a passive metadata reader. Some Git configuration options can point to helper programs. One example is core.fsmonitor, a legitimate performance feature that can tell Git to call a filesystem-monitoring helper when refreshing its index.
Manifold found affected agents were allowing repository-local Git configuration to influence these background calls. If a malicious repository directory arrived with attacker-controlled local Git configuration intact, the helper could execute with the developer’s user privileges.
This is not a model hallucination problem. It is a trust-boundary problem between:
- an untrusted project directory;
- the agent’s startup/context-gathering code;
- Git’s own extensible configuration system;
- the developer’s machine.
That distinction matters because “I did not approve a dangerous command” is not enough protection when the dangerous execution happens underneath the agent’s normal tool-permission layer.
Why the delivery method matters so much
Most developers think of a repository as “the code.” Git sees more than that.
A normal clone downloads version-controlled content and creates a new local .git directory. It does not copy the source machine’s local .git/config verbatim.
A shared folder or archive can be different. If somebody compresses an entire repository directory, including .git, and sends it to you, the local repository configuration can travel with the files.
That creates a useful security rule:
| How the project reached you | Risk from this specific preserved .git/config path | Better default |
|---|---|---|
Normal git clone from a known remote | Much lower | Update agent, then review normally |
ZIP containing source files but no .git | Lower for this path | Still treat code as untrusted |
ZIP containing the full .git directory | Higher | Inspect or strip/isolate before launching an agent |
| Synced project folder from another machine | Higher if .git traveled with it | Re-clone when practical |
| USB/shared-drive copy of a whole repo | Higher if .git traveled with it | Open in a disposable environment first |
This does not mean cloning random repositories is generally safe. Repositories can contain malicious build scripts, package hooks, prompt injection, IDE configuration and many other hazards.
It only means the GitSpawn configuration path has a specific precondition that defenders can use to reduce exposure.
Which coding agents were affected?
Manifold reported eight findings across seven agents. Its September 1 publication said four findings remained unpatched at publication.
The most useful status summary is:
| Tool / path | Status reported by Manifold | Version detail reported |
|---|---|---|
| OpenAI Codex CLI | Patched | Affected 0.102.0–0.130.0; fixed in 0.131.0 |
| OpenAI Codex Desktop | Patched | Fixed desktop builds were published for macOS and Windows |
| Cursor | Patched | Manifold says its reported variant was fixed |
| Goose | Patched | Fixed in 1.44.0 |
Claude Code — core.fsmonitor path | Patched | Confirmed affected on 2.1.193; fixed by 2.1.196 |
| Claude Code — separate review path | Reported unpatched in Sept. 1 retest | Confirmed on 2.1.252; Manifold withheld the relevant Git key while unpatched |
| Qwen Code | Reported unpatched in Sept. 1 retest | Confirmed on 0.22.3 |
| Hermes Agent | Reported unpatched in Sept. 1 retest | Confirmed on 0.21.0 |
| Grok Build | Reported unpatched in Sept. 1 retest | Confirmed on 1.0.13 |
The table is a snapshot, not a permanent compatibility list. If you use one of the tools reported unpatched, check the vendor’s latest release notes or security advisory now, because a fix may have shipped after the researchers’ retest.
For Codex specifically, public vulnerability records describe CVE-2026-19592 and say the affected Git helper ran outside Codex’s command sandbox without an approval prompt. The reported CLI fix begins at version 0.131.0.
The bigger lesson: the trust prompt cannot be the first trust boundary
Anthropic has written about a closely related security lesson from earlier Claude Code vulnerabilities: anything that happens before a workspace-trust prompt has to be treated as if it were processing an inbound request from the internet.
That is a useful design principle beyond Claude Code.
If an agent needs to inspect a folder before asking whether you trust it, the inspection itself must be safe against hostile configuration.
In other words:
“Do you trust this folder?” is only meaningful if opening the folder has not already executed something from it.
This sounds obvious after the fact. It is surprisingly easy to violate in developer tooling because startup code often does helpful background work before the UI is ready.
AI agents amplify the problem because they run more tooling automatically than a traditional text editor.
A safer workflow for repositories you did not create
You do not need an elaborate security lab for every pull request. A small intake routine covers most of the practical risk.
1. Prefer a clean clone over a copied repository directory
If a trusted remote exists, clone it yourself instead of opening a ZIP of somebody else’s working tree.
That removes the source machine’s local .git/config from this specific path and gives you a cleaner provenance story.
For a code review sent by a colleague, ask for a branch, commit, fork or patch when possible rather than “here is my whole project folder.”
2. Update the coding agent before reviewing unfamiliar code
Agent security bugs are moving quickly. Running an old binary because “it still works” is a poor trade when the tool can execute shell commands and inspect credentials on your machine.
For products with auto-update, confirm the update actually landed. For manually installed CLIs, check the installed version before opening unfamiliar projects.
If you use Codex CLI, the disclosed affected range ended at 0.130.0 and the fix started at 0.131.0. Do not intentionally stay inside that affected range.
3. Treat a received .git directory as untrusted configuration
If a project arrived as files rather than through a normal clone, check whether it contains .git before launching an AI coding agent inside it.
For defensive inspection, Manifold recommends checking repository Git configuration for command-bearing settings. A simple non-destructive check for the disclosed filesystem-monitor path is:
git config --get core.fsmonitor
Do this only in an environment where running Git itself is appropriate for the repository and your tooling is up to date. For highly untrusted material, inspecting the files from a disposable container or VM is safer than experimenting on your normal workstation.
4. For unknown archives, copy the source without repository metadata
If you only need to read the code, you may not need the sender’s .git directory at all.
A safe review pattern is to place the source files in a disposable directory without carrying over repository-local metadata, then initialize your own repository or compare against a trusted remote separately.
Do not casually delete .git from someone’s only copy of a project; work on a separate copy.
5. Keep high-value credentials away from the review environment
A compromised process running as your user may be able to reach whatever your user can reach.
That can include:
- SSH keys;
- cloud credentials;
- package-registry tokens;
- GitHub tokens;
- production
.envfiles; - other repositories on disk.
For third-party or suspicious code, a disposable VM, dev container or isolated workstation with minimal credentials turns a workstation compromise into a much smaller incident.
6. Sandbox the whole execution environment, not only the agent’s commands
Agent-level command sandboxes are useful, but GitSpawn demonstrates why they are not the entire boundary.
If the agent itself launches a subprocess outside its internal sandbox during startup, an operating-system or container boundary around the whole agent process gives you another layer of defense.
Anthropic’s own sandboxing guidance emphasizes combining filesystem and network isolation. That combination is important: filesystem isolation limits what a compromised process can read or modify, while network isolation makes exfiltration harder.
7. Make repository intake a team rule
This is one of those vulnerabilities where a one-line policy can be more valuable than another security product:
Do not open externally supplied full repository folders in coding agents on your normal workstation. Re-clone from a trusted remote or inspect them in an isolated environment first.
That rule is easy to explain, easy to audit and still useful after this specific CVE is forgotten.
What not to overreact to
There are three easy ways to turn a useful security disclosure into noise.
“AI coding agents are unsafe, stop using them”
That conclusion is too broad.
The affected behavior came from the interaction between Git configuration and background context gathering. Multiple vendors have already shipped fixes. The practical response is to update tools and improve isolation, not pretend developer automation is going away.
“Workspace trust dialogs are useless”
They are still useful. They just cannot protect code that runs before the dialog.
The right lesson is to make pre-trust operations safe by construction.
“A normal clone can trigger this exact attack”
For this disclosed .git/config delivery path, Manifold explicitly says an ordinary clone does not preserve the malicious local configuration. Saying otherwise exaggerates the threat and hides the most actionable mitigation.
Security guidance gets better when the preconditions are stated clearly.
A five-minute team checklist
If your team uses local coding agents, this is a practical minimum:
- Update Claude Code, Codex, Cursor, Goose and any other agentic CLI you use.
- Inventory which agents can run commands on developer laptops.
- Stop opening full copied repositories from ZIPs, drives or sync folders when a clean clone is available.
- Use disposable environments for unknown third-party projects.
- Keep production credentials out of those environments.
- Review vendor advisories when an agent version is pinned for reproducibility.
- Document the rule so contractors and new team members know why a copied
.gitdirectory deserves extra caution.
That is not perfect security. It meaningfully narrows the attack surface without making everyday development unbearable.
Conclusion
The surprising part of GitSpawn is not that Git has configurable helpers. Git has been extensible for years.
The surprising part is how easily AI coding agents can turn familiar developer plumbing into automatic execution before the developer believes anything has happened.
The fix is partly a vendor problem: background Git calls should sanitize untrusted repository configuration, and trust boundaries have to exist before startup inspection.
But developers have a useful defense today.
If a repository came from somewhere else as a complete folder, treat its .git directory as active configuration, not harmless history. Prefer a clean clone. Keep your agent updated. Review unknown code in an isolated environment. And remember that an AI agent’s visible approval dialog is only one layer of the security model.
The safest coding-agent workflow starts before the first prompt.
Sources
Checked September 3, 2026:
- Manifold Security — GitSpawn: A Single Flaw Lets Untrusted Repos Run Code in Claude Code, Codex, Cursor, and Grok
- GitHub Advisory Database — CVE-2026-19592 / OpenAI Codex repository Git configuration vulnerability
- Anthropic — How we contain Claude across products
- Anthropic — Making Claude Code more secure and autonomous with sandboxing
- The Hacker News — Malicious .git configs can make AI coding agents run attacker code