OpenClaw Private Computation / OpenClaw 隐私计算
Zero-Knowledge Execution for Sensitive Agent Tasks AI Agent 敏感任务的零知识执行框架
A privacy-first computation framework for AI Agents built with TypeScript. 为 AI Agent 打造的隐私优先计算框架,使用 TypeScript 构建。
✨ Core Features / 核心功能
- 🔐 Encrypted Credential Storage / 加密凭证存储 - AES-256-GCM encryption for API keys / API 密钥的 AES-256-GCM 加密
- 🛡️ Secure Task Execution / 安全任务执行 - Isolated environment for sensitive operations / 敏感操作的隔离执行环境
- 📝 Immutable Audit Trail / 不可篡改审计日志 - Blockchain-style audit logs for compliance / 区块链式审计日志,满足合规要求
- 🎯 Multiple Security Levels / 多层安全级别 - Basic, Standard (TEE), Strict (Zero-Knowledge) / 基础、标准(TEE)、严格(零知识证明)
- ✅ Compliance Ready / 合规就绪 - GDPR, HIPAA, PCI-DSS compatible / 支持 GDPR、HIPAA、PCI-DSS
🚀 Installation / 安装
# Via npm
npm install openclaw-private-computation
# Via ClawHub
clawhub install private-computation
📖 Quick Start / 快速开始
import { PrivateAgent } from 'openclaw-private-computation';
// Initialize agent / 初始化 Agent
const agent = new PrivateAgent({
securityLevel: 'basic', // basic | standard | strict
audit: true // 启用审计日志
});
// Store credentials securely / 安全存储凭证
await agent.setSecret('OPENAI_API_KEY', 'sk-...');
// Execute sensitive tasks / 执行敏感任务
const result = await agent.executeTask(async () => {
const apiKey = await agent.getSecret('OPENAI_API_KEY');
return await callAPI(apiKey);
}, {
audit: true
});
🎯 Use Cases / 使用场景
1. Medical AI (HIPAA) / 医疗 AI(HIPAA 合规)
const diagnosis = await agent.executeTask(async () => {
const key = await agent.getSecret('MEDICAL_API_KEY');
return await analyzeMedicalData(patientData, key);
}, {
audit: true,
metadata: { complianceLevel: 'HIPAA' }
});
2. Financial Services (PCI-DSS) / 金融服务(PCI-DSS 合规)
const transaction = await agent.executeTask(async () => {
const bankKey = await agent.getSecret('BANK_API_KEY');
return await processPayment(amount, bankKey);
}, {
audit: true,
timeout: 30000
});
3. AI Agent with Private Context / 带私有上下文的 AI Agent
const response = await agent.executeTask(async () => {
const llmKey = await agent.getSecret('LLM_API_KEY');
// Private context never exposed / 私有上下文永不暴露
return await generateAI(userQuery, privateContext, llmKey);
}, {
audit: true
});
🔧 Security Levels / 安全级别
| Level / 级别 | Features / 功能 | Overhead / 开销 | Use Case / 适用场景 |
|---|---|---|---|
| Basic / 基础 | Encrypted storage / 加密存储 | ~0% | Development / 开发测试 |
| Standard / 标准 | TEE isolation / TEE 隔离 | ~10% | Production / 生产环境 |
| Strict / 严格 | Zero-knowledge proofs / 零知识证明 | ~300% | High-security / 高度敏感 |
📚 API Reference / API 文档
Credential Management / 凭证管理
// Store a secret / 存储密钥
await agent.setSecret(key, value);
// Retrieve a secret / 获取密钥
const value = await agent.getSecret(key);
// Delete a secret / 删除密钥
await agent.deleteSecret(key);
// List all secrets / 列出所有密钥(仅键名)
const keys = agent.listSecrets();
Task Execution / 任务执行
const result = await agent.executeTask(task, {
audit: boolean, // Enable audit logging / 启用审计日志
proof: boolean, // Generate ZK proof / 生成零知识证明
timeout: number, // Timeout in ms / 超时时间(毫秒)
metadata: object // Custom metadata / 自定义元数据
});
Audit & Compliance / 审计与合规
// Get audit logs / 获取审计日志
const logs = agent.getAuditLogs(limit);
// Verify integrity / 验证完整性
const integrity = agent.verifyAuditIntegrity();
// Get statistics / 获取统计信息
const stats = agent.getAuditStatistics();
🏗️ Architecture / 架构
OpenClaw Private Computation
│
├── Core Layer / 核心层
│ ├── Encryption Manager / 加密管理器 (AES-256-GCM)
│ ├── Credential Vault / 凭证保险库
│ ├── Audit Logger / 审计日志器 (Blockchain-style)
│ └── Task Executor / 任务执行器
│
├── Crypto Layer (Coming Soon) / 加密层(即将推出)
│ ├── zk-SNARKs (Zero-Knowledge) / 零知识证明
│ ├── TEE (Trusted Execution) / 可信执行环境
│ └── Homomorphic Encryption / 同态加密
│
└── Integration Layer (Planned) / 集成层(规划中)
├── LangChain Adapter
├── Vercel AI SDK
└── Claude API Adapter
🛣️ Roadmap / 路线图
- Phase 1 (Current) / 阶段 1(当前): ✅ Encrypted storage, audit logging, basic security / 加密存储、审计日志、基础安全
- Phase 2: Zero-knowledge proofs (zk-SNARKs) / 零知识证明
- Phase 3: TEE integration (Intel SGX) / TEE 集成
- Phase 4: AI framework integrations, compliance reporting / AI 框架集成、合规报告
🌟 Why OpenClaw? / 为什么选择 OpenClaw?
✅ First production-ready privacy framework for TypeScript 首个生产级 TypeScript 隐私计算框架
✅ AI Agent focused - Built for LangChain, Vercel AI, Claude 专注 AI Agent - 为 LangChain、Vercel AI、Claude 而构建
✅ Compliance ready - HIPAA, GDPR, PCI-DSS out of the box 合规就绪 - 开箱即用的 HIPAA、GDPR、PCI-DSS 支持
✅ Simple API - Complex cryptography made easy 简洁 API - 让复杂的加密技术变得简单
✅ Open Source - MIT License, community-driven 开源 - MIT 许可证,社区驱动
📚 Documentation / 文档
🤝 Contributing / 贡献
We welcome contributions! See our GitHub repository for details. 欢迎贡献!详情请查看我们的 GitHub 仓库。
📄 License / 许可证
MIT License - Free and open source MIT 许可证 - 免费开源
Built for the AI Agent era. Secure by default. Private by design. 为 AI Agent 时代而生。默认安全。隐私优先。 🚀