安全

graceful-boundaries-audit

试用

审计任意 URL 的 Graceful Boundaries 限速合规等级,并给出可落地的升级方案。

它能做什么

按六个阶段对 URL 进行 HTTP 检测:发现端点拉取、主动响应头检查、等级映射、差距分析、实现指引、文档输出,全程只使用标准 HTTP 请求,无需任何专用工具。最终产出基于证据的等级评估(确认等级、声明等级、可能等级,0 至 4 级或 N/A),并附带可直接复用的代码:限速发现端点、结构化拒绝响应体、引导字段以及 RateLimit 响应头。由于不会主动触发 429,Level 1 和 Level 3 在缺少真实拒绝响应时会被标注为不可验证。

什么时候用它

  • 检查某个 URL 如何向代理传达限速信息
  • 判断一个 API 当前处于 Graceful Boundaries 哪一级
  • 拿到从当前等级升到下一级的具体实现步骤
  • 审计服务的 429 响应是否符合规范

技能文档

Graceful Boundaries Conformance Audit

What This Skill Does

Assesses a URL's Graceful Boundaries conformance level through direct HTTP inspection, then provides a concrete implementation plan for reaching the next level. The output is an actionable document with code examples the user can implement immediately. No special tooling or dependencies required — the skill works with any HTTP client.

When To Use This Skill

  • User provides a URL and asks about its rate limit communication
  • User asks to check Graceful Boundaries conformance for a service
  • User wants to know what level an API is at
  • User asks how to improve their API's 429 responses
  • User wants to elevate from one conformance level to the next
  • User says "audit this API" in the context of rate limits or boundaries

Assessment Process

Follow these phases in order. Each phase builds on the previous one.

Phase 1: Discovery Fetch

Fetch the limits discovery endpoint directly. Try both standard paths:

GET /api/limits
GET /.well-known/limits

Use curl, fetch, or any HTTP client available in the current environment. No special tooling is required.

If either path returns a JSON response, record:

  • Whether the response contains a service field
  • Whether the response contains a limits object
  • Whether limit entries are well-formed (each has type, maxRequests, windowSeconds, description)
  • Whether a conformance field is present (self-declared level)
  • Whether the response includes a Cache-Control header with s-maxage
  • Whether changelog or feed URLs are present (v1.1 change discovery)
  • Whether resource-dedup entries include returnsCached: true (v1.1)

If neither path returns a valid response, the service has no discovery endpoint and cannot be Level 2 or above.

Optional accelerator: If the graceful-boundaries repo is cloned locally, the automated checker provides a structured report:

node evals/check.js  --json

This is a convenience, not a requirement. The skill works entirely through direct HTTP inspection.

Phase 2: Proactive Header Check

If the limits endpoint documents specific API endpoints, fetch one of them and check for proactive headers on the success response:

  • RateLimit: limit=N, remaining=N, reset=N
  • RateLimit-Policy: N;w=N

These headers indicate Level 4 conformance.

Do NOT attempt to trigger 429s. That would require hammering the service and is not appropriate for an audit. Level 1 and Level 3 conformance cannot be verified without observing an actual refusal response — note these as unverifiable and explain why.

Phase 3: Level Assessment

Map findings to the conformance levels defined in spec.md:

LevelHow to verify
N/ASite has no API or agentic surface
0Service exists but no limits endpoint, no structured responses
1Cannot verify without a 429 response (note as unverifiable)
2Limits endpoint exists and is well-formed
3Cannot verify without a 429 response (note as unverifiable)
4Level 2 confirmed + proactive headers present on success responses

If the service self-declares a conformance level via the conformance field, compare declared vs. validated. Flag any discrepancy.

Report the assessment as:

  • Confirmed level: what the evidence supports
  • Declared level: what the service claims (if any)
  • Likely level: best estimate including unverifiable aspects

Phase 4: Gap Analysis

For each level above the current confirmed level, list exactly what is missing. Reference specific sections of spec.md:

To reach Level 1 (spec sections 2 and 6):

  • Do ALL non-success responses (400, 401, 403, 404, 429, 500, 503) include error, detail, and why? (v1.1: why is MUST for all error classes)
  • Are 429 responses JSON with the 5 required fields (error, detail, limit, retryAfterSeconds, why)?
  • Does error use a stable machine-parseable string (snake_case)?
  • Does detail include a specific retry time in human-readable form?
  • Does why explain the purpose, not restate the error?
  • Is retryAfterSeconds a non-negative integer?
  • Does the HTTP response include a Retry-After header?
  • For HTML 429 pages: is there a tag or a? (v1.1)

To reach Level 2 (spec section 1):

  • Does a limits endpoint exist at /api/limits or /.well-known/limits?
  • Does it return JSON with a limits object?
  • Are limit entries well-formed (type, maxRequests, windowSeconds, description)?
  • Is the endpoint cacheable (Cache-Control header)?
  • Does it include changelog or feed URLs for change discovery? (v1.1, optional but recommended)

To reach Level 3 (spec sections 3 and 5):

  • Do refusal responses include constructive guidance fields?
  • Which guidance categories apply? (cachedResultUrl, alternativeEndpoint, upgradeUrl, humanUrl, cached)
  • Does the service prefer guidance in the recommended order: use cached > try alternative > upgrade > wait > human handoff?
  • For resource-dedup limits: does the service return cached results as a 200 instead of a 429? If so, does the discovery endpoint include returnsCached: true so agents skip retry logic? (v1.1)

To reach Level 4 (spec section 4):

  • Are RateLimit headers present on success responses?
  • Do they include all three components: limit, remaining, reset?
  • Is a RateLimit-Policy header present?
  • Does the policy format match N;w=N?

Phase 5: Implementation Guidance

Provide concrete, copy-pasteable code for each gap. Use the service's actual domain and endpoints in examples.

Limits discovery endpoint skeleton:

{
  "service": "",
  "description": "",
  "conformance": "level-2",
  "changelog": "https:///api/changelog.json",
  "feed": "https:///feed.json",
  "limits": {
    "": {
      "endpoint": "",
      "method": "",
      "limits": [
        {
          "type": "ip-rate",
          "maxRequests": 100,
          "windowSeconds": 3600,
          "description": "100 requests per IP per hour."
        },
        {
          "type": "resource-dedup",
          "maxRequests": 1,
          "windowSeconds": 86400,
          "returnsCached": true,
          "description": "One operation per resource per day. Repeat requests return the cached result."
        }
      ]
    }
  }
}

Structured refusal body:

{
  "error": "rate_limit_exceeded",
  "detail": "You have exceeded the limit of 100 requests per hour. Try again in  seconds.",
  "limit": "100 requests per IP per hour",
  "retryAfterSeconds": 1234,
  "why": ""
}

Constructive guidance fields (add to the refusal body):

{
  "cachedResultUrl": "/api/result?id=",
  "alternativeEndpoint": "/api/",
  "upgradeUrl": "https:///pricing",
  "humanUrl": "https:///contact"
}

Proactive headers (add to success responses):

RateLimit: limit=100, remaining=99, reset=3600
RateLimit-Policy: 100;w=3600

Reference security considerations where relevant:

  • SC-1: Published limits may be higher than enforced limits
  • SC-2: why must describe the category of protection, not the mechanism
  • SC-3: expected must use positive descriptions
  • SC-6: Guidance URLs must be relative or same-origin

Phase 6: Generate the Assessment Document

Output a structured markdown document:

# Graceful Boundaries Assessment: 

## Summary
- Confirmed level: 
- Declared level: 
- Likely level: 

## What was checked
- Limits endpoint:  — 
- Proactive headers: 
- Refusal format: 

## Gaps to next level


## Implementation plan


## Security notes

What This Skill Does NOT Do

  • Does not implement changes on the target service
  • Does not deliberately trigger rate limits or 429 responses
  • Does not require access to the service's source code
  • Does not assess general API design quality beyond limit communication
  • Is distinct from the agent-readiness-audit skill (which assesses overall AI discoverability, not rate limit conformance specifically)

常见问题

这个技能会实际请求目标 URL 吗?
会。它通过 curl 或任意标准 HTTP 客户端直接对目标服务发起检测,无需特殊工具或依赖。
它会主动触发 429 来验证行为吗?
不会。该技能明确不会主动触发限速;在没有观察到真实拒绝响应时,Level 1 和 Level 3 会被标注为不可验证,并在文档中说明原因。
这与通用 API 审计有什么区别?
本技能专注于 Graceful Boundaries 规范下的限速通信评估,不涉及整体 API 设计质量或通用 AI 可发现性,后者由另一个独立技能负责。

相关技能

以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。

作者 johnpatternai21 次安装8 星标

把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。

作者 nssa.io1.0k 次安装47 星标

通过托管 OAuth 访问 Microsoft Graph Excel 接口,读写 OneDrive 中的工作簿、工作表、区域、表格与图表。

作者 byungkyu800 次安装42 星标

从 AdMapix API 拉取广告创意、应用、榜单和收入预估等数据,原样返回结构化 JSON。

作者 fly0pants

snapsynapse 的更多技能

浏览全部技能

用清单、SHA-256 哈希和变更日志为 Agent Skill 包建立版本、校验与溯源机制。

作者 snapsynapse38 次安装