Prevent runaway AI agent costs before they happen.
Features β’ Quick Start β’ Documentation β’ Contributing
Building multi-agent AI systems? You've probably faced these nightmares:
- $500 API Bills: Agent A calls Agent B, which calls Agent A again... infinite loops that drain your wallet
- Priority Chaos: Your "Boss Agent" gets stuck behind hundreds of low-priority logging tasks
- Debugging Hell: Which agent started the loop? Who's spamming the system? Good luck finding out
Halt.rs is a production-grade Rust-based proxy that prevents these disasters before they happen:
- Monitors inter-agent call frequency
- Trips automatically when Agent A triggers Agent B >5 times in 30 seconds without a terminal state
- Returns "Cooling Down" error to save you from API bills
- Configurable thresholds and time windows
- Priority-based task queuing (High/Medium/Low)
- Your "Boss Agent" always gets priority over worker agents
- Automatic throttling during traffic spikes
- Configurable capacity limits
- Real-time swarm topology mapping
- Tracks every "Token Path" so you can see exactly which agent started the loop
- Visual debugging of multi-agent systems
- JSON export for integration with monitoring tools
- Rust Core: High-performance, memory-safe implementation
- Python Bindings: Full async client with Pydantic models
- Java Bindings: JNI-based proxy with comprehensive API
- TypeScript/JavaScript: WASM integration + REST client
- Go Bindings: High-performance fasthttp client
- Native MCP server for IDE integration
- Instant installation in Cursor, VSCode, Zed, JetBrains
- Real-time topology updates via WebSocket
- Comprehensive tool and resource definitions
- Docker: Multi-stage containerization
- CI/CD: GitHub Actions with cross-platform builds
- REST API: Full HTTP server for remote control
- WebSocket: Real-time monitoring and updates
- SQLite: Persistent storage for audit logs and tasks
- CLI Tool: Command-line interface for management
- Plugin System: Extensible architecture for custom strategies
| Feature | Description |
|---|---|
| Circuit Breaker | Prevents infinite loops between agents with configurable thresholds |
| Backpressure Queue | Priority-based task queuing with automatic throttling |
| Audit Logging | Real-time swarm topology mapping with token path tracking |
| REST API | Full HTTP server for remote control and monitoring |
| WebSocket | Real-time updates for topology changes |
| CLI Tool | Command-line interface for management operations |
| MCP Server | Model Context Protocol for IDE integration |
| Plugin System | Extensible architecture for custom implementations |
| Language | Package | Status |
|---|---|---|
| Rust | halt |
β Core |
| Python | halt-py |
β Stable |
| Java | halt-java |
β Stable |
| TypeScript | halt-js |
β Stable |
| Go | halt-go |
β Stable |
| Component | Description |
|---|---|
| Docker | Multi-stage containerization |
| CI/CD | GitHub Actions with cross-platform builds |
| Build Scripts | Comprehensive bash scripts for all platforms |
| Tests | Jest (TS), pytest (Python), cargo test (Rust) |
| Benchmarks | Criterion.rs performance benchmarks |
| Documentation | Comprehensive docs and examples |
# Rust
cargo install halt
# Python
pip install halt-py
# Java
# Add to pom.xml or download JAR
# TypeScript/JavaScript
npm install halt-jshalt serve --port 8080use halt::{CircuitBreaker, BackpressureQueue, AuditLogger};
let breaker = CircuitBreaker::new(5, 30); // 5 calls per 30 seconds
let queue = BackpressureQueue::new(1000);
let logger = AuditLogger::new();
// Register a call
if let Err(err) = breaker.register_call("AgentA", "AgentB", false) {
println!("Circuit tripped: {}", err);
}from halt import HaltClient, Priority
client = HaltClient()
client.push_task("Reasoning", Priority.HIGH, '{"model": "gpt-4"}')
topology = client.get_topology()import { HaltRestClient } from 'halt-js';
const client = new HaltRestClient('http://localhost:8080');
await client.registerCall('AgentA', 'AgentB', false);HaltProxy proxy = new HaltProxy();
String status = proxy.checkBreaker("AgentA", "AgentB");client := halt.NewClient("http://localhost:8080")
resp, err := client.PushTask("Reasoning", halt.PriorityHigh, `{"model": "gpt-4"}`)- REST API: docs/api/api.md
- CLI Commands: docs/cli/commands.md
- Configuration: docs/config/options.md
- Rust: examples/rust/basic_usage.rs
- Python: examples/python/basic_usage.py
- TypeScript: examples/typescript/basic_usage.ts
- Java: examples/java/HaltExample.java
- Go: examples/go/basic_usage.go
- Core: src/core/ - Circuit breaker, queue, audit logger
- API: src/api/ - REST server and WebSocket
- CLI: src/cli/ - Command-line interface
- MCP: src/mcp/ - Model Context Protocol server
- Plugins: src/plugins.rs - Extensible plugin system
Halt.rs can be configured via environment variables:
export HALT_CIRCUIT_THRESHOLD=5
export HALT_CIRCUIT_WINDOW_SECONDS=30
export HALT_QUEUE_CAPACITY=1000
export HALT_DATABASE_PATH=./halt.dbSee config/default.env for all options.
# Run all tests
./scripts/build/build.sh test
# Run specific test suites
cargo test # Rust tests
cd mcp-server && npm test # MCP server tests
cd bindings/python && pytest # Python tests# Build
docker build -t halt-rs:latest -f docker/Dockerfile .
# Run
docker run -d --name halt -p 8080:8080 halt-rs:latestWe welcome contributions! See CONTRIBUTING.md for guidelines.
# Clone
git clone https://github.com/halt-rs/halt.git
cd halt
# Build
./scripts/build/build.sh all
# Test
./scripts/build/build.sh test
# Run dev server
cargo run -- servePrevent runaway loops in complex agent systems
Stop infinite recursive calls before they drain your budget
Ensure critical reasoning tasks aren't blocked by logging
Visual topology maps for understanding agent interactions
Real-time metrics and audit logs for observability
halt-rs/
βββ src/ # Core Rust implementation
β βββ core/ # Circuit breaker, queue, audit logger
β βββ api/ # REST API and WebSocket
β βββ cli/ # Command-line interface
β βββ mcp/ # Model Context Protocol
βββ bindings/ # Language bindings
β βββ python/ # Python bindings
β βββ java/ # Java bindings
β βββ typescript/ # TypeScript bindings
β βββ go/ # Go bindings
βββ mcp-server/ # MCP TypeScript server
βββ docker/ # Docker containerization
βββ docs/ # Documentation
βββ examples/ # Code examples
βββ scripts/ # Build and deployment
βββ tests/ # Integration tests
- Circuit Breaker: <1ΞΌs per call
- Queue Operations: <100ΞΌs push/pop
- Audit Logging: <500ΞΌs per interaction
- Memory Usage: <50MB idle, <200MB with 10k tasks
- Throughput: 10k+ operations/second
See benches/performance.rs for benchmarks.
- Input validation on all API endpoints
- SQL injection protection
- Rate limiting support
- No authentication by default (configure for production)
MIT License - see LICENSE for details
Built with:
- Rust: Core implementation
- Actix-web: HTTP server
- Model Context Protocol: IDE integration
- Tokio: Async runtime
- SQLite: Persistent storage
- GitHub Issues: github.com/halt-rs/halt/issues
- Discussions: github.com/halt-rs/halt/discussions
- Documentation: halt.rs/docs
Made with β€οΈ by the Halt.rs Team