← 返回
未分类 中文

exec-guard

Safe command execution for AI agents with timeout control, 8KB ring buffer memory protection, background process management, and multi-agent sharing via HTTP...
为AI代理提供安全命令执行,支持超时控制、8KB环形缓冲区内存保护、后台进程管理以及通过HTTP的多代理共享...
cypress927 cypress927 来源
未分类 clawhub v1.0.6 1 版本 99904.2 Key: 无需
★ 0
Stars
📥 1,043
下载
💾 3
安装
1
版本
#latest

概述

exec-guard - AI Agent Command Execution Module

Safe and reliable system command execution for AI agents.

Quick Start

CLI Mode

echo '{"command": "ls -la"}' | node scripts/dist/index.js

HTTP Service Mode

node scripts/dist/index.js --server --port 8080
curl -X POST http://localhost:8080/exec -H "Content-Type: application/json" -d '{"command": "ls -la"}'

Core Capabilities

CapabilityDescription
-------------------------
Sync ExecutionExecute command with timeout, wait for result
Background ExecutionStart long tasks, get PID, query later
Watch WindowConfirm service startup before returning
8KB Ring BufferHead-Tail dual buffer prevents OOM
Process ManagementQuery status, get logs, terminate processes
Multi-Agent SharingHTTP service allows multiple agents to share state

API Reference

POST /exec

Execute a command:

{
  "command": "required - system command",
  "workingDir": "optional - working directory",
  "timeoutSeconds": "optional - default 30",
  "runInBackground": "optional - default false",
  "watchDurationSeconds": "optional - for service startup",
  "env": "optional - custom environment variables"
}

GET /process/:pid

Query process status.

GET /process/:pid/logs

Get process output logs.

DELETE /process/:pid

Terminate a process.

GET /processes

List all background processes.

Response Status

StatusMeaning
-----------------
successCommand completed, exit code 0
failedCommand failed, non-zero exit
timeoutCommand killed after timeout
killedProcess manually terminated
runningBackground process active

Best Practices

  1. Set reasonable timeout - Prevent stuck commands
  2. Use watch window for services - Confirm startup success
  3. Use background mode for long tasks - Training, data processing
  4. Clean up processes - Terminate when done

Full Documentation

See references/AGENT_GUIDE.md for detailed usage guide and examples.

License

MIT

版本历史

共 1 个版本

  • v1.0.6 当前
    2026-05-03 03:32 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Find Skills

guipi888
场景驱动+关键词双模式技能发现工具。当用户用自然语言描述场景/需求(如"我想做一个海报""帮我分析股票"),或明确说"安装技能/find skills/找个skill"时,自动从官方内置、本地已安装、SkillHub、虾评、GitHub、C
★ 1,482 📥 544,697
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 840 📥 318,114
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,115 📥 836,894