The same response. Again.
Repeated reasoning becomes repeated API calls. AIGate looks for consecutive output replays and closes the loop.
Addressed by Loop BreakerLocal-first agent protection
A lightweight gate between your AI agent and its provider. Catch repetitive responses. Stop forwarding the loop.
127.0.0.1:4317
Pre-alpha Loop Breaker is available. Action Sandbox and Cost Cap are planned. See what’s included
An agent can keep working long after it stops making progress. Put a check in the path of the next request.
Repeated reasoning becomes repeated API calls. AIGate looks for consecutive output replays and closes the loop.
Addressed by Loop BreakerA model provider cannot approve shell commands on your laptop. Command-level protection needs its own layer.
Action Sandbox is plannedMoving between agents fragments your work. Shared memory is a future direction, outside the current release.
Shared memory is not includedBuilt around a stopping point
One local proxy, with an explicit distinction between what works today and what comes next.
Identifies consecutive repeated responses using n-gram fingerprints. Once the threshold is reached, the proxy blocks further requests for its lifetime.
Explore the simulation
Default replay threshold. Configurable in
aigate.toml.
Command-level checks and human approval for sensitive actions. This protection is not enforced in the current release.
Spending limits per session and per day. The current Loop Breaker does not enforce a dollar budget.
Run the scenario with or without a loop breaker.
Simulated
traffic. Illustrative costs. No API calls.
This browser illustration uses a three-response rule. It does not execute the Go detector or terminate a real agent.
Start from the source checkout. Build the proxy, review its configuration, then connect a compatible client.
Go 1.22 or newer is required.
Keep planned protections disabled.
Use the local endpoint and a client token.
go build -o ./bin/aigate ./cmd/aigate
./bin/aigate --config aigate.toml --validate
Builds the local binary and validates the configuration. Validation does not start the proxy.
[server]
listen = "127.0.0.1:4317"
[loopbreaker]
enabled = true
exact_replay_threshold = 3
[sandbox]
enabled = false
[cost]
enabled = false
A partial configuration example. Keep the provider settings from the checked-in file. Enabling unimplemented protections makes requests fail closed.
./bin/aigate --config aigate.toml
Set AIGATE_CLIENT_TOKEN and your provider key in
your environment first. Your client must send the local token as
a Bearer token.
POST /v1/chat/completionsLocal base URLhttp://127.0.0.1:4317/v1
GET /health
200
Body {"status":"ok","version":"0.1.0"}. No auth
required.
POST /v1/chat/completions
200
Forwarded to provider, response inspected before being sent
back. The Loop Breaker runs on every assistant message.
POST /v1/chat/completions (no auth)
401
Missing or wrong
Authorization: Bearer $AIGATE_CLIENT_TOKEN.
POST /v1/chat/completions (loop)
429
3 identical assistant messages → kill. Sticky until the binary
is restarted. Body names the reason.
POST /v1/models
404
Only /v1/chat/completions is forwarded. Other
routes are refused.
GET /v1/chat/completions
405
POST only. The wrong method is rejected before content-type
parsing.
POST /v1/chat/completions (>2 MiB)
413
Body cap is 2 MiB. Larger bodies are refused before
authentication.
The current release is a single, free, Apache 2.0-licensed product. Inspect it, run it locally, make it your own.
Paid plans may follow future features. There is no Pro or Team subscription in the current release.
Provider usage is billed separately by your provider.