← Hacker News

Show HN: Built an open-source local firewall for AI coding agents

Hacker News · ashishp15 · June 9, 2026
Guardian Runtime is an open-source local proxy that intercepts communications between AI coding agents and LLM APIs to provide cost control and security features. The tool enforces hard spending budgets to halt agents in retry loops, scans outgoing requests for leaked API keys and personally identifiable information, and optimizes system prompts to reduce API output costs by 40-70 percent. It runs entirely on the user's machine and supports OpenAI, Anthropic, and Gemini out of the box.

Detailed Analysis

Guardian Runtime is an open-source, locally-deployed proxy tool designed to sit between AI coding agents — such as Claude Code, Cursor, and Aider — and their upstream large language model APIs. Developed by a developer going by the handle ashp15205, the project is installable via pip and routes agent traffic through localhost:8080, intercepting outbound API calls before they reach services like Anthropic, OpenAI, or Google Gemini. The tool addresses three distinct problem categories: runaway cost accumulation from retry loops, accidental exfiltration of sensitive data such as API keys and personally identifiable information, and inefficient token consumption driven by verbose system prompts.

The cost-control mechanism operates by enforcing hard daily spend limits and automatically terminating an agent's internet access when those thresholds are breached, a safeguard particularly relevant when agents enter infinite retry loops or malfunction in ways that generate unexpected API call volumes. The security scanning layer inspects outbound requests in real time and drops any that contain pattern-matched sensitive data before they leave the local machine. The "Terse Mode" feature rewrites system prompts to constrain response length, with the developer claiming a 40–70% reduction in output token costs — a meaningful figure given that output tokens are typically billed at higher rates than input tokens across major API providers.

The significance of this project lies in the growing operational complexity of agentic AI workflows. As developers increasingly delegate multi-step coding tasks to autonomous agents, the attack surface and cost exposure expand considerably compared to simple, single-turn LLM queries. An agent executing a long task may make dozens or hundreds of API calls, and without guardrails, a single misbehaving session can exhaust a monthly budget or inadvertently transmit secrets embedded in code or configuration files that the agent reads from disk. Guardian Runtime attempts to address these risks at the infrastructure layer rather than requiring changes to individual agent implementations.

The project reflects a broader emerging category of tooling sometimes described as "AI agent infrastructure" or LLMOps, which has grown rapidly alongside the proliferation of agentic development tools. Similar concerns about cost governance and data leakage have prompted cloud vendors and enterprise software providers to build comparable controls into managed platforms, but Guardian Runtime's local-first, zero-cloud-dependency architecture positions it specifically for developers who handle sensitive codebases or operate under strict data residency requirements. The tool's explicit support for Claude Code — Anthropic's terminal-based agentic coding product — is notable, as that product has seen substantial adoption since its release and represents exactly the kind of long-running, autonomous workflow that generates the cost and security risks the proxy targets.

The open-source release via GitHub and the invitation for community stress-testing suggests the project is in an early but functional state, seeking both adoption and adversarial validation. The approach of building a transparent, inspectable proxy rather than a closed-source SaaS product aligns with developer community expectations around trust when a tool is handling sensitive credentials and intercepting all LLM communications. Whether the pattern-matching approaches used for PII and secret detection are robust enough to catch sophisticated or obfuscated leakage cases remains an open technical question, and community feedback will likely surface edge cases the initial release does not cover.

Read original article →