Idevsec/creduent

GitHub: Idevsec/creduent

Creduent 为自治 AI Agent 定义了一套基于加密签名、DNS 域名绑定和公共注册表的开放信任验证标准,使机器间交互具备协议原生的身份验证能力。

Stars: 6 | Forks: 1

# Creduent:AI Agent 身份与信任的开放标准 [![协议版本](https://img.shields.io/badge/protocol-v2.0.5-cyan)](https://idevsec.com/creduent) [![许可证](https://img.shields.io/badge/license-Apache%202.0-blue)](https://idevsec.com/creduent/licensing) [![注册表](https://img.shields.io/badge/registry-live-brightgreen)](https://creduent.idevsec.com) [![Python SDK](https://img.shields.io/pypi/v/creduent.svg?label=pip%20install%20creduent&color=blue)](https://pypi.org/project/creduent/) [![JS SDK](https://img.shields.io/npm/v/@idevsec/creduent.svg?label=npm%20install%20%40idevsec%2Fcreduent&color=blue)](https://www.npmjs.com/package/@idevsec/creduent) **Creduent** 是用于自治 AI Agent 加密身份和信任验证的开放标准。 它定义了 Agent 如何发布已签名的身份文档(`agent.json`),如何通过 DNS TXT 记录将它们绑定到互联网域名,以及如何在公共证明注册表中进行注册。 由 [IDevSec](https://idevsec.com) 发起并管理。基于 Apache 2.0 开源。 - **协议概述**:[idevsec.com/creduent](https://idevsec.com/creduent) - **技术文档**:[idevsec.com/creduent/docs](https://idevsec.com/creduent/docs) - **参考注册表**:[creduent.idevsec.com](https://creduent.idevsec.com) - **许可授权**:[idevsec.com/creduent/licensing](https://idevsec.com/creduent/licensing) ## 问题 自治 Agent 缺乏一种原生的、去中心化的机制来验证其身份、所有权和 endpoint 能力。传统的 Web 安全依赖于以人为中心的身份验证系统。如果没有机器可读的、协议原生的信任基础设施,自动化的机器间交互将容易受到身份欺骗、未经授权的访问以及缺乏能力发现等问题的威胁。 ## 工作原理 ``` +-------------------+ +----------------------+ +-------------------+ | Agent Provider | | Creduent Registry | | Client App | | (agent.json) | | | | (MCP Host) | +-------------------+ +----------------------+ +-------------------+ | | | |----- 1. Host agent.json -------->| | | |-- 2. Verify identity & DNS ------>| | | and sign attestation | | | | |<---- 3. Call agent endpoint -----------------------------------------| (verify_agent tool) | | | | |<--- 4. Fetch attestation ---------| (registry validation) ``` ## agent.json 文档 每个 Agent 都会在 `https:///.well-known/agent.json` 发布其加密身份。该文档包含 8 个字段: ``` { "version": "1.0", "issued_at": "2026-05-27T02:41:21Z", "agent_id": "agent://example/agent", "owner": "Example Corp", "public_key": "ed25519:hArTvbITJ2jirL170IOSjcVvEvstC4s+RjYLu4chCwg=", "endpoint": "https://api.example.com/assistant", "capabilities": ["scan", "query"], "signature": "base64_signature_here" } ``` ## 快速入门 ### 1. 生成密钥并签署 agent.json 使用签名 CLI 生成密钥对,并使用 RFC 8785 JSON 规范化方案 (JCS) 和 Ed25519 对您的草拟身份 payload 进行签名: ``` python cli/creduent-sign.py generate-keys python cli/creduent-sign.py sign --key private_key.pem --input examples/draft_agent.json --output agent.json ``` ### 2. 公开元数据并配置 DNS 在您的 Web 服务器上的 `https:///.well-known/agent.json` 托管 `agent.json`。然后,在您的域名下发布 DNS TXT 记录,将域名身份绑定到 Agent ID: ``` _creduent.example.com TXT "agent://example/agent" ``` ### 3. 向 Creduent Registry 注册 将您的 Agent 注册信息提交到 Registry: ``` curl -X POST https://creduent.idevsec.com/register \ -H "Content-Type: application/json" \ -d '{"agent_id": "agent://example/agent", "domain": "example.com", "agent_json_url": "https://example.com/.well-known/agent.json"}' ``` ## SDK 与工具 ### Python SDK ``` pip install creduent ``` ### JavaScript / TypeScript SDK ``` npm install @idevsec/creduent ``` ### CLI 工具 ``` npm install -g @idevsec/creduent-cli ``` ## MCP 集成 Creduent 公开了一个带有 `verify_agent` 工具的 Model Context Protocol (MCP) 服务器,以在 Agent 宿主环境中启用验证。在您的 MCP 设置中进行配置: ``` { "mcpServers": { "creduent": { "command": "python", "args": ["/path/to/creduent/mcp/creduent_mcp_server.py"], "env": { "CREDUENT_REGISTRY_URL": "https://creduent.idevsec.com" } } } } ``` 使用目标 Agent ID 或域名调用 `verify_agent`,以接收结构性验证、加密签名以及注册表证明的状态。 ## Agent 框架集成 Creduent 为主流 AI Agent 框架提供了原生验证工具和类: - **CrewAI**:从 `creduent.integrations.crewai` 导入 `CreduentVerifyTool`,在您的 Crew 定义中动态验证外部 Agent。 - **LangGraph**:将来自 `creduent.integrations.langgraph` 的 `verify_agent_node` 节点函数添加到您的状态图中,以便在执行后续节点之前验证 Agent 身份。 - **AutoGen**:使用来自 `creduent.integrations.autogen` 的 `CreduentConversableAgent` 作为 Agent 的子类,对传入消息强制执行加密发送者身份检查。 ## Registry API - `POST /register` - 通过签名和 DNS TXT 检查验证 Agent 身份,然后颁发签名证明。 - `POST /attest` - 开发者直接注册 Agent(无需提供 agent_json_url)。 - `GET /attest/{agent_id}` - 获取指定 Agent 当前有效的 Creduent 签名证明。 - `GET /agents` - 列出 Registry 中所有已注册的 Agent 元数据和证明。 - `DELETE /revoke/{agent_id}` - 从 Registry 中撤销 Agent 证明(需要多重签名标头或旧版的 `CREDUENT-ADMIN-KEY`)。 - `POST /recovery/override` - 通过域名 DNS TXT 记录检查进行密钥覆盖。 - `POST /renew` - 使用新的到期日期续订 Agent 证明。 - `POST /webhook/register` - 注册用于到期通知的 webhook URL。 - `GET /webhook/{agent_id}` - 获取指定 Agent 已注册的 webhook URL。 - `GET /stats` - Registry 遥测数据(总数、已验证、未验证、已撤销、即将过期)。 - `GET /challenge/{agent_id}` - 生成用于身份验证的安全挑战和 nonce。 - `POST /verify-challenge` - 验证已签名的挑战响应并颁发短期有效 proof token。 - `GET /public-key` - 获取用于验证 proof token 的 Registry 公钥。 - `GET /dashboard` - 位于 `creduent.idevsec.com/dashboard` 的开发者仪表盘 UI。 - `GET /resolver` - 位于 `creduent.idevsec.com/resolver` 的 Agent:// URI 解析器 UI。 ## 协议标准与规范 Creduent 协议被组织为一系列由 IDevSec 维护的正式标准草案文档: * **[标准索引](standards/README.md)** - 所有协议标准的主索引 * **[CREDUENT-001: agent.json](standards/CREDUENT-001-agent-json.md)**(基于标准的 **[SPEC.md](SPEC.md)**) - 基础身份规范 * **[CREDUENT-002: 证明](standards/CREDUENT-002-attestation.md)** - 签名证明 schema 和验证 pipeline * **[CREDUENT-003: Registry API](standards/CREDUENT-003-registry-api.md)** - Registry HTTP API endpoint 和安全控制 * **[CREDUENT-004: Agent URI 解析](standards/CREDUENT-004-uri-resolution.md)** - 绑定 DNS 的 `agent://` URI scheme 解析 * **[CREDUENT-005: 联邦](standards/CREDUENT-005-federation.md)** - 联邦根节点与普通节点信任模型 * **[CREDUENT-006: 动态证明](standards/CREDUENT-006-dynamic-attestation.md)** - 动态 prompt 和硬件证明(草案) ## 起源与管理 Kashish Kanojia 是 Creduent 协议的创建者,由 [IDevSec](https://idevsec.com) 负责管理。 Creduent 是一个旨在实现社区普及、互操作性和联邦信任的开放协议。其长期治理和管理由 IDevSec 负责,以确保它始终是服务于整个 AI Agent 生态系统的中立、开放标准。 有关项目历史的详细信息,请参阅: * [AUTHORS.md](AUTHORS.md) - 创始细节与参考 参考 Registry、SDK 和协议工具作为该协议的初始实现。 ## 实用链接 | 资源 | URL | |---|---| | 协议展示 | https://idevsec.com/creduent | | 技术文档 | https://idevsec.com/creduent/docs | | 许可详情 | https://idevsec.com/creduent/licensing | | 参考 Registry | https://creduent.idevsec.com | | Registry 仪表盘 | https://creduent.idevsec.com/dashboard | | Python SDK (PyPI) | https://pypi.org/project/creduent/ | | JavaScript SDK (npm) | https://www.npmjs.com/package/@idevsec/creduent | | CLI 工具 (npm) | https://www.npmjs.com/package/@idevsec/creduent-cli | ## 安全与强化 Creduent Registry 内置了多项安全保证和弹性保障措施: - **Fail-Closed(失败关闭)验证:** 如果由于损坏或恶意的 payload 篡改导致 Agent 证明的时间戳或到期日期无法解析,验证 pipeline 将默认把该证明标记为 `expired`(`expired = True`)。 - **Serverless 速率限制防护:** 为了防止客户端在无状态环境中绕过速率限制(例如在容器冷启动期间内存回退数据库被清除的 Vercel serverless 函数),如果未配置 Upstash Redis 凭证,Registry 将明确抛出 `HTTP 500` 错误。 - **规范 JCS 序列化:** 所有加密签名验证均使用符合 RFC 8785 的统一 JSON 规范化方案 (JCS) 编码包装器,以避免格式差异。 - **Webhook 中的 SSRF 防御:** 所有出站的 webhook 警报都会经过严格的 IP 验证过滤器(`safe_requests_post`),该过滤器会丢弃私有、环回和本地 IP 范围,从而防止服务器端请求伪造。 - **授权的 Webhook 查询:** 通过 `/webhook/{agent_id}` 获取已注册的 webhook URL 仅限授权管理员操作(需要 `CREDUENT-ADMIN-KEY` token),以防止元数据信息泄露。 - **CLI 管理员集成:** 开发者 CLI 会自动从环境中转发管理员凭证,确保授权操作员的无缝操作,且不会暴露公共查询 endpoint。 - **解耦的安全审计:** Agent 能力扫描(DNS、OSINT 标头以及 Clickjacking/HSTS 验证)与主 Registry 控制器分离,形成独立的服务,允许进行独立的代码审计。 ## 许可授权 Creduent 的许可模式旨在最大化社区普及和互操作性: * **协议规范:** Creduent 协议规范(包括位于 `standards/` 目录中的标准文档 `CREDUENT-001` 到 `CREDUENT-006`)是开放的公共领域标准。任何人都可以自由实施该协议、构建自定义 Registry 或设计兼容的客户端,而没有任何许可限制或版税。 * **参考实现、SDK 与 CLI:** 所有 Creduent 软件资产(包括 Python SDK、JavaScript/TypeScript SDK(`@idevsec/creduent`)、CLI 工具(`@idevsec/creduent-cli`)、MCP Server 和参考 Registry 源代码)均基于 **[Apache License 2.0](LICENSE)** 授权。
标签:AI智能体, CMS安全, JavaScript, Python, 信任验证, 密码学, 开放标准, 手动系统调用, 搜索引擎查询, 数据可视化, 无后门, 逆向工具