Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

Playbooks · Coding tasks

Audit a repository's git config before any agent opens it

Written October 31, 2026

Before an agent opens a folder that arrived as files, read the repository's own git config for settings that name a program git will run. A plain clone does not carry that config, but a folder handed over as files does — and the agent's first background git call can run the program before any trust prompt appears.

What the risk is

Manifold Security disclosed this pattern in early September 2026 under the name GitSpawn: eight findings across seven command-line coding agents. Coding agents run git status or git diff in the background to learn the branch and what changed. Both commands refresh git's index first, and the index refresh runs the helper program named by the repository's own core.fsmonitor setting, read from the repository's .git/config file. The command runs as your user, on your machine, outside the agent's sandbox, and never passes an approval prompt. In Manifold's testing, the payload fired before the workspace-trust prompt was accepted in Claude Code and Hermes Agent, before authentication in Qwen Code, and on the first keystroke in Grok Build. The rule Manifold states for the defence is short: any setting that names a program can run it.

Running git status yourself in that folder before the audit has the same effect as the agent running it. Read the config first, and run nothing that touches the working tree until you have.

Which folders this covers

This audit is for a repository that arrives as files with its .git directory already inside it: a shared zip file, a shared drive folder, a sync folder, a USB stick, or a handover from another developer. Cloning a hostile URL does nothing, and neither does fetch or pull — git's transfer protocol does not carry the source repository's local config. If you cloned the repository yourself from its remote, this audit does not apply. If the folder arrived any other way, it does.

Steps

  1. Do not open the folder with an agent yet. Do not run git status or git diff in it first. Those are the calls that refresh the index.
  2. Read the config file as text. Open .git/config in a plain text editor, or print it with cat. You are looking for any line whose value names a program or a script. The two keys named below matter most, but the rule is the value, not the key: if a setting names a program, treat it as a program git will run.
  3. List the local config with its source file. From outside the folder, or from the folder without running a status or diff, run:
    • git -C /path/to/repo config --local --list --show-origin
    This lists the repository's local config, with the file each line came from. Check the origin of every line, not just its value: a config file can pull in another file with an include.path or includeIf setting, and git inserts the included file's contents at the point of the include, as if they had been written in the including file. If any line came from a file other than .git/config, or the config contains an include.path or includeIf line, open that included file as text as well and apply the same rule to it: any setting in it that names a program is a setting git will run.
  4. Look for core.fsmonitor. This is the documented performance setting whose value is a helper program git runs during an index refresh. A legitimate value names a filesystem monitor such as Watchman. Any other program, or a program in a path you do not recognise, is a stop signal.
  5. Look for core.hooksPath. Git prints this key in lowercase, as core.hookspath. It changes the directory git reads hooks from, and hooks are programs git runs at points in its execution. A hooks path pointing outside the repository, or at a directory you did not set up, is a stop signal. List the files in that directory, and in .git/hooks, without running any of them.
  6. If the config is clean, open the folder as normal. A config with no program-naming settings, and a hooks directory holding only the sample files git ships, is the ordinary case. Keep the folder's origin in mind anyway: this audit says nothing about the code itself.
  7. If you find a program-naming setting, do not open the folder with an agent. Do not run git commands in it. Ask the sender for a fresh clone URL for the same repository, or for the files without the .git directory, and say which setting you found. If you must keep the folder, remove the one setting with git -C /path/to/repo config --local --unset core.fsmonitor — and read the next section before trusting that removal, because it is not a complete fix on its own.

The 1 September 2026 snapshot, and why it is dated

Manifold retested the affected agents on 1 September 2026. At that date, Goose was fixed in 1.44.0 and Cursor was patched; Manifold lists OpenAI Codex as patched without naming a version, and coverage of the report names 0.131.0 as the fixed version. Claude Code's core.fsmonitor path was fixed in 2.1.196. Hermes Agent, Qwen Code (0.22.3), and Grok Build were unpatched at that date, and a second Claude Code path behind claude ultrareview was unpatched at 2.1.252 — it uses a different config key that Manifold has not published while it remains unpatched. That snapshot is the most recent published retest in Manifold's disclosure. It is not a statement about any agent's current version. Before relying on a fix for the agent you run, read that vendor's release notes for the version you have installed, and note the version number. A fix claimed for one version says nothing about the version on your machine.

The unpublished second key is the reason removing core.fsmonitor is necessary but not sufficient: unsetting one key cannot close a path that turns on a different, unnamed key. Setting core.fsmonitor=false in your global config is likewise not sufficient, because the repository's local config takes precedence for that folder. Manifold's suggested form for vendors is to pass the override on the call itself, as in git -c core.fsmonitor=false status, which overrides the repository value for that one call.

What can go wrong

Limits

Related playbooks

Sources

Back to: Coding playbooks hub · Also: Open an untrusted repo without running code · Check DeepSeek's dsh tool is really running the version with the sandbox-escape fix