Hacker News 中文摘要

RSS订阅

显示 HN:OneCLI —— Rust 开发的 AI 代理保险库 -- Show HN: OneCLI – Vault for AI Agents in Rust

文章摘要

OneCLI是一个开源凭证保险库项目,旨在为AI代理提供安全访问服务的解决方案,避免直接暴露密钥等敏感信息。该项目托管在GitHub平台,属于开发者工具类开源软件。

文章总结

OneCLI:开源凭证保险库,为AI代理提供安全服务访问

项目简介
OneCLI是一个开源网关,作为AI代理与外部服务之间的安全中间层。它通过集中存储API密钥并动态注入请求,确保代理无需直接接触真实凭证,从而降低密钥泄露风险。

核心功能
- 透明凭证注入:代理使用占位密钥(如FAKE_KEY)发起请求,网关自动替换为真实密钥
- AES-256-GCM加密存储:密钥仅在请求时解密
- 多代理支持:每个代理拥有独立访问令牌和权限
- 无外部依赖:默认使用嵌入式PGlite(支持PostgreSQL)
- 双认证模式:支持本地单用户模式或团队Google OAuth

架构组成
1. Rust网关:高性能HTTP代理(端口10255),处理请求拦截和凭证注入
2. Web控制台:Next.js构建的管理界面(端口10254),提供密钥和代理管理功能
3. 加密存储:基于主机和路径模式匹配的密钥路由系统

快速启动
shell docker run -p 10254:10254 -p 10255:10255 -v onecli-data:/app/data ghcr.io/onecli/onecli 访问http://localhost:10254即可开始配置。

开发环境
- 需安装mise和Rust
- 支持通过pnpm dev同时启动网关和控制台

开源协议
Apache-2.0 License

项目资源
- 官网:onecli.sh
- 文档:使用指南
- GitHub:231 Stars|8 Forks

(注:已过滤GitHub页面导航菜单、文件列表等非核心内容,保留关键功能说明和技术细节)

评论总结

以下是评论内容的总结,平衡呈现不同观点:

支持观点

  1. 创新性与竞争需求

    • 认为该方案是正确方向,需要更多竞争(评论1:"Otherwise this is cool, we need more competition here")
    • 代理拦截架构合理,Rust语言选择合适(评论13:"The proxy-intercept approach is the right architecture")
  2. 解决密钥泄漏问题

    • 防止密钥通过Git等途径直接泄漏(评论14:"prevents agents from directly sharing the credentials through git")
    • 短生命周期令牌模型可缩小风险范围(评论11:"short-lived derived tokens scoped to exactly the tools they need")

质疑与替代方案

  1. 功能局限性

    • 代理无法阻止恶意API调用(评论10:"The agent can still do exactly what it could have done if it had the real key")
    • 缺乏团队级访问控制和审计(评论13:"breaks at the team boundary... no per-agent scoping")
  2. 现有方案更优

    • 推荐使用Hashicorp Vault或AWS Secrets Manager(评论5:"Hashicorp Vault can do this";评论6:"Why not just use AWS Secrets Manager?")
    • 类似方案如tokenizer已有成熟实现(评论7:"Don't see any reason to use this over vault";评论8:"auth-proxying has existed as a solution forever")
  3. 安全性不足

    • 假密钥仍可能被滥用(评论16:"what's to prevent a malicious agent from re-using the honest agent's fake API key")
    • 需结合mTLS等更严格验证(评论16:"have the sidecar authenticate with the gateway using mTLS")

关键引用

  • 支持创新
    评论1:"Otherwise this is cool, we need more competition here"
    评论13:"Rust is a solid choice for something this sensitive"

  • 功能质疑
    评论10:"The agent can still do exactly what it could have done if it had the real key"
    评论14:"they can still cost money or cause security problems or delete production"

  • 替代方案
    评论5:"Hashicorp Vault can do this and agents can be instructed to get secrets"
    评论8:"auth-proxying has existed as a solution forever"