快速了解
它能做什么
在本地审计第三方 AI API 中继或代理,并生成基于证据的风险报告。
本站提供的是中文说明,不代表该项目或 Plugin 自身提供中文界面;语言支持请以上游文档为准。
选择前先看
API Relay Audit 面向 AI API 中继、网关、代理和转售服务执行 14 步安全检查。它会检查隐藏提示注入、模型或工具调用替换迹象、上下文截断、错误泄露、流式响应异常,以及可选的 Web3 钱包安全行为,并输出 Markdown 报告。
适合谁
适合在将编程、生产或钱包敏感流量交给第三方中继前进行评估的开发者和重视安全的智能体用户。
常见任务
- 在依赖某个中继处理智能体或编程流量前评估其风险。
- 排查疑似提示篡改、身份覆盖、上下文截断或工具调用改写。
- 针对钱包敏感的中继工作流运行 Web3 或完整审计配置。
权限与数据
使用中继 API 密钥,并向你配置的中继发送审计请求。
权限- 读取 API_RELAY_AUDIT_KEY、API_RELAY_AUDIT_URL 以及可选的模型和配置环境变量。
- 在本地运行 Python 3 和 curl。
- 向配置的中继发起网络请求,并在一键命令中下载引用的审计脚本。
- 技能说明要求不要在摘要、文件名、报告、终端输出或评论中输出原始 API 密钥。
- 生成的发现结果会写入本地 Markdown 报告。
- 你配置的第三方 AI API 中继或代理。
- 一键命令中用于获取独立审计脚本的 GitHub 原始内容服务。
- 运行中继审计需要 API_RELAY_AUDIT_KEY;建议使用临时或低权限密钥。
局限
- 未发现问题不代表中继已被证明安全。
- 报告是技术审计结果,不是法律或安全认证。
- 非 Anthropic 中继或不支持 thinking 流的中继,部分流式检查可能无法得出结论。
- 按量计费的中继在使用激进错误探针时可能产生费用。
- 随附许可证为 AGPL-3.0-only。
DSHub 已核对
- 技能文档已固定到提交 00ce80208ea1178ac39116bf0843517a748e4dce。
- 捕获的技能声明支持 Linux、macOS 和 Windows,并采用 Python 3 加 curl 的工作方式。
- 源文档包含 14 步中继审计和 Markdown 报告输出的说明。
DSHub 未核对
- DSHub 未安装或运行此技能及其审计脚本。
- 实际审计发现、服务行为和审计成本取决于目标中继及所选选项。
固定版本安装
主要操作
这个独立 Skill没有 DSH Plugin 安装操作,请根据源码文档使用真实交付方式。
维护者原文
Skill 使用说明
name: api-relay-audit description: Use when auditing third-party AI API relays, LLM proxies, gateways, or API-key resale services locally before trusting coding, tool, production, or wallet-sensitive traffic. version: 2.4.0 author: Toby Bridges license: AGPL-3.0-only platforms: [linux, macos, windows] metadata: hermes: tags: [security, red-teaming, ai-safety, api-relay, web3] related_skills: [] required_environment_variables:
- name: API_RELAY_AUDIT_KEY prompt: API relay key help: Use a temporary or low-scope key for the relay being tested. required_for: Running relay audits without pasting secrets into chat
API Relay Audit for Hermes Agent
Overview
This skill runs api-relay-audit, a zero-dependency 14-step security audit for third-party AI API relays and proxy services. It checks relay behavior while keeping API relay audit, prompt injection audit, model substitution signals, and Web3 relay audit as separate query families with separate evidence boundaries.
Use the standalone audit.py path by default. It only needs Python 3 and curl, which makes it suitable for local Hermes terminal sessions and sandboxed execution. On Windows, run the POSIX shell recipes from Git Bash or an equivalent shell; direct python audit.py ... invocations also work from PowerShell when the environment variables are set.
When to Use
- The user asks whether an AI API relay, proxy API, resale key, or "API relay" is safe.
- The user provides a relay base URL and wants an evidence-based risk report.
- The user suspects hidden prompts, identity substitution, response tampering, context truncation, tool-call/package substitution, or stream anomalies.
- The user wants to audit Web3/wallet safety behavior with
--profile web3or--profile full.
Do not use this skill for general model benchmarking, provider price comparison, or legal/security certification. The output is a technical audit report, not a guarantee that a service is safe.
Keep these query families separate:
| Query family | Use when | Profile / evidence boundary |
|---|---|---|
| API relay audit | The user wants a local report for a relay, mirror, gateway, LLM proxy, or resale API. | Default general; report is evidence, not certification. |
| Prompt injection audit | The user asks about hidden prompt injection, prompt leakage, instruction override, or extraction behavior. | Steps 3-6; do not publish private prompts or secrets. |
| Model substitution signals | The user suspects model identity, route, latency, or upstream channel mismatch. | Signals from Steps 5, 10, 13, and 14 require corroboration; self-ID and fingerprints are not standalone provider proof. |
| Web3 relay audit | The user is testing wallet-sensitive agent workflows. | Use --profile web3 or --profile full; Step 11 is profile-gated. |
Install or Share
After this file is merged to the public repository, Hermes users can install it as a tap skill:
hermes skills tap add toby-bridges/api-relay-audit
hermes skills install toby-bridges/api-relay-audit/api-relay-audit
For direct testing without adding the whole tap:
hermes skills install toby-bridges/api-relay-audit/skills/api-relay-audit
Required Inputs
| Input | How to provide it | Notes |
|---|---|---|
| Relay API key | Prefer $API_RELAY_AUDIT_KEY via Hermes secure env setup |
Use a temporary or low-scope key when possible. |
| Base URL | Ask the user or use $API_RELAY_AUDIT_URL if already set |
Example: https://relay.example.com/v1. |
| Model | Optional; default is claude-opus-4-6 |
Use the model the user plans to rely on. |
| Profile | Optional; default is general |
Use web3 for wallet users, full for complete coverage. |
Never print the raw API key in summaries, filenames, reports, shell traces, or GitHub comments. If the user pasted a key into chat, avoid repeating it and recommend rotating it after the audit if exposure matters.
Standard Workflow
- Confirm the target base URL, model, and profile.
- Ensure the key is available as
$API_RELAY_AUDIT_KEY. If it is missing, ask the user to configure it through Hermes secure setup or local.env, not by committing it. - Download the standalone script into a temporary directory unless the current repo already contains
audit.py. - Run the audit and write a Markdown report.
- Summarize only evidence from the generated report. Do not overstate safety or make policy promises.
One-Shot Audit Recipe
Use this when the user provides a base URL and wants a normal audit:
This recipe is POSIX shell. On Windows Hermes hosts, use Git Bash for this
one-shot form; if the repository already has audit.py, PowerShell can run the
direct local command shown after the recipe.
set -euo pipefail
: "${API_RELAY_AUDIT_KEY:?Set API_RELAY_AUDIT_KEY through Hermes secure env setup first}"
: "${API_RELAY_AUDIT_URL:?Set API_RELAY_AUDIT_URL to the relay base URL}"
MODEL="${API_RELAY_AUDIT_MODEL:-claude-opus-4-6}"
PROFILE="${API_RELAY_AUDIT_PROFILE:-general}"
WORKDIR="$(mktemp -d)"
REPORT="$PWD/api-relay-audit-report.md"
AUDIT_SCRIPT_REF=v2.4.0
curl -fsSL \
"https://raw.githubusercontent.com/toby-bridges/api-relay-audit/${AUDIT_SCRIPT_REF}/audit.py" \
-o "$WORKDIR/audit.py"
python3 "$WORKDIR/audit.py" \
--key "$API_RELAY_AUDIT_KEY" \
--url "$API_RELAY_AUDIT_URL" \
--model "$MODEL" \
--profile "$PROFILE" \
--output "$REPORT"
printf 'Report written to %s\n' "$REPORT"
If the current working tree is the api-relay-audit repository and audit.py exists, prefer the local file:
python3 audit.py \
--key "$API_RELAY_AUDIT_KEY" \
--url "$API_RELAY_AUDIT_URL" \
--model "${API_RELAY_AUDIT_MODEL:-claude-opus-4-6}" \
--profile "${API_RELAY_AUDIT_PROFILE:-general}" \
--output api-relay-audit-report.md
Profiles and Cost Controls
| Scenario | Recommended flags |
|---|---|
| Fast first pass | --skip-infra --skip-context --skip-latency-variance |
| Normal relay audit | --profile general |
| Web3 or wallet relay | --profile web3 |
| Complete audit | --profile full |
| Suspicious relay with request-count gating | --warmup 5 to --warmup 20 |
| Avoid intentionally broken requests | --skip-error-leakage |
| Avoid streaming checks | --skip-stream-integrity |
| Avoid upstream channel classification | --skip-channel-classifier |
Warn the user before enabling --aggressive-error-probes because oversized probes can create metered usage on pay-as-you-go relays.
What the 14 Steps Cover
| Step | Area | Purpose |
|---|---|---|
| 1 | Infrastructure recon | DNS, WHOIS, SSL, HTTP headers, and panel hints. |
| 2 | Model list | Available models, model count, and ownership fields. |
| 3 | Token injection | Hidden system-prompt size via token delta. |
| 4 | Prompt extraction | Direct attempts to extract hidden prompts. |
| 5 | Instruction conflict and identity | Whether user instructions and identity settings are overridden. |
| 6 | Jailbreak extraction | Indirect prompt-extraction attempts. |
| 7 | Context length | Canary-based truncation detection. |
| 8 | Tool-call substitution | Package-install command rewriting, AC-1.a. |
| 9 | Error leakage | Credential, header, stack trace, path, and internal-field leakage. |
| 10 | Stream integrity | SSE event whitelist, usage monotonicity, signatures, terminal message_stop completeness, and stream model identity. |
| 11 | Web3 prompt injection | Wallet-safety refusal probes, profile-gated. |
| 12 | Infrastructure fingerprint | Known relay framework signatures, informational only. |
| 13 | Latency variance | Bimodal or unstable routing hints, informational only. |
| 14 | Upstream channel classifier | Bedrock, Vertex, OpenRouter, Cloudflare AI Gateway, or transparent Anthropic relay hints from headers, message IDs, and body signals. |
Report Summary Template
After running the audit, summarize in this format:
## Audit Result: <relay host>
Overall risk: LOW / MEDIUM / HIGH
- Token injection: <delta or unavailable>
- Prompt extraction: <count or summary>
- User control: <instruction/identity result>
- Context length: <full/truncated/inconclusive>
- Tool-call substitution: <clean/substituted/inconclusive>
- Error leakage: <none/medium/high/critical/inconclusive>
- Stream integrity: <clean/anomaly/inconclusive>
- Upstream channel: <direct/known channel/transparent/inconclusive>
- Web3 profile: <not run/clean/injected/inconclusive>
- Informational: <infra fingerprint and latency variance highlights>
Recommendation: <use / use with caution / do not use>, based only on the report evidence.
Common Pitfalls
- Do not treat "no finding" as proof of safety. It only means these probes did not catch tampering.
- Do not paste or repeat API keys in chat. Prefer
API_RELAY_AUDIT_KEY. - Do not skip dual-distribution context when editing the project itself: changes to modular audit logic usually need root
audit.pyparity. - Do not promise product timelines, vendor cooperation, or risk-policy changes from an audit result.
- If a relay is non-Anthropic or does not support thinking streams, Step 10 may be inconclusive rather than clean.
Verification Checklist
-
skills/api-relay-audit/SKILL.mdfrontmatter hasname,description,version,author,license, andmetadata.hermes.tags. - Description is under 1024 characters and starts with "Use when".
- The audit command uses
$API_RELAY_AUDIT_KEY, not a literal key. - The report was generated as Markdown and the key was not echoed.
- Any public reply or GitHub comment is grounded only in the report, README, ROADMAP, FOR_JOHN, or current code.
有意识地管理
安装与管理
前置条件与目标 Profile
目标: 安全与治理 Profile
交付方式: Skill 文件 — https://raw.githubusercontent.com/toby-bridges/api-relay-audit/00ce80208ea1178ac39116bf0843517a748e4dce/skills/api-relay-audit/SKILL.md。
兼容性与访问范围
Linux, macOS, and Windows; requires Python 3 and curl: Not declared in supplied evidence。
风险事实
Requires an API relay key; use a temporary or low-scope key and do not paste it into chat or reports.
证据 ↗Audit probes contact the configured third-party relay and can incur metered usage; aggressive error probes need an explicit warning.
证据 ↗Licensed under AGPL-3.0-only.
证据 ↗证据与编辑审查Manifest、Bundle patch、分发与新鲜度
不可变证据
审查状态与源码活动
在核对来源内容和不可变发布记录后,已由人工批准发布。AI 参与了内容草稿生成,最终发布决定由人工完成。
人工审查于 2026/9/5 UTC 17:24。GitHub 事实核对日期: 2026/9/5 UTC 16:31。
自当前证据基线以来,没有记录到重要源码变化。