{"data":{"slug":"dipampaul17-agentguard","name":"AgentGuard","tagline":"Real-time guardrail that monitors token spend and manages LLM/agent loops in real time","github_url":"https://github.com/dipampaul17/AgentGuard","owner":"dipampaul17","repo":"AgentGuard","owner_avatar_url":"https://avatars.githubusercontent.com/u/40596409?v=4","primary_language":"JavaScript","stars":173,"forks":11,"topics":["ai-agents","anthropic","anthropic-claude","cost-monitoring","debugging","guardrails","llm","observability","openai","openai-api","prompt-engineering","token-usage"],"archived":false,"github_pushed_at":"2025-07-31T15:20:56+00:00","maintenance_label":"Dormant","stars_delta_30d":2,"url":"https://www.graphcanon.com/tools/dipampaul17-agentguard","markdown_url":"https://www.graphcanon.com/tools/dipampaul17-agentguard.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/dipampaul17-agentguard","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=dipampaul17-agentguard","description":"Real-time guardrail that shows token spend & kills runaway LLM/agent loops.","homepage_url":null,"license":"MIT","open_issues":2,"watchers":2,"ai_summary":"AgentGuard is an application-level monitoring tool written in JavaScript for tracking and controlling the usage of tokens by large language models (LLMs) and AI agents. It provides a budget limit feature to prevent unexpected cost overruns, supports live updates on token pricing, and integrates with various LLM providers including OpenAI and Anthropic.","readme_excerpt":"### 1. Install\n\n```bash\nnpm install agent-guard\n```\n\n---\n\n### Quick Start\n```javascript\n// Step 1: Add these two lines to your AI agent\nconst agentGuard = require('agent-guard');\nawait agentGuard.init({ limit: 25 });  // $25 budget limit\n\n// Step 2: Your existing code works unchanged\nconst response = await openai.chat.completions.create({\n  model: 'gpt-4',\n  messages: [{ role: 'user', content: 'Hello world' }]\n});\nconsole.log('Response:', response); // ← AgentGuard automatically tracks this\n\n// Real-time protection: 🛡️ $12.34 / $25.00 49.4%\n```\n\n---\n\n### Production Deployment\n```javascript\n// Multi-process protection with Redis\nawait agentGuard.init({\n  limit: 1000,\n  mode: 'throw',\n  redis: 'redis://production:6379',\n  webhook: 'https://hooks.slack.com/alerts'\n});\n```\n\n---\n\n### Accurate Cost Calculation\n- **Real tokenizers**: OpenAI's `tiktoken` + Anthropic's official tokenizer\n- **Live pricing**: Fetches current rates from community sources\n- **Streaming support**: Accumulates tokens from partial responses\n- **Multimodal**: Handles images, audio, and complex content\n- **Smart fallback**: Accurate estimation when tokenizers unavailable\n\n---\n\n## 📜 License\n\nMIT - Use anywhere, even commercial projects.","github_created_at":"2025-07-31T02:46:39+00:00","created_at":"2026-07-15T10:43:00.607372+00:00","updated_at":"2026-09-20T04:25:57.912487+00:00","categories":[{"slug":"evaluation-observability","name":"Evaluation & Observability","url":"https://www.graphcanon.com/categories/evaluation-observability","markdown_url":"https://www.graphcanon.com/categories/evaluation-observability.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/evaluation-observability"},{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"}],"tags":[{"slug":"ai-agents","name":"ai-agents"},{"slug":"anthropic","name":"anthropic"},{"slug":"cost-monitoring","name":"cost-monitoring"},{"slug":"observability","name":"observability"}],"trust":{"provenance":{"is_fork":false,"github_id":1029413969,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-12T06:00:15.069Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":407,"last_release_at":null,"stars_delta_30d":2,"open_issues_delta_30d":1},"security_summary":{"status":"findings","scanner":"osv@v1","low_count":2,"high_count":0,"last_scan_at":"2026-07-15T10:43:02.086Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"mcp":{"source":"repo_scan","observed_at":"2026-09-12T06:00:15.692Z","server_manifest":false},"scan":{"source":"repo_scan","observed_at":"2026-09-12T06:00:15.692Z"},"languages":{"value":["javascript"],"source":"github.language+package.json","observed_at":"2026-09-12T06:00:15.692Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-09-12T06:00:15.692Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When you need precise control over spend and want live updates on token prices","For multi-process environments where Redis integration helps manage across processes"],"when_not_to_use":["If you prioritize a different language for your project and cannot use JavaScript","In cases requiring more elaborate fallback mechanisms than what AgentGuard offers"],"source":"enrich:decision_facts","observed_at":"2026-07-17T06:04:19.001Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"AgentGuard is a budget-conscious observer for real-time token spending by AI agents and LLMs, integrating with major providers like OpenAI and Anthropic."}]}}