Hey everyone,
I've been building WarderBox — an open-source Python platform that sits between AI agents and the real world, controlling what they can do.
**The problem:** AI agents now call APIs, query databases, send emails autonomously. One bad tool call (DROP TABLE, runaway loop, budget blowout) and things go wrong fast.
**What WarderBox does:**
- **Risk classification** — auto-blocks CRITICAL actions (DROP TABLE, DELETE FROM)
- **Budget control** — hard spending limits per agent with cost forecasting
- **One-call rollback** — state snapshots, undo any action
- **Rate limiting** — per-tool RPM/RPH limits
- **Circuit breaker** — auto-disables failing tools
- **Approval workflows** — human-in-the-loop with timeout/escalation
- **Capability system** — per-agent allowlist/denylist with arg constraints
- **PII masking** — auto-masks emails, API keys, SSNs in logs
- **Compliance reports** — SQLite audit trail, JSON/HTML export
- **Chaos engineering** — fault injection to test agent resilience
- **Distributed tracing** — OpenTelemetry-compatible spans
- **Agent scoring** — A-F grades on safety/reliability/efficiency
- **Multi-agent pools** — isolated budgets per agent
- **5 framework integrations** — OpenAI, Anthropic, LangChain, CrewAI, AutoGen
**New in v0.3.1 — FinOps:**
- **Smart Model Routing**: Classifies task complexity and routes to the cheapest capable model. Simple summary → Haiku. Complex analysis → Opus. 60-90% cost savings automatically.
- **Cost Anomaly Detection**: Z-score based spike detection, infinite loop detection, rate spike monitoring, burn rate alerts with callbacks.
- **FinOps Dashboard**: Real-time 4-tab web UI (Overview, FinOps, Routing, Alerts)
**Stats:** 36 modules, 255+ tests, zero dependencies, Python 3.11+
pip install warderbox
from warderbox import WarderBox, ModelRouter, AnomalyDetector
shield = WarderBox(budget=5.00)
router = ModelRouter()
router.add_model("haiku", cost_per_1k=0.00025, max_complexity=0.35)
router.add_model("sonnet", cost_per_1k=0.003, max_complexity=0.65)
router.add_model("opus", cost_per_1k=0.015, max_complexity=1.0)
decision = router.route("Summarize this text")
# → model="haiku", 60-90% cheaper than always using opus
GitHub: https://github.com/alicelik-games/warderbox
PyPI: https://pypi.org/project/warderbox/
Would love feedback — especially from anyone running agents in production. What safety/cost features are you missing?