OpenClaw skill for local API Relay Audit. Use when an OpenClaw agent must audit a third-party AI API relay, LLM proxy, gateway, or resale API before trusting coding, tool, production, or wallet-sensitive traffic.
$npx -y skills add toby-bridges/api-relay-audit --skill api-relay-auditInstalls into the current project.
Run `npx skills use "https://github.com/toby-bridges/api-relay-audit" --skill "toby-bridges/api-relay-audit"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/toby-bridges/api-relay-audit" that are relevant to the current task. Run `npx skills add "https://github.com/toby-bridges/api-relay-audit"` and select the relevant skills, then follow their instructions.
| 1 | <p align="center"> |
| 2 | <img alt="API Relay Audit - local AI API relay security audit with separate query families for relay audit, prompt injection audit, model substitution signals, and Web3 relay audit." src="./assets/readme-banner.png"> |
| 3 | </p> |
| 4 | |
| 5 | # API Relay Audit |
| 6 | |
| 7 | <p align="center"> |
| 8 | Local security audit for AI API relays and LLM proxies. |
| 9 | </p> |
| 10 | |
| 11 | <p align="center"> |
| 12 | <a href="https://toby-bridges.github.io/api-relay-audit/"><img alt="GitHub Pages" src="https://img.shields.io/badge/GitHub%20Pages-Live%20Site-0a7f5a?style=for-the-badge"></a> |
| 13 | <a href="#chinese-readme"><img alt="README 中文" src="https://img.shields.io/badge/README-%E4%B8%AD%E6%96%87-111111?style=for-the-badge"></a> |
| 14 | <a href="https://x.com/li9292"><img alt="X @li9292" src="https://img.shields.io/badge/X-%40li9292-111111?style=for-the-badge"></a> |
| 15 | <a href="https://github.com/toby-bridges"><img alt="GitHub toby-bridges" src="https://img.shields.io/badge/GitHub-toby--bridges-24292f?style=for-the-badge"></a> |
| 16 | </p> |
| 17 | |
| 18 | <p align="center"> |
| 19 | <a href="./SKILL.md"><strong>OpenClaw Skill</strong></a> |
| 20 | · |
| 21 | <a href="./skills/api-relay-audit/SKILL.md"><strong>Hermes Skill</strong></a> |
| 22 | </p> |
| 23 | |
| 24 | ## What Is API Relay Audit? |
| 25 | |
| 26 | API Relay Audit is a local security audit tool for AI API relays and LLM proxies. It keeps API relay audit, prompt injection audit, model substitution signals, and Web3 relay audit as separate query families so each result keeps a clean evidence boundary. Your API key is sent only to the relay URL you choose. |
| 27 | |
| 28 | Use it when you rely on a third-party AI API relay, OpenAI-compatible proxy, Claude-compatible proxy, or Web3 agent workflow and want a repeatable Markdown report before trusting that relay with production or wallet-related traffic. |
| 29 | |
| 30 | ## AI API Relay Security Audit |
| 31 | |
| 32 | - **Detect relay tampering:** prompt injection, prompt extraction, identity consistency signals, context truncation, tool-call rewriting, error-response leakage, and SSE stream anomalies. |
| 33 | - **Run locally:** the standalone `audit.py` uses only Python stdlib plus `curl`; your API key is sent only to the relay URL you choose. |
| 34 | - **Produce reviewable evidence:** each run generates a structured Markdown report with per-step findings and a final `LOW / MEDIUM / HIGH` verdict. |
| 35 | |
| 36 | ## Query Family Boundaries |
| 37 | |
| 38 | | Query family | User intent | Profile / steps | Evidence boundary | |
| 39 | |---|---|---|---| |
| 40 | | API relay audit | Audit a third-party relay, mirror, gateway, LLM proxy, or resale API before trusting traffic. | `general` by default; `full` for every probe | Produces a local report, not a safety certificate. | |
| 41 | | Prompt injection audit | Detect hidden prompt injection, prompt leakage, instruction override, and extraction behavior. | `general`; Steps 3-6 | Records prompt evidence without publishing private prompts or secrets. | |
| 42 | | Model substitution signals | Collect model identity, stream, latency, and upstream channel signals. | `general`; Steps 5, 10, 13, 14 | Self-ID, latency, and channel fingerprints are signals, not standalone proof of provider substitution. | |
| 43 | | Web3 relay audit | Check wallet-sensitive relay behavior before agent workflows touch signing or transactions. | `web3` or `full`; Step 11 | Profile-gated; general relay audits do not imply wallet safety. | |
| 44 | |
| 45 | The canonical contract lives in [docs/query-families.md](./docs/query-families.md). README headings, Pages cards, issue templates, and skill descriptions should preserve these boundaries instead of flattening them into one slogan. |
| 46 | |
| 47 | ## Quick Start |
| 48 | |
| 49 | ```bash |
| 50 | AUDIT_SCRIPT_REF=v2.3.0 |
| 51 | curl -fsSL "https://raw.githubusercontent.com/toby-bridges/api-relay-audit/${AUDIT_SCRIPT_REF}/audit.py" -o audit.py |
| 52 | |
| 53 | python audit.py --key <YOUR_KEY> --url <BASE_URL> --output report.md |
| 54 | |
| 55 | # Web3 / wallet users |
| 56 | python audit.py --key <YOUR_KEY> --url <BASE_URL> --profile web3 --output report.md |
| 57 | ``` |
| 58 | |
| 59 | See a public-safe fixture report: [sanitized audit report](./docs/examples/sanitized-audit-report.md). |
| 60 | Use `master` as `AUDIT_SCRIPT_REF` only when intentionally testing unreleased |