EctoClaw — Cryptographic Audit Ledger & AI Firewall for OpenClaw
Configuration
- - ECTOCLAW_URL: The EctoClaw server URL (default: http://localhost:3210)
Source code and install scripts are fully open-source at https://github.com/EctoSpace/EctoClaw.
Security / authentication
- - EctoClaw is designed to run on localhost or a private network you control.
- If you expose ECTOCLAWURL beyond localhost, put it behind your own authentication and access controls (for example, a reverse proxy with auth).
- Do not point ECTOCLAWURL at an untrusted third-party host, since audit logs can contain sensitive prompts, tool outputs, and memory contents.
Commands
List Audit Sessions
When the user asks to see audit sessions, list recent sessions, or check audit history:
- - Call GET {ECTOCLAW_URL}/api/sessions?limit=10
- Format the response as a readable list showing session ID, status, event count, and goal
Create Audit Session
When the user asks to start a new audit, create a session, or begin tracking:
- - Call POST {ECTOCLAWURL}/api/sessions with JSON body: {"goal": ""}
- Optionally include "policyname" to bind a policy: {"goal": "", "policy_name": ""}
- Report the session ID, goal hash, and public key
Append Event
When the user wants to log an action, record an event, or track an operation:
- - Call POST {ECTOCLAWURL}/api/sessions/{sessionid}/events
- JSON body: {"type": "", "payload": {}}
- Valid types: MessageReceived, MessageSent, SkillInvoked, SkillResult, ToolCall, ToolResult, PluginAction, PluginResult, ModelRequest, ModelResponse, MemoryStore, MemoryRecall, ApprovalRequired, ApprovalDecision
- Report the content hash, sequence number, and Ed25519 signature
Verify Session Integrity
When the user asks to verify a session or check chain integrity:
- - Call GET {ECTOCLAWURL}/api/sessions/{sessionid}/verify
- Report whether the hash chain is verified or broken and how many events were checked
Get Session Details
When the user asks about a specific session:
- - Call GET {ECTOCLAWURL}/api/sessions/{sessionid}
- Show full session details including goal, goal hash, status, policy, timestamps, event count, and public key
Seal a Session
When the user asks to finalize, seal, or close an audit session:
- - Call POST {ECTOCLAWURL}/api/sessions/{sessionid}/seal
- Report the sealed status and final Merkle root
Get Audit Metrics
When the user asks for metrics, statistics, or a summary:
- - Call GET {ECTOCLAW_URL}/api/metrics
- Display total sessions, active sessions, sealed sessions, total events, and event type breakdown
Get Compliance Bundle
When the user asks for a compliance report or Merkle proof:
- - Call GET {ECTOCLAWURL}/api/sessions/{sessionid}/compliance
- Show the Merkle root and event hashes
Get Merkle Proof for Specific Event
When the user asks to prove a specific event exists in the chain:
- - Call GET {ECTOCLAWURL}/api/sessions/{sessionid}/merkle?leaf={event_index}
- Show the Merkle root and inclusion proof path
Verify a Merkle Proof
When the user provides a Merkle proof to verify:
- - Call POST {ECTOCLAW_URL}/api/merkle/verify with the proof data
- Report whether the proof is valid
Generate Audit Report
When the user asks for a full audit report:
- - Call GET {ECTOCLAWURL}/api/reports/{sessionid}?format=json
- For HTML: GET {ECTOCLAWURL}/api/reports/{sessionid}?format=html
- Present the complete session report with events and verification status
List Policies
When the user asks about active policies or what rules are configured:
- - Call GET {ECTOCLAW_URL}/api/policies
- Show each policy name and its configuration
Create or Update a Policy
When the user wants to set up audit rules:
- - Call PUT {ECTOCLAW_URL}/api/policies/{name} with {"content": ""}
- Report the saved status
Stream Live Events
When the user wants real-time monitoring:
- - Connect to GET {ECTOCLAW_URL}/api/stream (Server-Sent Events)
- Report events as they arrive
Check Server Health
When the user asks if EctoClaw is running:
- - Call GET {ECTOCLAW_URL}/health
- Report status, version, and name
What EctoClaw records
Every OpenClaw lifecycle event is captured as a signed ledger entry:
| Event Type | What it captures |
|---|
| MessageReceived | Inbound messages from any channel |
| MessageSent |
Outbound agent responses |
| SkillInvoked | Skill activation with parameters |
| SkillResult | Skill execution output |
| ToolCall | Tool invocations (shell, file, http, browser) |
| ToolResult | Tool execution results and observations |
| PluginAction | Plugin lifecycle events |
| ModelRequest | LLM API calls with prompt context |
| ModelResponse | LLM responses |
| MemoryStore | Memory write operations |
| MemoryRecall | Memory read operations |
| PolicyViolation | Blocked or flagged actions |
| ApprovalRequired | Human-in-the-loop gate triggered |
| ApprovalDecision | Human approval or denial recorded |
| SessionSeal | Session finalized with Merkle root |
| KeyRotation | Ed25519 signing key rotated |
Only send data to an EctoClaw instance you operate and trust. Treat audit logs as highly sensitive and protect them accordingly.
Cryptographic integrity
Every event is:
- 1. SHA-256 hash-chained — each event hash includes the previous event hash
- Ed25519 signed — tamper-evident digital signatures per event and per session
- Merkle tree provable — O(log n) inclusion proofs for any individual event
Quick start (for users installing EctoClaw)
CODEBLOCK0
Links
- - GitHub: https://github.com/EctoSpace/EctoClaw
- NPM: https://www.npmjs.com/package/ectoclaw
- Website: https://ectospace.com/EctoClaw
- EctoLedger (Rust enterprise version): https://github.com/EctoSpace/EctoLedger
EctoClaw — OpenClaw的加密审计账本与AI防火墙
配置
- - ECTOCLAW_URL: EctoClaw服务器URL(默认值:http://localhost:3210)
源代码和安装脚本完全开源,位于 https://github.com/EctoSpace/EctoClaw。
安全/认证
- - EctoClaw设计为在本地主机或您控制的私有网络上运行。
- 如果您将ECTOCLAWURL暴露到本地主机之外,请将其置于您自己的身份验证和访问控制之后(例如,使用带有认证的反向代理)。
- 不要将ECTOCLAWURL指向不受信任的第三方主机,因为审计日志可能包含敏感提示、工具输出和内存内容。
命令
列出审计会话
当用户要求查看审计会话、列出最近会话或检查审计历史时:
- - 调用 GET {ECTOCLAW_URL}/api/sessions?limit=10
- 将响应格式化为可读列表,显示会话ID、状态、事件计数和目标
创建审计会话
当用户要求开始新的审计、创建会话或开始跟踪时:
- - 调用 POST {ECTOCLAWURL}/api/sessions,JSON体为:{goal: <用户声明的目标>}
- 可选地包含policyname以绑定策略:{goal: <目标>, policy_name: }
- 报告会话ID、目标哈希和公钥
追加事件
当用户想要记录操作、记录事件或跟踪操作时:
- - 调用 POST {ECTOCLAWURL}/api/sessions/{sessionid}/events
- JSON体:{type: , payload: {<事件数据>}}
- 有效类型:MessageReceived、MessageSent、SkillInvoked、SkillResult、ToolCall、ToolResult、PluginAction、PluginResult、ModelRequest、ModelResponse、MemoryStore、MemoryRecall、ApprovalRequired、ApprovalDecision
- 报告内容哈希、序列号和Ed25519签名
验证会话完整性
当用户要求验证会话或检查链完整性时:
- - 调用 GET {ECTOCLAWURL}/api/sessions/{sessionid}/verify
- 报告哈希链是否已验证或已损坏,以及检查了多少个事件
获取会话详情
当用户询问特定会话时:
- - 调用 GET {ECTOCLAWURL}/api/sessions/{sessionid}
- 显示完整的会话详情,包括目标、目标哈希、状态、策略、时间戳、事件计数和公钥
封存会话
当用户要求完成、封存或关闭审计会话时:
- - 调用 POST {ECTOCLAWURL}/api/sessions/{sessionid}/seal
- 报告封存状态和最终Merkle根
获取审计指标
当用户要求指标、统计信息或摘要时:
- - 调用 GET {ECTOCLAW_URL}/api/metrics
- 显示总会话数、活跃会话数、已封存会话数、总事件数和事件类型细分
获取合规包
当用户要求合规报告或Merkle证明时:
- - 调用 GET {ECTOCLAWURL}/api/sessions/{sessionid}/compliance
- 显示Merkle根和事件哈希
获取特定事件的Merkle证明
当用户要求证明链中存在特定事件时:
- - 调用 GET {ECTOCLAWURL}/api/sessions/{sessionid}/merkle?leaf={event_index}
- 显示Merkle根和包含证明路径
验证Merkle证明
当用户提供Merkle证明进行验证时:
- - 调用 POST {ECTOCLAW_URL}/api/merkle/verify,附带证明数据
- 报告证明是否有效
生成审计报告
当用户要求完整的审计报告时:
- - 调用 GET {ECTOCLAWURL}/api/reports/{sessionid}?format=json
- 对于HTML:GET {ECTOCLAWURL}/api/reports/{sessionid}?format=html
- 呈现包含事件和验证状态的完整会话报告
列出策略
当用户询问活动策略或配置了哪些规则时:
- - 调用 GET {ECTOCLAW_URL}/api/policies
- 显示每个策略名称及其配置
创建或更新策略
当用户想要设置审计规则时:
- - 调用 PUT {ECTOCLAW_URL}/api/policies/{name},附带{content: }
- 报告保存状态
流式传输实时事件
当用户想要实时监控时:
- - 连接到 GET {ECTOCLAW_URL}/api/stream(服务器发送事件)
- 事件到达时报告事件
检查服务器健康状态
当用户询问EctoClaw是否正在运行时:
- - 调用 GET {ECTOCLAW_URL}/health
- 报告状态、版本和名称
EctoClaw记录的内容
每个OpenClaw生命周期事件都被捕获为已签名的账本条目:
| 事件类型 | 捕获内容 |
|---|
| MessageReceived | 来自任何渠道的入站消息 |
| MessageSent |
出站代理响应 |
| SkillInvoked | 带参数的能力激活 |
| SkillResult | 能力执行输出 |
| ToolCall | 工具调用(shell、文件、http、浏览器) |
| ToolResult | 工具执行结果和观察 |
| PluginAction | 插件生命周期事件 |
| ModelRequest | 带提示上下文的LLM API调用 |
| ModelResponse | LLM响应 |
| MemoryStore | 内存写入操作 |
| MemoryRecall | 内存读取操作 |
| PolicyViolation | 被阻止或标记的操作 |
| ApprovalRequired | 触发人工介入门控 |
| ApprovalDecision | 记录的人工批准或拒绝 |
| SessionSeal | 使用Merkle根完成的会话封存 |
| KeyRotation | Ed25519签名密钥轮换 |
仅向您操作和信任的EctoClaw实例发送数据。将审计日志视为高度敏感信息并相应保护。
加密完整性
每个事件:
- 1. SHA-256哈希链 — 每个事件哈希包含前一个事件哈希
- Ed25519签名 — 每个事件和每个会话的防篡改数字签名
- Merkle树可证明 — 任何单个事件的O(log n)包含证明
快速开始(适用于安装EctoClaw的用户)
bash
npm install ectoclaw
npx ectoclaw serve --dev
仪表盘:http://localhost:3210/dashboard/
链接
- - GitHub:https://github.com/EctoSpace/EctoClaw
- NPM:https://www.npmjs.com/package/ectoclaw
- 网站:https://ectospace.com/EctoClaw
- EctoLedger(Rust企业版):https://github.com/EctoSpace/EctoLedger