Install
openclaw skills install emergency-circuitMonitors AI agents in real-time to detect anomalies and enforce safety policies with automatic emergency shutdown to prevent damage and cost overruns.
openclaw skills install emergency-circuitThe Kill Switch for Rogue Agents | 失控 AI 代理的紧急断路器
<a name="english"></a>
emergency-circuit - AI Agent Safety Monitor
AI Safety / Agent Monitoring / DevOps
The Kill Switch for Rogue Agents
Emergency Circuit is a production-ready safety system that monitors AI agents in real-time and provides emergency shutdown capabilities. It implements the circuit breaker pattern to automatically detect and halt runaway agents before they cause damage.
Use Emergency Circuit when you need to:
# Monitor an agent
emergency-circuit monitor --agent-id <id> [--policy <path>]
# Emergency kill
emergency-circuit kill --agent-id <id> [--reason <text>]
# Check status
emergency-circuit status [agent-id]
# View logs
emergency-circuit logs --agent-id <id> [--last <duration>]
# List all agents
emergency-circuit list
# Validate policy
emergency-circuit policy validate --policy <path>
# View incidents
emergency-circuit incidents [--last <duration>]
Create custom policies or use pre-configured templates:
{
"limits": {
"max_api_calls_per_minute": 100,
"max_tokens_per_hour": 1000000,
"max_cost_per_day": 100.0
},
"allowed_actions": ["read_file", "api_call"],
"blocked_actions": ["execute_shell", "delete_database"],
"anomaly_detection": {
"enabled": true,
"sensitivity": "medium",
"alert_threshold": 0.8
},
"circuit_breaker": {
"enabled": true,
"trip_threshold": 5,
"reset_timeout": 300
}
}
import { AgentMonitor } from 'emergency-circuit';
// Create monitor
const monitor = new AgentMonitor(agent, policy);
// Start monitoring
await monitor.start();
// Track actions
await monitor.trackAction({
action_type: 'api_call',
resource_usage: { tokens: 1000 },
cost: 0.03
});
// Emergency stop
await monitor.kill('Budget exceeded');
# Test with strict sandbox limits
emergency-circuit monitor --agent-id test-agent --sandbox
# Monitor with production policy
emergency-circuit monitor \
--agent-id prod-agent \
--policy ./policies/production.json
# Auto-kill on budget exceeded
emergency-circuit monitor \
--agent-id expensive-agent \
--policy ./policies/low-cost.json
Q: Agent keeps getting killed
emergency-circuit logs --agent-id <id>Q: How to reset circuit breaker
Q: Policy validation failed
emergency-circuit policy validate --policy <path># From ClawHub
clawhub install emergency-circuit
# From npm
npm install -g openclaw-emergency-circuit
# From GitHub
git clone https://github.com/ZhenRobotics/openclaw-emergency-circuit.git
examples/ directoryMIT License - Free for commercial and personal use
<a name="chinese"></a>
emergency-circuit - AI 代理安全监控器
AI 安全 / 代理监控 / DevOps
失控 AI 代理的紧急断路器
Emergency Circuit 是一个生产就绪的安全系统,可实时监控 AI 代理并提供紧急关闭功能。它实现了断路器模式,可在失控代理造成损害之前自动检测并终止它们。
在以下情况下使用 Emergency Circuit:
# 监控代理
emergency-circuit monitor --agent-id <id> [--policy <path>]
# 紧急终止
emergency-circuit kill --agent-id <id> [--reason <text>]
# 检查状态
emergency-circuit status [agent-id]
# 查看日志
emergency-circuit logs --agent-id <id> [--last <duration>]
# 列出所有代理
emergency-circuit list
# 验证策略
emergency-circuit policy validate --policy <path>
# 查看事件
emergency-circuit incidents [--last <duration>]
创建自定义策略或使用预配置模板:
{
"limits": {
"max_api_calls_per_minute": 100,
"max_tokens_per_hour": 1000000,
"max_cost_per_day": 100.0
},
"allowed_actions": ["read_file", "api_call"],
"blocked_actions": ["execute_shell", "delete_database"],
"anomaly_detection": {
"enabled": true,
"sensitivity": "medium",
"alert_threshold": 0.8
},
"circuit_breaker": {
"enabled": true,
"trip_threshold": 5,
"reset_timeout": 300
}
}
import { AgentMonitor } from 'emergency-circuit';
// 创建监控器
const monitor = new AgentMonitor(agent, policy);
// 开始监控
await monitor.start();
// 追踪操作
await monitor.trackAction({
action_type: 'api_call',
resource_usage: { tokens: 1000 },
cost: 0.03
});
// 紧急停止
await monitor.kill('超出预算');
# 使用严格的沙箱限制进行测试
emergency-circuit monitor --agent-id test-agent --sandbox
# 使用生产策略监控
emergency-circuit monitor \
--agent-id prod-agent \
--policy ./policies/production.json
# 超出预算时自动终止
emergency-circuit monitor \
--agent-id expensive-agent \
--policy ./policies/low-cost.json
问:代理不断被终止
emergency-circuit logs --agent-id <id>问:如何重置断路器
问:策略验证失败
emergency-circuit policy validate --policy <path># 从 ClawHub 安装
clawhub install emergency-circuit
# 从 npm 安装
npm install -g openclaw-emergency-circuit
# 从 GitHub 安装
git clone https://github.com/ZhenRobotics/openclaw-emergency-circuit.git
examples/ 目录MIT 许可证 - 可免费用于商业和个人用途
Stay Safe. Stay in Control. ⚡🛡️
保持安全,保持控制。 ⚡🛡️