Show HN: Forge – Guardrails take an 8B model from 53% to 99% on agentic tasks
TL;DR Highlight
Wrapping an 8B local model in guardrails lifted its agentic task success from single digits to 84%
Who Should Read
A backend developer running tool-calling agents on small local LLMs who is stuck with failures from malformed tool calls
Core Mechanics
- Guardrails took an 8B model to 84%
- On forge's 26-scenario v0.7.0 eval suite, an 8B local model went from single digits to 84%.
- The model is untouched; only a reliability layer was added around it.
- Sonnet 4.6 also rose from 85% to 98%
- On the same workload, Sonnet 4.6 went from 85% to 98%.
- The Anthropic numbers were measured in v0.6.0 and not re-run in v0.7.0 because of cost.
- Three core mechanisms
- Response validation checks each tool call's name and shape against the request's tools array.
- Rescue parsing converts wrong formats like fenced JSON, Mistral's [TOOL_CALLS], or Qwen's XML into standard OpenAI tool_calls.
- Retry re-calls inference with a corrective message, up to 3 times by default.
- It sits in front of existing clients as a proxy
- It speaks both the OpenAI chat-completions and Anthropic Messages (/v1/messages) APIs.
- opencode, Continue, aider, Cline, and Claude Code can connect without code changes.
- Three ways to use it
- Choose between the proxy server, WorkflowRunner, or guardrails middleware.
- Middleware lets you keep your own loop and only borrow validation, rescue, and step enforcement.
- Proxy mode is single-request only
- Step ordering and prerequisites need a multi-turn workflow definition, so they work only in WorkflowRunner.
- The proxy also does no context compaction or session memory, so window management stays with the client.
Community Reactions
- Concern that speed impact is missing
- One commenter said context management and broken prompt caches matter more than tool-call accuracy for local agents.
- They argued retries and guardrails add latency, yet the metrics focus only on accuracy.
- Experience that semantic errors slip through
- A commenter's feature-request dedupe pipeline produced valid JSON with wrong similarity judgments.
- Retries didn't help, and a deterministic gate based on a separately computed similarity score fixed it.
- Similar results from structural guardrails
- A commenter reported 13B models going from about 20% to 100% on a selection of SWE-bench tasks with per-phase tool restrictions and transition guards.
- They saw a 9B model give up on the complex patch_file tool and switch to the simpler edit_line.
- Doubt about the backend comparison
- A commenter questioned the Mistral-Nemo 12B result (7% on llama-server native function calling vs 83% on Llamafile prompt mode) as not apples-to-apples because of differing setups like system prompts.
- Question about how it differs from existing harnesses
- Commenters asked whether harnesses like opencode or pi already return errors to the model for retry.
- Another opinion was that this resembles workflow automation with predefined step order.
How to Apply
- Point an existing client at the proxy
- Start a local llama-server and run python -m forge.proxy on port 8081.
- Set the API base URL of opencode or aider to http://localhost:8081/v1 and compare tool-call failure rates before and after.
- Add validation and retry to your own loop
- If you already have an agent loop, attach forge's Guardrails middleware for response validation and rescue parsing only.
- Catch unknown tool names and malformed arguments right after each model response.
- Measure retries and latency together
- Vary --max-retries from the default 3 and record success rate alongside response time.
- If your model doesn't need rescue parsing, turn it off with --no-rescue and compare.
- Block semantic errors with a separate gate
- For steps where valid JSON can still be wrong, add a similarity score or rule-based check after the model output.
Try It
# Paste into Claude Code or ChatGPT (simplified version of the method: mimics forge-style validation and retry in a prompt)
You are a tool-calling response validator. Given the tools definition and the model response below, decide:
1) Is the called tool name in the tools list?
2) Do the arguments match the schema (required fields, types)?
3) If violated, write a one-sentence corrective message to send back to the model.
Output only one JSON: {"valid": true/false, "errors": ["..."], "retry_message": "..."}
tools:
{{tools definition JSON}}
model response:
{{the model's tool call response}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques
Related Resources
- https://github.com/antoinezambelli/forge
- https://github.com/deevus/dokimasia
- https://github.com/jsuppe/loom
- https://arxiv.org/abs/2510.22251
- https://statewright.ai/research
- https://swival.dev
- https://bsuh.bearblog.dev/agents-need-control-flow/
- https://news.ycombinator.com/item?id=48051562
- https://github.com/bglusman/wardwright
- https://github.com/itayinbarr/little-coder