← 返回 Skills 市场
zhenstaff

emergency circuit

作者 Justin Liu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
285
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install emergency-circuit
功能描述
Monitors AI agents in real-time to detect anomalies and enforce safety policies with automatic emergency shutdown to prevent damage and cost overruns.
使用说明 (SKILL.md)

Emergency Circuit - SKILL Documentation

The Kill Switch for Rogue Agents | 失控 AI 代理的紧急断路器


English | 中文


\x3Ca name="english">\x3C/a>

🇬🇧 English

SKILL Name

emergency-circuit - AI Agent Safety Monitor

Category

AI Safety / Agent Monitoring / DevOps

Tagline

The Kill Switch for Rogue Agents

Description

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.

When to Use This SKILL

Use Emergency Circuit when you need to:

  • Monitor AI agents - Track resource usage, API calls, and costs
  • Enforce safety policies - Set hard limits on agent behavior
  • Prevent runaway costs - Auto-kill when budget exceeded
  • Detect anomalies - Identify suspicious behavioral patterns
  • Test safely - Sandbox mode for development
  • Production monitoring - Enterprise-grade agent oversight

Core Capabilities

1. Real-time Monitoring

  • Track API calls, token consumption, and execution time
  • Monitor costs across providers (OpenAI, Anthropic, etc.)
  • Session-based statistics and health scores

2. Circuit Breaker

  • Three states: CLOSED (normal), OPEN (halted), HALF_OPEN (testing)
  • Automatic failure detection and recovery
  • Configurable trip thresholds

3. Policy Engine

  • Resource limit enforcement (API calls, tokens, cost)
  • Action whitelisting and blacklisting
  • Anomaly detection with configurable sensitivity

4. Emergency Controls

  • Instant kill switch
  • Pause/resume capabilities
  • Manual override controls

Command Reference

# Monitor an agent
emergency-circuit monitor --agent-id \x3Cid> [--policy \x3Cpath>]

# Emergency kill
emergency-circuit kill --agent-id \x3Cid> [--reason \x3Ctext>]

# Check status
emergency-circuit status [agent-id]

# View logs
emergency-circuit logs --agent-id \x3Cid> [--last \x3Cduration>]

# List all agents
emergency-circuit list

# Validate policy
emergency-circuit policy validate --policy \x3Cpath>

# View incidents
emergency-circuit incidents [--last \x3Cduration>]

Safety Policies

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
  }
}

Integration Example

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');

Use Cases

Development & Testing

# Test with strict sandbox limits
emergency-circuit monitor --agent-id test-agent --sandbox

Production Monitoring

# Monitor with production policy
emergency-circuit monitor \
  --agent-id prod-agent \
  --policy ./policies/production.json

Cost Control

# Auto-kill on budget exceeded
emergency-circuit monitor \
  --agent-id expensive-agent \
  --policy ./policies/low-cost.json

Troubleshooting

Q: Agent keeps getting killed

  • Check policy limits in your policy file
  • Review logs: emergency-circuit logs --agent-id \x3Cid>
  • Try sandbox mode for testing

Q: How to reset circuit breaker

  • Circuit auto-resets after timeout
  • Or restart monitoring session

Q: Policy validation failed

  • Use: emergency-circuit policy validate --policy \x3Cpath>
  • Check JSON syntax and required fields

Requirements

  • Node.js ≥18.0.0
  • TypeScript 5.7+ (for development)
  • Git (for installation from source)

Installation

# 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

Support

License

MIT License - Free for commercial and personal use


\x3Ca name="chinese">\x3C/a>

🇨🇳 中文

技能名称

emergency-circuit - AI 代理安全监控器

分类

AI 安全 / 代理监控 / DevOps

标语

失控 AI 代理的紧急断路器

描述

Emergency Circuit 是一个生产就绪的安全系统,可实时监控 AI 代理并提供紧急关闭功能。它实现了断路器模式,可在失控代理造成损害之前自动检测并终止它们。

何时使用此技能

在以下情况下使用 Emergency Circuit:

  • 监控 AI 代理 - 追踪资源使用、API 调用和成本
  • 执行安全策略 - 对代理行为设置硬性限制
  • 防止成本失控 - 超出预算时自动终止
  • 检测异常 - 识别可疑的行为模式
  • 安全测试 - 开发时使用沙箱模式
  • 生产监控 - 企业级代理监督

核心能力

1. 实时监控

  • 追踪 API 调用、Token 消耗和执行时间
  • 监控跨提供商的成本(OpenAI、Anthropic 等)
  • 基于会话的统计和健康评分

2. 断路器

  • 三种状态:CLOSED(正常)、OPEN(暂停)、HALF_OPEN(测试)
  • 自动故障检测和恢复
  • 可配置的触发阈值

3. 策略引擎

  • 资源限制执行(API 调用、Token、成本)
  • 操作白名单和黑名单
  • 可配置灵敏度的异常检测

4. 紧急控制

  • 即时终止开关
  • 暂停/恢复功能
  • 手动覆盖控制

命令参考

# 监控代理
emergency-circuit monitor --agent-id \x3Cid> [--policy \x3Cpath>]

# 紧急终止
emergency-circuit kill --agent-id \x3Cid> [--reason \x3Ctext>]

# 检查状态
emergency-circuit status [agent-id]

# 查看日志
emergency-circuit logs --agent-id \x3Cid> [--last \x3Cduration>]

# 列出所有代理
emergency-circuit list

# 验证策略
emergency-circuit policy validate --policy \x3Cpath>

# 查看事件
emergency-circuit incidents [--last \x3Cduration>]

安全策略

创建自定义策略或使用预配置模板:

{
  "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 \x3Cid>
  • 尝试沙箱模式进行测试

问:如何重置断路器

  • 断路器会在超时后自动重置
  • 或重新启动监控会话

问:策略验证失败

  • 使用:emergency-circuit policy validate --policy \x3Cpath>
  • 检查 JSON 语法和必需字段

系统要求

  • Node.js ≥18.0.0
  • TypeScript 5.7+(用于开发)
  • Git(用于从源代码安装)

安装

# 从 ClawHub 安装
clawhub install emergency-circuit

# 从 npm 安装
npm install -g openclaw-emergency-circuit

# 从 GitHub 安装
git clone https://github.com/ZhenRobotics/openclaw-emergency-circuit.git

技术支持

许可证

MIT 许可证 - 可免费用于商业和个人用途


Stay Safe. Stay in Control. ⚡🛡️

保持安全,保持控制。 ⚡🛡️

安全使用建议
This skill's docs promise powerful monitoring and an emergency kill switch but the package you were given is only documentation — no code or declared credentials — and the docs reference installing code from npm/GitHub. Before installing or running anything: 1) ask the publisher for the canonical repository and package name and verify the author/organization; 2) review the actual code (npm package or GitHub repo) to see what it will do and what credentials it requires; 3) never provide admin/platform tokens or cloud provider keys until you understand exactly where they are used and stored; 4) prefer running it first in an isolated sandbox account with least privilege and test kills safely; 5) if you must install from npm or git, audit the package and check integrity (checksums, recent commits, issues) and avoid blindly running 'npm install -g' from an unknown source. The current bundle is incomplete and inconsistent — treat it as untrusted until you can inspect the real implementation and its required permissions.
功能分析
Type: OpenClaw Skill Name: emergency-circuit Version: 1.0.0 The 'emergency-circuit' skill bundle is a safety-oriented tool designed to monitor AI agents and provide an emergency 'kill switch' to prevent runaway costs or actions. The documentation (skill.md and readme.md) describes legitimate administrative functions such as monitoring API usage, enforcing resource limits, and terminating processes based on safety policies. No evidence of malicious intent, data exfiltration, or harmful prompt injection was found in the provided metadata or instructions.
能力评估
Purpose & Capability
The skill describes monitoring multiple LLM providers, tracking costs, and performing emergency shutdowns, but the registry metadata declares no required environment variables, no config paths, and no primary credential. A monitoring/kill system would normally need provider API keys and platform/admin credentials; their absence is an unexplained mismatch. The SKILL.md also references an npm package and GitHub repo, while the registry lists no install spec or source — another inconsistency.
Instruction Scope
The SKILL.md instructs use of a CLI (emergency-circuit monitor/kill/status), npm install and git clone, and shows a TypeScript integration example, yet the skill bundle contains no code and no concrete integration/authentication steps. The docs do not specify how the tool authenticates to agents/providers or what 'kill' actually does (kill a process, call a controller API, revoke tokens?). The policy example mentions blocking 'execute_shell' while the docs show shell commands, a contradictory instruction set.
Install Mechanism
There is no install spec in the registry (skill is instruction-only), but SKILL.md recommends installing from npm or cloning a GitHub repo. That means the real install mechanism is unspecified in the bundle; following those instructions would fetch and run third-party code. Because the registry did not provide the package source or a vetted install spec, the user would have to trust an external npm/GitHub package before auditing it.
Credentials
A monitoring and kill system that tracks OpenAI/Anthropic usage and can stop agents would normally require multiple credentials (provider API keys, agent-controller/admin tokens). The skill declares none. This is disproportionate: either the skill is non-functional as packaged, or it implicitly expects access to sensitive credentials that it does not enumerate — both are red flags.
Persistence & Privilege
The skill is not marked 'always' and is user-invocable, so it doesn't demand forced persistence. However, its described functionality would require elevated privileges (ability to stop agents, access billing data), and the bundle does not declare how those privileges are obtained or limited. Lack of declared privilege requests makes it unclear what authority the tool would actually have if installed.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install emergency-circuit
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /emergency-circuit 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Emergency Circuit 1.0.0 — Initial Release - Introduces a real-time safety monitoring system for AI agents with emergency kill switch capabilities. - Implements a configurable circuit breaker pattern to detect and halt runaway or anomalous agents. - Includes policy enforcement, anomaly detection, resource usage tracking, and manual override controls. - Provides clear CLI commands for monitoring, emergency shutdown, and incident review. - Supports custom policy templates and offers both English and Chinese documentation. - Ready for production with integration examples and troubleshooting guidance.
元数据
Slug emergency-circuit
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

emergency circuit 是什么?

Monitors AI agents in real-time to detect anomalies and enforce safety policies with automatic emergency shutdown to prevent damage and cost overruns. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 285 次。

如何安装 emergency circuit?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install emergency-circuit」即可一键安装,无需额外配置。

emergency circuit 是免费的吗?

是的,emergency circuit 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

emergency circuit 支持哪些平台?

emergency circuit 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 emergency circuit?

由 Justin Liu(@zhenstaff)开发并维护,当前版本 v1.0.0。

💬 留言讨论