## 什么是 web-bot-auth？

Web-bot-auth 是一项新兴标准，让 AI 代理使用密码学 HTTP 消息签名（RFC 9421）证明自己的身份。代理不再依赖可被伪造的 User-Agent 字符串，而是用私钥对请求进行签名。站点用已发布的公钥验证签名。

## 为什么重要

依赖 User-Agent 检测已经不再可靠：

- **ChatGPT Agent Mode** 使用伪装的 Chrome UA（`Chrome/138.0.0.0`）—— 仅凭 UA 难以与浏览器区分
- **Perplexity** 运行隐身爬虫（每天 300-600 万次请求），使用通用 Chrome UA
- **Google-Agent** 使用标准 Chrome UA 字符串

行业正在转向密码学身份。OpenAI、Google、Cloudflare、Shopify、Vercel 和 Visa 都支持这一方向。IETF 标准化工作正在进行中。

## AgentGrade 会检查什么

**已发布签名目录** —— 我们检查 `/.well-known/http-message-signatures-directory`。这是站点发布其代理身份和用于验证已签名请求公钥的标准位置。

**已声明成员** —— 该目录应包含一个 `members` 数组，列出站点所识别或所代表的代理身份（例如 "ChatGPT"、"GoogleAgent"）。

**公钥可获取** —— 每个成员都应有一个 `publicKeyUrl`，指向用于签名验证的可获取公钥。

## 如何实现

在 `/.well-known/http-message-signatures-directory` 上发布一个 JSON 文件：

```json
{
  "members": [
    {
      "name": "my-agent",
      "publicKeyUrl": "https://example.com/.well-known/keys/agent.pub"
    }
  ]
}
```

要验证来自已知代理（如 ChatGPT）的已签名请求，可使用 `web-bot-auth` npm 包：

```bash
npm install web-bot-auth
```

## 已知代理目录

| 代理 | 目录 URL |
|-------|---------------|
| ChatGPT | `https://chatgpt.com/.well-known/http-message-signatures-directory` |

## 了解更多

- [RFC 9421：HTTP Message Signatures](https://www.rfc-editor.org/rfc/rfc9421)
- [web-bot-auth npm 包](https://www.npmjs.com/package/web-bot-auth)
- [Cloudflare 博客：web-bot-auth](https://blog.cloudflare.com/web-bot-auth/)
- [SeatGeek 实现](https://chairnerd.seatgeek.com/chasing-signature/)

## 相关

- [A2A](/kb/zh/a2a)
- [SKILL.md](/kb/zh/skills)
