Install
openclaw skills install private-computationZero-Knowledge Execution for Sensitive Agent Tasks - Privacy computing framework for AI Agents
openclaw skills install private-computationZero-Knowledge Execution for Sensitive Agent Tasks AI Agent 敏感任务的零知识执行框架
A privacy-first computation framework for AI Agents that need to process sensitive data securely. Built with TypeScript for the Node.js ecosystem.
为需要安全处理敏感数据的 AI Agent 打造的隐私优先计算框架。使用 TypeScript 为 Node.js 生态系统构建。
🔐 Encrypted Credential Storage / 加密凭证存储
🛡️ Secure Task Execution / 安全任务执行
📝 Immutable Audit Trail / 不可篡改审计日志
🎯 Multiple Security Levels / 多层安全级别
✅ GDPR & HIPAA Compliant / GDPR 和 HIPAA 合规
npm install openclaw-private-computation
clawhub install private-computation
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,
metadata: { taskType: 'api_call' }
});
console.log(result);
// { status: 'success', data: {...}, auditId: '...', executionTime: 123 }
const diagnosis = await agent.executeTask(async () => {
const key = await agent.getSecret('MEDICAL_API_KEY');
return await analyzeMedicalData(patientData, key);
}, {
audit: true,
metadata: { complianceLevel: 'HIPAA' }
});
const transaction = await agent.executeTask(async () => {
const bankKey = await agent.getSecret('BANK_API_KEY');
return await processPayment(amount, bankKey);
}, {
audit: true,
timeout: 30000
});
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
});
const agent = new PrivateAgent({
securityLevel: 'basic' | 'standard' | 'strict',
encryption: 'aes-256-gcm' | 'chacha20-poly1305',
audit: boolean,
storagePath: string, // Default: ~/.openclaw
masterKey: string // Auto-generated if not provided / 未提供时自动生成
});
| Level / 级别 | Features / 功能 | Overhead / 开销 | Use Case / 适用场景 |
|---|---|---|---|
| Basic / 基础 | Encrypted storage / 加密存储 | ~0% | Development / 开发测试 |
| Standard / 标准 | + TEE isolation / + TEE 隔离 | ~10% | Production / 生产环境 |
| Strict / 严格 | + Zero-knowledge proofs / + 零知识证明 | ~300% | High-security / 高度敏感 |
// Store a secret / 存储密钥
await agent.setSecret('KEY_NAME', 'secret-value');
// Retrieve a secret / 获取密钥
const value = await agent.getSecret('KEY_NAME');
// List all secrets / 列出所有密钥(仅键名)
const keys = agent.listSecrets();
// Delete a secret / 删除密钥
await agent.deleteSecret('KEY_NAME');
const result = await agent.executeTask(async () => {
// Your task logic / 你的任务逻辑
return someData;
}, {
audit: true, // Enable audit logging / 启用审计日志
proof: true, // Generate ZK proof / 生成零知识证明 (strict mode)
timeout: 30000, // Timeout in ms / 超时时间(毫秒)
metadata: {...} // Custom metadata / 自定义元数据
});
// Get audit logs / 获取审计日志
const logs = agent.getAuditLogs(10);
// Verify integrity / 验证完整性
const integrity = agent.verifyAuditIntegrity();
// { valid: true }
// Get statistics / 获取统计信息
const stats = agent.getAuditStatistics();
// { totalLogs: 42, byAction: {...}, byResult: {...} }
OpenClaw Private Computation
│
├── Core Layer / 核心层
│ ├── Encryption Manager / 加密管理器 (AES-256-GCM)
│ ├── Credential Vault / 凭证保险库
│ ├── Audit Logger / 审计日志器 (Blockchain-style)
│ └── Task Executor / 任务执行器
│
├── Crypto Layer (Future) / 加密层(未来)
│ ├── zk-SNARKs (Zero-Knowledge Proofs) / 零知识证明
│ ├── TEE (Trusted Execution Environment) / 可信执行环境
│ └── Homomorphic Encryption / 同态加密
│
└── Integration Layer (Future) / 集成层(未来)
├── LangChain Adapter
├── Vercel AI SDK Adapter
└── Claude API Adapter
"The first production-ready privacy computing framework for TypeScript" "首个生产级 TypeScript 隐私计算框架"
No other TypeScript/JavaScript library provides: 其他 TypeScript/JavaScript 库都不提供:
We welcome contributions! Please see our GitHub repository for details.
欢迎贡献!详情请查看我们的 GitHub 仓库。
MIT-0 License - Free and open source, no attribution required. MIT-0 许可证 - 免费开源,无需署名。
Built for the AI Agent era. Secure by default. Private by design. 为 AI Agent 时代而生。默认安全。隐私优先。 🚀