Mergen — Execution & Security Gateway for AI Agents
Prompts are not boundaries. AI agents don't know your security,
infrastructure, or compliance constraints — and asking them nicely doesn't
enforce anything. Mergen is the deterministic gate that sits between your
AI agents and your systems: every covered action is evaluated against your
policy rules in under 1ms, before it executes, and either passes, is
blocked with a guided alternative, or is held for one-click human
approval.
All of it runs on 127.0.0.1. No cloud. No LLM in the critical path.
What this extension gives you
A live control panel for the gateway, right in your editor:
- Overview — protection status, active policies, pending approvals, and
the most recent agent actions at a glance, plus system health and account
settings
- Runtime Console — one click out to the full decision log, policy
editor, runtime map, and approvals history — shared across every IDE
(Cursor, Claude Code, VS Code) so no single extension has to duplicate it
- Status bar shield — turns yellow when an action awaits your approval,
red when something was blocked; you're notified the first time the gate
intercepts anything
- Approve / deny in place — held actions wait in Pending Approvals; the
agent resumes the moment you click
- Account & plan — device-authorized sign-in, same flow as the CLI
The extension auto-starts the local gateway, self-heals blocked edits in
plain VS Code (no AI-agent pre-write hook exists at the platform level), and
monitors the Claude Code Bash-hook health with one-click repair.
What the gateway enforces
One deterministic gate, six groups of capabilities:
- Execution Gateway — shell commands (Claude Code/Windsurf
PreToolUse
hook + mergen-server exec), edit-time changes, git operations,
ephemeral cloud credentials, CI build verdicts
- AI Safety defaults —
rm -rf, DROP TABLE, terraform destroy,
force-pushes, secret exfiltration, unscoped SQL mutations, infra teardown
- Policy Engine — human-readable, version-controlled rules; Allow /
Hold / Block verdicts; Shadow Mode; sub-1ms local evaluation
- Human Approval — Slack approve/deny, role-based routing, quorum
rules, escalation to on-call
- Team Governance — shared policy sync, RBAC, policy versioning,
SOC 2 / ISO 27001 audit exports, tamper-evident hash-chained log
- Runtime Intelligence — execution visualizer, incident memory,
blunder log, durable per-agent timelines
Install
Install this extension, open the Mergen panel, and click Start Local
Gateway — it installs and runs mergen-server for you, wires up your
editor's hooks, and shows their health in the panel.
Follow the three-step walkthrough (Mergen: Open Getting-Started Walkthrough) for Slack approvals and account sign-in.
Try it: ask your agent to run something destructive. It won't.
Working in a terminal instead?
Mergen has a full terminal mode — the panel and the CLI are two ways to use
the same gateway, so pick one:
npm install -g mergen-server
mergen-server setup --usage-mode cli # Claude Code CLI hook + shell gating
mergen-server doctor # verify hook + gateway health
mergen-server approve <token> # resolve a held action
Settings
| Setting |
Default |
Description |
mergen.serverPort |
3000 |
Port of the local gateway |
mergen.serverPath |
auto |
Path to dist/index.js if not auto-detected |
mergen.autoStartServer |
true |
Start the gateway on activation |
mergen.pollIntervalMs |
2000 |
Panel refresh interval |
Privacy
The gateway binds to localhost only. Policy evaluation, the decision
ledger, and the audit trail never leave your machine unless you configure
an integration (Slack, SIEM, PagerDuty) yourself.
Development
cd vscode-extension
npm install
npm run build # tsc + copy webview assets
Press F5 in VS Code to debug. Package with npm run package.
| |