Skip to content
Muhammet Şafak
tr
Cover — on a dark background Tan, the indigo beaver, looks at the laptop in its hands; the chain link joining the laptop to a server rack is broken in the middle

AgentFuse: putting a circuit breaker on an agent's tool calls

A proxy between an agent and its MCP servers that cuts semantic loops, budget overruns and risky tool calls; its default mode only observes.

What it does today

Sits between an agent and its MCP server, sees every tools/call, and stops repeating loops, sessions that exceed a duration or call budget, and tools the policy forbids. Anyone running agents that call tools over MCP can try it with `npm i -g @tunedness/agentfuse` (0.1.0).

Started
September 2026 — Ongoing

Form

Open-Source

Technologies

TypeScript Node.js MCP ONNX Runtime YAML

The first measurement of my loop breaker missed its target: on a 200-session synthetic corpus, 87.0% detection and 0.0% false positives. The target was 90%. Closing the last three points meant lowering the threshold to 0.845, which pushed false positives to 16%, so I did not lower it. This entry is about that trade and the tool that makes it: AgentFuse.

A proxy between the agent and the server

AgentFuse is an MCP proxy. It sits between the agent and a tool server, sees every tools/call, and decides whether the call goes through. If nothing trips, the result flows straight through; if something does, the agent gets a refusal it can read and act on instead of another wasted round trip. As long as the agent reaches its tools over MCP, it does not matter whether it is LangGraph, CrewAI, the Claude Agent SDK or a hand-written loop; no code changes on either side. Behaviour lives in one fusepolicy.yaml: loop thresholds, budget limits and per-tool allow / warn / deny / require_approval rules.

The default mode is warn. It computes every decision, builds the report and forwards the call anyway. A circuit breaker that cuts in the wrong place gets removed, and then it catches nothing; a loop it misses is only expensive. The would_trip count on your own traffic tells you whether enforce is safe.

Catching a loop in two tiers

The first tier is rule-based and needs no model or network: a byte-identical repeat of the same arguments (with the results agreeing too), the same error signature repeated, and short cycles like A→B→A→B. The second tier is semantic: each call is embedded locally, off the hot path, and the sliding-window score is the smaller of the average pairwise cosine similarity and answer staleness. One axis was not enough: on similarity alone the positive sessions sat below the negatives, with page 1 versus page 2 of a paginated search scoring 0.9971 and a genuine reworded retry scoring 0.9791. Staleness separates that pair. The semantic tier needs the optional @tunedness/agentfuse-embeddings-local package.

What I measured

The corpus is committed to the repository: 100 positive and 100 negative sessions from a seeded generator. At the operating point I calibrated (window: 5, threshold: 0.905) detection is 87.0%, false positives 0.0%, precision 1.000, and detection latency p95 is 5 turns. All 13 sessions I missed are one scenario: the same request repeated in different words. Added latency per call, in the worst configuration I measured (a real stdio pipe, semantic tier and telemetry both on), is 4.84 ms at p95.

On budgets, two limits are exact: max_duration and max_calls. Token and dollar limits are estimates, because a proxy on tools/call does not see the model’s own tokens; those figures are a lower bound on real usage and carry _estimated in their names.

What it covers in alpha, and what is next

Alpha. @tunedness/agentfuse is on npm as 0.1.0: npm i -g @tunedness/agentfuse installs the agentfuse command, and it needs Node.js ≥ 20.19. Protection is in wrap mode, in front of a wrapped stdio server; the serve command currently binds the HTTP endpoint and resolves the session identity but does not forward calls; every request gets an error pointing to wrap mode; it is not a guarded gateway. It does not see agent traffic that does not use MCP.

Next is getting detection to 90%. Both routes are known: a second tier for windows near the threshold, or a stronger embedding model, which reopens the install-size decision. For the security side of the same family, see the McpGuard entry.

Tags: #ai#agent#mcp#circuit-breaker
Share:

More Records

All records

A proxy between an agent and its MCP servers: scans results for injection, masks PII, enforces access and logs decisions to a hash-chained audit log.

What it does today

Sits between an agent and its MCP servers over stdio (`wrap`) or HTTP (`serve`), scans tool results and resource contents for prompt injection, masks personal data, enforces access by tool, role and dangerous capability combination, pins a server's tool definitions and writes every decision to a hash-chained audit log. Anyone wiring MCP servers into agents can try it by cloning and building the repository; it is not published on npm.

Open-Source TypeScript Node.js MCP +2 more
September 2026 — Ongoing

Build notes on serving the documentation of many projects from one multi-tenant server, each with its own MCP endpoint and documents kept on your machine.

What it does today

Makes a project's folder, git repository, Obsidian vault or Notion workspace searchable behind a single MCP endpoint, so an agent reaches the documentation without the data going to a third party. Anyone who can run Docker can host it and manage it from the dashboard.

Open-Source Web TypeScript Node.js Fastify +6 more
August 2026 — September 2026

A CLI that solves a problem repeatedly in isolated sessions and measures how diverse the solution paths are, with JSON and HTML reports. Not on PyPI.

What it does today

Has a model solve the problems of a suite YAML repeatedly in isolated sessions, measures how diverse the solution paths are and how much accuracy drops when a problem is changed on the surface, writes a JSON and HTML report per problem and fails CI on suspected memorization. Engineers choosing a model or checkpoint, or producing fine-tuning data, can clone the repository and install it with uv; it is not on PyPI.

Open-Source Python Typer Pydantic +3 more
November 2026 — Ongoing

Search the site

Start typing to search posts, projects and pages.

Esc to close Powered by Pagefind