You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LangChain handlers fail open on API errors/QUARANTINE and skip non-string tool outputs #7
Residual behaviour in the LangChain integration after #3 (merged at ba0513fc), confirmed by an independent review of the v0.4.0 release PR #6 at 3b72e646d5e5e9aa1996c5cac382537c67143978. Both are documented honestly in the module docstring today; this issue tracks changing the behaviour.
API errors and QUARANTINE let content through, even with raise_on_block=True._http maps every non-2xx response to a ShieldCortexError subclass, and client.py / async_client.py wrap httpx.TimeoutException as ShieldCortexError. The callback handlers log and skip ShieldCortexError, so 401, 429, 5xx and timeouts all fail open. Only raw connection errors propagate. QUARANTINE verdicts are not acted on ("Only BLOCK verdicts act today").
Non-string tool outputs are not scanned.on_tool_end scans only str output (integrations/langchain.py around lines 168-170 and 230-232), so a ToolMessage or other structured output passes unscanned.
Acceptance:
An explicit, documented choice for API-error handling when raise_on_block=True (for example a fail_closed option, or raising on errors when blocking is requested), with sync and async tests for 401, 5xx and timeout.
QUARANTINE either acted on or explicitly configurable, with tests.
ToolMessage / structured tool outputs reduced to text and scanned, with a test using a LangChain fake tool.
Activity
TARSDrakon commentedon Oct 17, 2026
Picked up by the improvement loop (TARS).
fix(langchain): opt-in fail-closed and quarantine blocking; scan stru…