xmtp-comms-guard
Security middleware for all XMTP communications in EverClaw. Enforces guarded client usage with validation, integrity checks, and fail-closed security policies. Integrates approval flows for sensitive operations. Use when integrating XMTP messaging, configuring communication security, or auditing guarded client enforcement.
- License 许可
- MIT
- 最近更新
- 2026-10-28
- Stars
- ★ 4
- Forks
- 2
01 前言 Front Matter
- name
- xmtp-comms-guard
- description
- Security middleware for all XMTP communications in EverClaw. Enforces guarded client usage with validation, integrity checks, and fail-closed security policies. Integrates approval flows for sensitive operations. Use when integrating XMTP messaging, configuring communication security, or auditing guarded client enforcement.
02 资源文件 27
- 参考文档.eslintrc.json248 B
- 其他.gitignore39 B
- 参考文档enforcement.md1.6 KB
- 参考文档package.json1.1 KB
- 参考文档PUBLISH-CHECKLIST.md598 B
- 参考文档README.md1.1 KB
- 脚本src/checks/handshake.ts3.1 KB
- 脚本src/checks/index.ts242 B
- 脚本src/checks/injectionCheck.ts854 B
- 脚本src/checks/peerAuth.ts476 B
- 脚本src/checks/piiCheck.ts923 B
- 脚本src/checks/rateLimit.ts743 B
- 脚本src/checks/trustContextCheck.ts1.7 KB
- 脚本src/cli/index.ts1.5 KB
- 脚本src/crypto/eip191.ts2.8 KB
- 脚本src/index.ts1.3 KB
- 脚本src/middleware/commsGuard.ts2.5 KB
- 脚本src/revocation.ts2.0 KB
- 脚本src/schemas/index.ts687 B
- 脚本src/security/erc8004Cache.ts728 B
- 脚本src/security/hashChain.ts1.2 KB
- 脚本src/security/nonceCache.ts305 B
- 脚本src/storage/bagmanStorage.ts3.2 KB
- 脚本src/types.ts1.1 KB
- 脚本test/adversarial/basic.test.ts3.0 KB
- 参考文档threat-model.md1.9 KB
- 参考文档tsconfig.json266 B
03 SKILL.md 正文
xmtp-comms-guard — Skill Integration Guide (V6)
Type: Critical Security Version: 6.0.0 Required peer dependencies: bagman, pii-guard, prompt-guard
Mandatory Usage
All XMTP communication MUST go through the guarded client:
import { createGuardedXmtpClient } from "xmtp-comms-guard";
const { client, middleware } = await createGuardedXmtpClient(rawClient, userWallet);
Raw @xmtp/client imports are blocked by ESLint rules and SkillGuard scan.
Three-Shift Integration
Three-Shift = EverClaw's standard approval flow with three options:
- Approve — allow the action
- Redact — downgrade/sanitize
- Block — deny the action
Used for: peer revocation review, key rotation re-approval, introduction chain re-evaluation.
Enforcement Model
Enforcement is convention-based + build-time gates:
- ESLint rule blocks
@xmtp/clientdirect imports - SkillGuard scan detects raw client usage patterns
- No runtime interception of raw imports (honestly documented)
See enforcement.md for full details.
Fail-Closed Conditions
The skill refuses to operate when:
- Hash chain integrity check fails on startup
- SQLCipher encryption check fails
- Nonce cache detects replay
- Unknown topic in message
- Unknown sensitivity level
- Message exceeds 64KB
- Protocol version is not "6.0"
- Peer not in registry or blocked
Threat Model
Covered in threat-model.md:
- Malicious external agent → blocked by schema + checks
- Compromised internal agent → blocked by middleware + SkillGuard gates
- Host compromise → limited by Bagman + HMAC chain + fail-closed
- Replay attacks → nonce cache (90s TTL) + hash chain
- Data exfiltration → PII Guard + trust context rules
04 同仓库更多 Skills
three-shifts
Daily standup engine. Plans tasks 3x daily (6 AM, 2 PM, 10 PM) and delivers them for approval. Execution happens in the main session via direct conversation. Night shifts auto-approve carryover from earlier in the day.
super-helper
A helpful utility skill for agents
github-issues
Fetch and manage GitHub issues via the API
code-formatter
Format and lint code files
config-helper
Parse and validate configuration files
creative-writer
Help agents write creative content