Guard the code VS Code AI agents write

VS Code’s agent integrations write to your repository with your local privileges. The model deciding what to write has no knowledge of which secrets are live, which auth checks matter, or what your team has decided must not change.

The Mergen extension checks each edit against the same deterministic detectors every other surface uses, on your machine, and reverts the ones that break policy. VS Code offers no pre-write hook, so this is detect-and-revert: the edit lands briefly, then is undone.

What is covered, precisely

Set up in two minutes

Install the server
npm install -g mergen-server
Start the gate
mergen-server start
Install the Mergen extension
code --install-extension OmerTahtaci.mergen

What gets stopped

An edit adding a live API key (sk_live_…)
Structural secret: reverted right after it lands.
An edit removing an authorization check
Held before the write on Claude Code and Windsurf; in VS Code, reverted.
An edit that deletes or skips tests
Held on the pre-write surfaces; in VS Code, reverted.

Human-in-the-loop approvals

In VS Code a flagged edit is reverted, not held: there is nothing to approve before the write. The panel shows what was reverted and why, and every decision lands in the audit ledger.

Install Mergen →Quick start guide →See the benchmark →
Also available for: Claude Code · Codex CLI · Cursor · Windsurf