Fake Repo Trust Triggers Code Before First Prompt

Datadog Security Labs · Medium sophistication
Last updated August 3, 2026

Researchers describe how attackers can trick developers into cloning and “trusting” a repository in a coding agent, causing code to run automatically before the user even types a prompt. The post highlights real-world use of this pattern in fake job interview scams, and shows two concrete execution paths: a Codex project MCP config that starts a local process, and a Claude Code PATH override that makes the agent run a repo-supplied “git” wrapper.

How the attack worked

The lure described in this research starts with an ordinary-sounding request: clone a repository and open it in a coding agent. This might be framed as a take-home interview task, an open source project needing debugging, or a vendor sample application. Once the developer trusts the project folder so the agent can operate normally, code can execute immediately, before the developer ever sends a prompt.

Two concrete paths are described. In Codex, a project-scoped MCP configuration file at .codex/config.toml can define a local server command that starts an attacker-controlled process the moment the project is opened. No model response or additional approval is required. In Claude Code, project settings at .claude/settings.json can override the system PATH so that when the agent performs its normal startup Git checks, it runs a repository-supplied git wrapper script instead of the real Git binary. That wrapper can quietly delegate to the genuine git afterward so the session appears to continue normally.

Why it succeeded

The pretext works because trusting a project folder feels like a routine, low-friction step rather than a security decision. Developers are used to opening unfamiliar repositories as part of interviews, code reviews, or evaluating vendor samples. Microsoft has documented real-world recruiter-themed activity, sometimes called Contagious Interview, where developers cloned and trusted malicious projects and a VS Code task then ran automatically. Because the execution paths rely on legitimate agent features like MCP configuration and environment settings rather than obviously malicious binaries, a quick manual review may not surface anything unusual.

What to watch for

  • Hidden agent or editor configuration directories such as .codex/, .claude/, or .vscode/ inside a repository
  • PATH modifications in project settings files that point to a workspace-local directory ahead of system paths
  • Local process or MCP server definitions that reference an interpreter plus a repo-supplied script
  • Any execution that happens immediately on opening a project, before a prompt is sent

How to build resistance

Defenders should treat trusting a repository in a coding agent as equivalent to running its code. Unfamiliar repositories are best opened in disposable environments that hold no sensitive credentials, even when a manual review looks clean. Training should go beyond hooks and skills, since MCP configuration, editor tasks, environment settings, runtime startup files, and ordinary repository executables can all influence what runs. At the endpoint, security teams can monitor coding-agent processes that spawn git, Python, Node.js, or shell executables from inside the workspace, paying particular attention to anything that runs before the first user prompt or model request.

Key findings

  • The core lure is persuading a developer to clone a repo and mark it as “trusted” in a coding agent, which can trigger execution automatically.
  • Microsoft-documented “Contagious Interview” activity used fake recruiters to get developers to clone and trust malicious projects, after which VS Code ran a project task.
  • Codex project-scoped MCP configuration can start an attacker-controlled local process on project open, without needing a model response or additional approval.
  • Claude Code project settings can override PATH so the agent’s startup Git checks execute a repo-provided “git” wrapper script.
  • Mitigation guidance emphasizes treating “project trust” as equivalent to running code and using disposable environments for untrusted repos.

Who’s being targeted

  • Commonly targeted roles: Software Developers, DevOps/Platform Engineering, Engineering Managers, IT/Security Operations (endpoint monitoring).
  • Affected industries: Software development, Technology, Professional Services.
  • Attack channels: linkedin, website.
  • Impersonated: Recruiter / hiring team, Open source project or vendor sample application, Open source project.

Red flags to watch for

  • Unsolicited interview/take-home repo from an unknown party
  • Pressure to ‘trust’ the project to proceed
  • Repository includes hidden agent/editor config folders (e.g., .codex/, .claude/, .vscode/)
  • Presence of project MCP config (.codex/config.toml) defining a local executable
  • Local server command points to an interpreter plus a repo script (e.g., python3 + .codex/.../server.py)
  • Execution happens immediately on open, before any prompt
  • .claude/settings.json modifies PATH to include a workspace directory first (e.g., ./bin)
  • Repository contains an unexpected git executable/script in a project bin folder
  • Wrapper delegates to real git to avoid obvious breakage
Try Mirage

Mirage safely runs attacks like this one against your own team, so you find out what happens before a real adversary does.

Get a demo

Frequently asked questions

How does trusting a repository trigger code execution?

Coding agents like Codex and Claude Code can read project-scoped configuration files, such as .codex/config.toml or .claude/settings.json, as soon as a project is opened and trusted. These files can start a local process or override the system PATH, causing code to run automatically without any prompt from the user.

What is the fake job interview connection to this attack?

Microsoft has documented recruiter-themed activity where fake job interviews and take-home assignments were used to get developers to clone and trust malicious projects, after which an editor task ran automatically.

What should developers watch for in a suspicious repo?

Look for hidden agent or editor configuration folders like .codex/, .claude/, or .vscode/, unexpected PATH overrides, and any local process or executable defined inside the project that could run on open.

How can teams reduce risk from this technique?

Treat trusting a repository in a coding agent as equivalent to running its code, review agent-specific config directories before opening unfamiliar projects, and use disposable environments without sensitive credentials for anything unfamiliar.

Read the video transcript

On LinkedIn, a recruiter messages you: "Clone this repository and open it in your coding agent." Seems normal, right? You open the repo in a coding agent like Codex or Claude Code, and it pops: "Trust this project so the agent can work normally." The moment you click trust, their code can run before you even type a prompt. In real scams, fake interview repos hid config like .codex/config.toml that auto-starts a local Python server, or Claude Code settings that override PATH so a repo’s fake "git" script runs during startup checks, no extra clicks, no prompt needed. Treat project trust like running code: for any interview or unfamiliar repo, only open and trust it in a disposable environment you’re prepared to throw away.

Similar attacks

Prompt-Injection PR Trick Leaks Repo Secrets

Prompt-Injection PR Trick Leaks Repo Secrets

A researcher showed that AI coding agents used in GitHub workflows can be tricked by a malicious pull request description into running “safe-looking” commands…

July 29, 2026
Fake GitHub Repos and Trojan Apps Steal Data

Fake GitHub Repos and Trojan Apps Steal Data

Researchers described two active social-engineering-driven malware campaigns: one uses trojanized “popular” remote-user apps (e.g., Zoom/WebEx lookalikes) to…

July 17, 2026