Skip to main content
Releases

What's new in zn-gate 1.18.0: a Go client, complete evidence exports, safer IPv4 masking

John Silver5 min read

zn-gate 1.18.0 is a small release. It gives Go programs a way to use the optional cloud check, and it fixes two things that could mislead you: a large evidence log that exported as an empty file, and some public IPv4 addresses that the masking left alone. It also reports, and in places refuses, loader variables that stop the hooks on Linux. zn-gate still needs no account and sends nothing by default. Update with npm install -g zn-gate@1.18.0 and pip install -U zn-gate.

Can I check text from a Go program?

Yes. 1.18.0 adds a Go client for the optional zn Cloud API, github.com/usezn/zn/go. zn.NewClient(key).Analyze(ctx, text) checks a tool result, a web page or an email before a model reads it. It sets timeouts, retries and honours Retry-After, returns typed errors (IsRateLimited, IsQuotaExceeded, IsUnauthorized), checks the 20,000 UTF-16 unit limit before it sends anything, and offers SplitForAnalyze for callers that want to send long text in pieces. It uses only the standard library. See the Go client README.

The client talks to the cloud check, so it needs an API key. The local checks of zn-gate do not change, and nothing is sent until your code calls it.

What changed in the evidence export?

zn-gate evidence --export of a large log (over about 512 MB) used to write an empty file and report it as valid. It now reads the log in parts, so every record is exported, and the dashboard export does the same. See Evidence for the log and its chain.

Two more cases are covered:

  • An export that cannot be trusted. In the npm package, an export that cannot read the log to the end, or whose chain does not verify, now says so and exits 1. The Python package reports a non-verifying export and still exits 0.
  • An output path that is the log. evidence --export --output refuses an output path that is the evidence log itself, or a link or hard link to it, and exits 2. Before, the log was emptied and the command could report zero records as valid. Nothing is touched when it refuses.

What changed in IPv4 masking?

The PII scrubber can mask public IPv4 addresses when you turn that on. Some addresses in 192.0.x.x, 198.51.x.x and 203.0.x.x were treated as reserved although they are public. Now only the reserved blocks (192.0.0.0/24, 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24) are left alone, and every other address in those ranges is masked as a public address. See the scrubber.

What changed for loader variables on Linux?

On Linux, two settings of the dynamic loader, LD_TRACE_LOADED_OBJECTS and LD_DEBUG=help, make the system stop every program the agent starts before its first line runs, the shell of each zn hook included. The hook never runs, so it cannot check or block anything, and most agents let the call go ahead. 1.18.0 does three things about it:

  • zn audit reports it. A project that sets either variable for the agent (Claude Code env, a committed .env, Codex shell_environment_policy.set) is reported as critical. In the env of a single MCP server it is medium, because only that server fails to start.
  • The hooks refuse the edit. A file write or shell command from the agent that would put either variable into a project .env or .gemini/.env (Write, Edit, patches, echo, printf, tee, sed -i and similar) is refused, while the hooks still work.
  • A static launcher closes it for Claude Code and ZCode on Linux. A user install for Claude Code or ZCode on Linux (x64 and arm64) starts the hook through a small statically linked launcher that denies the call when LD_TRACE_LOADED_OBJECTS is set, or when LD_DEBUG, LD_DEBUG_OUTPUT or a preload variable such as LD_PRELOAD has a value, and removes the other loader variables before it starts the hook. If no launcher matches the machine, or the copy installed in the zn hooks folder does not answer its test run as expected, the install keeps the earlier hook and says so. It was checked with a real Claude Code 2.1.331 on x86_64 Linux; the arm64 launcher is built but has not been run with a real agent.

Every other agent is detection only: Antigravity (until its launch form is run with the real agent), Codex CLI, Gemini CLI and GitHub Copilot CLI (Gemini CLI and Copilot CLI hooks are experimental), and Cursor is not verified. Project installs, and Linux on other processors, keep the shell form too. See the threat model.

What changes for me if my project has a .env file?

Some shell commands that name a project .env or .gemini/.env behave differently:

  • source .env and . .env are refused. They run the file as shell code, so a line in it could be a command and not only a value. To load the values, use a loader that only reads the file: node --env-file=.env, docker run --env-file .env, docker compose --env-file .env or npx dotenv -e .env --. These still work.
  • python3 -m venv .env is refused. zn cannot tell whether a program that names .env writes it, and a virtual environment is a folder that the program fills with files. Give the virtual environment another name, such as .venv.
  • Other shell writes to .env are refused too (echo >> .env, tee, sed -i, cp). Edit the file with the agent's editor tool: zn checks what it writes.

Is anything breaking?

Not for most people. A script that read exit code 0 from zn-gate evidence --export in the npm package, even when the log could not be read to the end or its chain did not verify, will now see 1. That is the point of the change.

How do I update?

npm install -g zn-gate@1.18.0
pip install -U zn-gate
npx -y zn-gate@1.18.0 check

If your package manager skips install scripts (npm install --ignore-scripts, pnpm or bun), or you updated with sudo, run zn hooks install <agent> again for each agent you use.

Gemini CLI and Copilot CLI have experimental hooks and are listed apart from the six supported agents.

The full list is in the changelog.