Show HN: AgentGuard โ€“ Auto-kill AI agents before they burn through your budget

https://news.ycombinator.com/rss Hits: 7
Summary

๐Ÿ›ก๏ธ AgentGuard ๐Ÿšจ The Problem Your AI agent has a bug. It makes 1000 API calls in a loop. Your $2000 credit card gets charged. This happens to developers every week: Infinite loops in AI workflows Testing with production API keys Agents that don't know when to stop One typo = hundreds of dollars gone Existing tools only tell you after the damage is done. ๐Ÿ’ก The Solution AgentGuard automatically kills your process before it burns through your budget. // Add 2 lines to any AI project: const agentGuard = require ( 'agent-guard' ) ; await agentGuard . init ( { limit : 50 } ) ; // $50 budget limit // Your code runs normally until it hits $50, then AgentGuard stops it const response = await openai . chat . completions . create ( { ... } ) ; Result: Instead of losing $2000, you lose $50 and get a detailed report. ๐Ÿ”„ How It Works graph TD A["๐Ÿค– Your AI Agent Starts"] --> B["๐Ÿ“ฆ AgentGuard.init({ limit: $50 })"] B --> C["๐Ÿ” Monitors All AI API Calls"] C --> D["๐Ÿ’ฐ Tracks Real-Time Costs"] D --> E{"๐Ÿ’ธ Cost โ‰ฅ $50?"} E -->|No| F["โœ… Continue Running"] E -->|Yes| G["๐Ÿ›‘ Emergency Stop"] F --> C G --> H["๐Ÿ“Š Show Savings Report"] H --> I["๐Ÿ’พ Log Final Statistics"] style A fill:#e1f5fe style B fill:#f3e5f5 style C fill:#fff3e0 style D fill:#fff3e0 style E fill:#ffebee style G fill:#ffcdd2 style H fill:#e8f5e8 Loading Real-Time Monitoring sequenceDiagram participant App as ๐Ÿค– Your App participant AG as ๐Ÿ›ก๏ธ AgentGuard participant API as ๐Ÿ”— AI API participant User as ๐Ÿ‘ค Developer App->>AG: init({ limit: $50, mode: "throw" }) AG->>App: โœ… Protection Active loop Every AI Call App->>API: API Request (OpenAI/Anthropic) API->>App: Response + Usage Data AG->>AG: ๐Ÿ’ฐ Calculate Cost ($0.0243) AG->>AG: ๐Ÿ“Š Update Total ($47.23 / $50) alt Cost Under Limit AG->>App: โœ… Continue else Cost Exceeds Limit AG->>App: ๐Ÿ›‘ throw AgentGuardError AG->>User: ๐Ÿ“ฑ Webhook Notification AG->>User: ๐Ÿ’ฐ "Saved you ~$200!" end end Loading Protection Modes graph LR subgraph "๐Ÿ› ๏ธ Protection Modes" A["mode: 'throw'<br/>๐Ÿ›ก๏ธ Safest"] B["mode: 'notify'...

First seen: 2025-07-31 06:57

Last seen: 2025-07-31 12:59