There is a newer version of the record available.

Published September 13, 2026 | Version v1.6.3

ninadphalak/LLM-Shield-Proxy: v1.3.0: Stateless Cryptography, MCP Governance, Air-Gapped Egress, and System Hardening

Authors/Creators

Description

1.6.2 closed the reversible-redaction gap for OpenAI-shaped tool calls and left it open for Anthropic-native ones. That was half a guarantee: an Anthropic tool call still reached the caller carrying a placeholder, on every request rather than at an edge. This finishes it.

| | OpenAI | Anthropic | |---|---|---| | Tool args, non-streaming | ✅ 1.6.2 — escaping added here | ✅ this release | | Tool args, streaming | ✅ 1.6.2 | ✅ this release |

Anthropic non-streaming tool_use.input

_rehydrate_json_response walked content[] looking for a text key. A tool_use block has none, so it was skipped whole and the caller invoked its tool with a placeholder. Its input is a decoded object rather than JSON text, so the string leaves are restored in place and the serializer escapes them on the way out.

Anthropic streamed tool input

Anthropic carries tool arguments as partial_json fragments on a content block — the shape OpenAI carries as function.arguments. Nothing in the tree handled it. The stream translation now opens the call from content_block_start (carrying its id and name once, as an OpenAI-shaped client needs), restores each fragment through that block's own retention window, and drains the window before content_block_stop — the Anthropic counterpart of the finish_reason rule, since the stop event is where the call finishes growing and a tail held past it is parsed against a truncated document.

Anthropic numbers tool blocks in the same space as text blocks, so ordinals are handed out densely from 0 rather than emitting a tool call at index 1 with no index 0 in front of it.

JSON escaping on the non-streaming path

1.6.2 escaped restored values into arguments for the stream only, leaving the same reply behaving differently depending on whether it was streamed. Both paths now share one escaping view.

Also

  • A buffered flush is framed as its own SSE event. Emitted with a single newline it shared the following event's blank line, producing one event with two newline-joined JSON documents that no compliant client can parse — the failure this work exists to prevent, reintroduced in the framing. Caught in review, fixed, and now covered by a test that splits on blank lines the way a client does rather than reading line by line.
  • The tool-input depth bound moved from 8 to 40, matching the ceiling NonStreamingRehydrator already applies to decoded payloads. 8 sat inside the range a legitimate payload can occupy, so a leaf below it kept its placeholder silently. Reaching the bound now logs, naming no node content.

tests/test_response_rehydration.py is new — _rehydrate_json_response had no test coverage at all before this.

Still open

The LiteLLM HTTP shim cannot restore tool calls: LiteLLM's GenericGuardrailAPIResponse has no field to return them. Upstream fix proposed in BerriAI/litellm#41013.

JSON-RPC traffic was never affected — it routes to the stateless v3 engine, whose lexer is field-agnostic.

Notes

If you use this software, please cite it as below.

Files

ninadphalak/LLM-Shield-Proxy-v1.6.3.zip

Files (4.4 MB)

Name Size
md5:6a193c2ec28b85560da3ae09500b60f4
4.4 MB Preview Download

Additional details

Related works