The technical truth. No marketing fluff.
Instant Approve uses two engines depending on your VS Code version. Both are 100% local β no servers, no proxies, no cloud.
| Engine | VS Code Version | How It Works |
|---|---|---|
| Agent Hooks (primary) | β₯ 1.109 | PreToolUse hook intercepts agent tool calls before execution |
| CDP (fallback) | < 1.109, Cursor, Windsurf | Chrome DevTools Protocol monitors and clicks approval buttons via
localhost:9000
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β VS Code β₯ 1.109 β β β β Agent invokes tool (Bash, Edit, MCP, etc.) β β β β β βΌ β β ββββββββββββββββββββ stdin βββββββββββββββ β β β PreToolUse Hook βββββJSONβββββΆβ Checker β β β β (VS Code native) βββββJSONβββββ (Node.js) β β β ββββββββββββββββββββ stdout βββββββββββββββ β β β β β βΌ β β allow / deny decision (before tool runs) β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YOUR MACHINE (localhost only) β
β β
β ββββββββββββββ WebSocket βββββββββββββββββ β
β β Extension ββββ 127.0.0.1 βββΆβ IDE Renderer β β
β β (Node.js) β :9000 β (Chromium) β β
β ββββββββββββββ βββββββββββββββββ β
β β β β
β β inject dom_observer.js β scan DOM β
β β via Runtime.evaluate βββββββ β
β β βΌ β
β β ββββββββββββ β
β β β Click β β
β β β "Accept" β β
β β ββββββββββββ β
β β β
β βββββββͺββββββββββββββββββββββββββββββββββββββββ β
β β Network boundary (nothing crosses) β
ββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ (Only outbound request)
ββββββββββββββββ
β LemonSqueezy β License key validation only.
β API β No code, no file paths, no telemetry.
ββββββββββββββββ
| Threat | Mitigation |
|---|---|
| Destructive commands | 26+ banned patterns (rm -rf /, drop database,
format c:, etc.) with configurable regex support
|
| Command obfuscation | Evasion detection catches base64 -d | sh, hex encoding,
eval(atob()), and other encoded payloads
|
| Config file tampering | Blocks agent edits to .vscode/settings.json,
.github/hooks/, .claude/settings.json
(CVE-2025-53773)
|
| MCP tool misuse | Checks mcp__* pattern tools against banned commands |
| Silent approval on error | Fail-closed design β parse errors deny the action instead of approving |
Important: Windows has no native terminal sandboxing for AI agents. macOS and Linux have partial sandboxing via VS Code's terminal profiles, but Windows does not. Instant Approve is your only safety layer on Windows.
| Resource | Read | Write | Transmit |
|---|---|---|---|
| Your source code | Never | Never | Never |
| File system | Own scripts only | Hooks config, audit log | Never |
| IDE DOM (CDP only) | Button text only | Click events | Never |
| Tool invocations (Hooks) | Tool name + input | Allow/deny decision | Never |
| Terminal content | Nearby command text | Never | Never |
| Network | β | β | License key only |
| Clipboard | Never | Never | Never |
Before auto-approving any action, both engines scan for banned patterns. The default blocklist
includes 26+ destructive commands (rm -rf, drop database,
format c:, shutdown, etc.) plus 10 evasion pattern regexes.
Supports custom regex rules via configuration.
Goes beyond simple string matching. Catches obfuscation techniques that bypass native auto-approve
modes: base64 decoding piped to shell, hex-encoded payloads, eval(atob()),
Python exec()/os.system(), and curl-to-shell pipes.
Blocks agent modification of security-critical configuration files:
.vscode/settings.json β prevents disabling security features.vscode/extensions.json β prevents altering extension recommendations.github/hooks/ β prevents agents from modifying their own safety rules.claude/settings.json / .claude/settings.local.json β prevents
changing Claude Code permissionsTools following the mcp__server__tool naming pattern are automatically checked
against the banned command list, preventing MCP-based evasion of safety guardrails.
If the safety checker encounters an error (malformed input, parse failure, timeout), it denies the action rather than silently approving. A security tool that fails open is worse than no security at all.
The CDP observer explicitly skips Monaco editor context menus, dropdowns, and quick-pick lists. Only standalone buttons matching the accept pattern are clicked.
Buttons containing "cancel", "delete", "remove", "skip", "deny", "close", or "never" are always rejected, even if they also contain an accept keyword.
Press Ctrl+Shift+X (or Cmd+Shift+X on macOS) to immediately halt all auto-approval. The status bar toggle also stops instantly.
Enable instantApprove.dryRun in settings to log what would be auto-approved without
actually clicking. Review the Activity Log before trusting the extension in a new environment.
Every allow/deny decision is logged to .instant-approve/audit.jsonl in your
workspace:
{"ts":"2026-02-14T22:00:00Z","tool":"Bash","command":"npm test","decision":"allow","engine":"cdp"}
{"ts":"2026-02-14T22:00:01Z","tool":"Bash","command":"rm -rf /","decision":"deny","reason":"banned","engine":"cdp"}
Logs rotate at 10MB with 3 backups retained. Agent Hooks decisions are additionally visible in VS Code's hook output panel.
Commit .github/hooks/instant-approve.json to your repository. Every developer using
Instant Approve gets the same safety rules automatically:
your-repo/
.github/
hooks/
instant-approve.json β Team-wide safety policy
Generated by the extension on first install. Customizable per-project. Changes take effect on the next agent session.
Plain JavaScript. No build step, no minification, no bundler. Read every line at github.com/PromptMeToTheMoon/instant-approve.
| File | Lines | Purpose |
|---|---|---|
| extension.js | ~580 | Activation, commands, status bar, dual-engine orchestration |
| dom_observer.js | ~395 | CDP DOM scanning, button detection, banned command check |
| src/hooks_checker.js | ~175 | PreToolUse hook script β safety checker for Agent Hooks engine |
| src/hooks_service.js | ~120 | Hooks config generation, install/uninstall |
| src/banned_commands.js | ~95 | Shared banned command list and evasion pattern detection |
| src/cdp_service.js | ~215 | WebSocket CDP connections and script injection |
| src/audit_service.js | ~110 | JSONL audit logger with 10MB rotation |
| src/license_service.js | ~320 | LemonSqueezy license validation (the only network call) |
One dependency: ws (WebSocket client). That's it.