Repository navigation
Home
An agent left alone does not know that it has stopped working, only that it has not stopped.
agent-gateway is a Python package and command line that decides which tasks a coding agent may take, notices when the agent stops making progress, and gives other programs one checked way to dispatch work.
简体中文: agent-gateway 是面向编码智能体的治理工具包:在任务开始前检查任务是否合格、预算是否足够,在运行中发现重复调用和停滞,并以结构化结果返回每一次拒绝。
繁體中文: agent-gateway 是面向程式編碼代理的治理工具包:在任務開始前檢查任務是否合格、預算是否足夠,在執行中發現重複呼叫與停滯,並以結構化結果回傳每一次拒絕。
| What it is | Deterministic governance checks for agents: admission, budgets, watchdog, loop detection, checkpoints, rule packs, and task dispatch |
| Language | Python 3.12 or newer, with a Typer command line |
| Tests | 241 passed, 1 skipped, run on 2026-11-06 on Windows with Python 3.12.10 |
| Status | Version 0.1.0, installed from source. This repository makes no claim of deployment or production use |
| License | Apache-2.0 |
An unattended agent rarely fails by crashing; it fails by carrying on, repeating the same search and spending its allowance long after it has stopped advancing. agent-gateway puts small checks around that behavior, so a task with no stop condition goes back before it starts, the watchdog tells a stalled run to save its state and stop, and every refusal says why. None of these checks calls a model, which means the controls cannot fail in the same way as the thing they control.
- Design of agent control systems: admission, staged budgets, progress watchdogs, and one-way fallback
- Protocol design: JSON task and result packets, enforced with JSON Schema
- A closed rule language with a hand-written parser and three-valued logic, with no
eval - Failure semantics: eleven distinct refusal reasons, each returned as data
- Least-privilege rules for local models: role, privacy class, and write permission
- Test design: 241 passing tests, with a real local HTTP server standing in for Ollama
These are engineering results; no field measurement of money or tokens saved exists.
| Check | Result |
|---|---|
| Full test suite | 241 passed, 1 skipped in 23.54 s |
| Skipped test |
tests/test_live_ollama.py, which needs a pulled local model |
| Offline tour |
examples/quickstart.py exercised all eight stages and exited 0 |
| Refusal paths | Eleven reason codes, tested for validity and for being distinct |
- Getting Started: install it and run the tour
- How It Works: why unattended runs need these controls, with one walkthrough
- Evidence: tests, real output, and known failures
- Design Decisions: the choices made and what they cost
- Limits and Next Steps: what this does not do
Designed and authored by Daniel Boles; implemented with coding agents. Apache-2.0.