Behavioral Risk Brief: Malicious .git Configs

Governance frameworks that treat workspace-trust prompts and sandboxing as sufficient protection create systemic risk when an agent’s own routine background operations bypass
both entirely. Zero Trust for Code addresses this by requiring a pre-execution trust decision on every command a repository can trigger, not only the ones a user’s approval prompt was designed to catch.

Manifold Security disclosed eight flaws across seven AI coding agents, including Claude Code, Cursor, Codex, and goose, where a repository’s own Git configuration file can name a command
that executes automatically when the agent performs an ordinary background operation, such as checking git status to determine the current branch. The command runs outside the agent’s
sandbox and without any approval prompt, in some cases before a workspace-trust dialog is accepted, before the user has authenticated, or on the first keystroke. Exploitation only requires
that a repository arrive with its .git directory intact, which happens through a shared archive, sync folder, or USB drive, though not through an ordinary clone. Fixes have shipped for goose,
Cursor, and one of the two flaws found in Claude Code, while Hermes Agent, Qwen Code, Grok Build, and a second, separate Claude Code path remained exploitable at the time of publication.

The governance failure is not that a malicious repository could be crafted, but that the execution point defeating every safeguard was a routine, background action the agent performs for its own housekeeping, rather than a step a user or a trust prompt was ever positioned to review. Workspace-trust dialogs and sandboxing exist specifically to gate what an agent does with a new repository, and this class of flaw runs before either applies.
This is compounded by how ordinary the triggering behavior is. Checking which branch an agent is on or which files changed is not a suspicious or unusual action, it happens automatically, every session, without a developer ever noticing. A control built around scrutinizing deliberate or unusual agent behavior has nothing to flag here, because nothing about the triggering action looks any different from a routine operation.
The underlying breakdown is the absence of a trust decision that covers an agent’s own background subprocesses, not only its visible, user-facing actions. As one researcher put it, the vulnerability sits in the ordinary plumbing underneath the agent, not in the model or in anything new, meaning trust granted to an agent’s core functionality never extended to the commands that functionality could be tricked into running.

- Arbitrary code execution on developer machines through routine agent operations, bypassing approval prompts entirely.
- Exposure triggered before user authentication or trust approval completes, in some cases on the first keystroke.
- Multiple agents from different vendors sharing the identical flaw, pointing to a systemic pattern.

- How do you validate the safety of an agent’s background operations, not only its visible, user-facing actions?
- What controls detect a repository configuration file that names a command for the agent to execute?
- How do you verify that workspace-trust prompts actually gate every code-execution path an agent has, not just some of them?
- What evidence do you maintain that agent tooling was evaluated for this class of flaw across all vendors in use?
- How do you account for repositories arriving through channels, such as shared drives, that preserve configuration an ordinary clone would not?
A consistent signal is the disconnect between what a trust prompt was designed to gate and what an agent actually executes before that prompt is ever shown. A safeguard positioned at the wrong point in the process protects nothing.

Zero Trust for Code introduces a trust decision that covers every command a repository can trigger, including an agent’s own routine background operations, rather than relying on a workspace-trust prompt positioned at only one point in the process. This means execution is evaluated on what a command actually does, regardless of whether it arrives through a visible action or a subprocess the agent runs on its own.
This directly addresses the governance weakness this disclosure exposes: the assumption that a single approval gate covers all the ways a repository can cause code to run. By requiring a pre-execution trust decision independent of where in an agent’s workflow a command originates, organizations can catch exactly this class of flaw, one where the trigger is ordinary housekeeping rather than a deliberate, reviewable action.
The result is a governance model where trust is evaluated at every execution point an agent has, not only the ones a vendor’s trust dialog was built to gate, closing the space this vulnerability class relies on across multiple, otherwise unrelated tools.

- Establish governance controls that evaluate command execution across an agent’s background operations, not only its visible actions.
- Require a pre-execution trust decision for any command a repository configuration file can specify.
- Treat workspace-trust prompts as one control among several, not confirmation that every execution path is gated.
- Monitor for repositories arriving through channels that preserve configuration an ordinary clone would strip out.
- Maintain a record of agent tooling evaluated against this vulnerability class across every vendor in use.

Analysis based on reporting from The Hacker News (September 2, 2026) on Manifold Security’s GitSpawn disclosure, CodeHunter Labs evaluation of governance gaps in background-operation
execution trust, and alignment with NIST 800-53 and NIST SSDF integrity control objectives













