Local AI API Relay Security Audit

AI API 中转站安全审计,本地运行,只连接你指定的中转站

API Relay Audit 是本地运行、证据优先的 AI API 中转站 / LLM proxy 安全审计工具。它把 API relay audit、prompt injection audit、model substitution signals 和 Web3 relay audit 拆成独立查询意图。

生成审计命令 查看 GitHub

什么时候用

当你准备把第三方 AI API 中转站、Claude/OpenAI 兼容代理、coding agent 自动化或钱包相关流量放进生产环境前,用它生成一份可复查的 Markdown 报告。

检测什么

覆盖 token injection、prompt extraction、identity consistency signals、context truncation、tool-call rewriting、error leakage、SSE stream integrity 和 Web3 signature isolation probes。

不声称什么

它不为任何中转站颁发安全认证,也不替代人工安全审查。`inconclusive` 不是 `clean`,被拦截或无法判断的探针会保留在报告里。

查询意图边界

API relay audit

审计第三方中转站、镜像、网关、LLM proxy 或 resale API;默认使用 general profile。

Prompt injection audit

检测隐藏 prompt 注入、prompt 泄漏、指令覆盖和提取行为;主要覆盖 Step 3-6。

Model substitution signals

收集 self-ID、stream、latency 和 channel fingerprint 信号,但这些信号不能单独证明 provider 替换。

Web3 relay audit

钱包敏感场景使用 --profile web3--profile full,Step 11 是 profile-gated。

快速开始

AUDIT_SCRIPT_REF=v2.3.0
curl -fsSL "https://raw.githubusercontent.com/toby-bridges/api-relay-audit/${AUDIT_SCRIPT_REF}/audit.py" -o audit.py
python audit.py --key <YOUR_KEY> --url <BASE_URL> --output report.md

# Web3 / 钱包用户
python audit.py --key <YOUR_KEY> --url <BASE_URL> --profile web3 --output report.md

长尾阅读