Repository navigation
zn-gate 1.13.1 is a security patch for the Python package. The LangChain callback handler now stops a run when it blocks a tool call, and the new guard_langchain_tool wrapper checks tool arguments and masks secrets in tool output before the model reads them. Upgrade with pip install -U zn-gate. The npm package has no code changes in this release.
Changed
- Upgrade note, Python, LangChain:
ZnGuardCallbackHandler(on_block="return")now raisesValueError. It let blocked calls through, like"ignore". Useguard_langchain_tool(tool, on_block="return")to give the model a block message instead. - Upgrade note, Python, LangChain: with
mask_secrets=True(default) a secret in a tool output now stops the run withGuardBlockError. If you wrap your tools withguard_langchain_tool, create the handler withmask_secrets=Falseso the wrapper hides the secret and the run goes on.
Fixed
- Python, LlamaIndex:
ZnLlamaGuard(on_block="return")let a blocked query through, like"ignore".check_queryandon_query_startnow return a short block message, or the newfallback, in place of the query.sanitize_responsenow also hides secrets in a LlamaIndexResponseobject, not only in text.
Security
- Python, LangChain:
ZnGuardCallbackHandlernow stops the run when it blocks something (GHSA-q7p5-7x6r-fm4r). Before, LangChain caught theGuardBlockErrorraised inside the callback and only logged a warning, so a blocked tool call still ran and a blocked prompt or tool output still reached the model. The handler now setsraise_error = True, which tells LangChain to let the error through. - Python, LangChain: the handler could not hide secrets or replace an injected tool output, because LangChain ignores what a callback returns, so the secret still reached the model. With
mask_secrets=True(default) a tool output that contains a secret now stops the run. The newguard_langchain_tool(tool)wraps a LangChain tool: it checks the arguments before the tool runs and the output before the model reads it, and hides secrets in that output.
How to verify these files: docs/verify-release.md