Valid JSON isn't enough: pinning side-effect targets to stop LLM agents from acting on untrusted data
demirtasfurkan_ · reddit · 2026-11-24
Schema validation isn't the finish line for LLM outputs. The author breaks down three failure modes where valid JSON still damages production agents: silent hallucinations (plausible but ungrounded fields), cross-field contradictions, and untrusted target/provenance drift where an agent picks up a recipient, ID, or path from retrieved text right before a side effect runs.
In the open-source Python repo neuroformatting, the author combines Pydantic v2 validation with pre-execution target pinning (PinnedTarget / guardsideeffect), so side-effecting actions only run when the target's provenance and allowed IDs match what was pinned. A runnable demo (examples/quickauditdemo.py) shows allowed vs. blocked cases (UNTRUSTEDTARGETSOURCE, UNPINNEDTARGETID), plus failure scenarios in examples/productionfailures.py. The post ends by asking how others enforce provenance/allowlists before tool/API execution.
More from coding & agent
- Claude Code redesigns desktop side panel: Files, Changes and Terminal now open as tabs — ClaudeDevs · 2026-11-24
- Extraction models as verifiers: making agents prove every answer points back to its source — omarsar0 · 2026-11-24
- Qoder lands stealth coding model HungerG, identity undisclosed, free until Nov 30 — alifcoder · 2026-11-24
- Running Claude Code and Codex on the same mounted workspace—so far, no mess — Powermadlux · 2026-11-24
- Anthropic launches Claude Ship beta: Claude reviews PRs, pushes fixes, and approves merges — ClaudeDevs · 2026-11-24
- Firecrawl Tops AIR WebSec Benchmark of 8 Search APIs at 21.59, You.com Ranks Last — devdigest · 2026-11-24