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.
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 web3 or --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
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:
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.py parity.
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.md frontmatter has name, description, version, author, license, and metadata.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.
1---2name: api-relay-audit-23description: 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.4license: AGPL-3.0-only5---67# API Relay Audit for Hermes Agent89## Overview1011This 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.1213Use 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.1415## When to Use1617- The user asks whether an AI API relay, proxy API, resale key, or "API relay" is safe.18- The user provides a relay base URL and wants an evidence-based risk report.19- The user suspects hidden prompts, identity substitution, response tampering, context truncation, tool-call/package substitution, or stream anomalies.20- The user wants to audit Web3/wallet safety behavior with `--profile web3` or `--profile full`.2122Do 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.2324Keep these query families separate:2526| Query family | Use when | Profile / evidence boundary |27|---|---|---|28| 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. |29| 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. |30| 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. |31| Web3 relay audit | The user is testing wallet-sensitive agent workflows. | Use `--profile web3` or `--profile full`; Step 11 is profile-gated. |3233## Install or Share3435After this file is merged to the public repository, Hermes users can install it as a tap skill:3637```bash38hermes skills tap add toby-bridges/api-relay-audit39hermes skills install toby-bridges/api-relay-audit/api-relay-audit40```4142For direct testing without adding the whole tap:4344```bash45hermes skills install toby-bridges/api-relay-audit/skills/api-relay-audit46```4748## Required Inputs4950| Input | How to provide it | Notes |51|---|---|---|52| Relay API key | Prefer `$API_RELAY_AUDIT_KEY` via Hermes secure env setup | Use a temporary or low-scope key when possible. |53| Base URL | Ask the user or use `$API_RELAY_AUDIT_URL` if already set | Example: `https://relay.example.com/v1`. |54| Model | Optional; default is `claude-opus-4-6` | Use the model the user plans to rely on. |55| Profile | Optional; default is `general` | Use `web3` for wallet users, `full` for complete coverage. |5657Never 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.5859## Standard Workflow60611. Confirm the target base URL, model, and profile.622. 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.633. Download the standalone script into a temporary directory unless the current repo already contains `audit.py`.644. Run the audit and write a Markdown report.655. Summarize only evidence from the generated report. Do not overstate safety or make policy promises.6667## One-Shot Audit Recipe6869Use this when the user provides a base URL and wants a normal audit:7071This recipe is POSIX shell. On Windows Hermes hosts, use Git Bash for this72one-shot form; if the repository already has `audit.py`, PowerShell can run the73direct local command shown after the recipe.7475```bash76set -euo pipefail7778: "${API_RELAY_AUDIT_KEY:?Set API_RELAY_AUDIT_KEY through Hermes secure env setup first}"79: "${API_RELAY_AUDIT_URL:?Set API_RELAY_AUDIT_URL to the relay base URL}"8081MODEL="${API_RELAY_AUDIT_MODEL:-claude-opus-4-6}"82PROFILE="${API_RELAY_AUDIT_PROFILE:-general}"83WORKDIR="$(mktemp -d)"84REPORT="$PWD/api-relay-audit-report.md"85AUDIT_SCRIPT_REF=v2.4.08687curl -fsSL \88 "https://raw.githubusercontent.com/toby-bridges/api-relay-audit/${AUDIT_SCRIPT_REF}/audit.py" \89 -o "$WORKDIR/audit.py"9091python3 "$WORKDIR/audit.py" \92 --key "$API_RELAY_AUDIT_KEY" \93 --url "$API_RELAY_AUDIT_URL" \94 --model "$MODEL" \95 --profile "$PROFILE" \96 --output "$REPORT"9798printf 'Report written to %s\n' "$REPORT"99```100101If the current working tree is the `api-relay-audit` repository and `audit.py` exists, prefer the local file:102103```bash104python3 audit.py \105 --key "$API_RELAY_AUDIT_KEY" \106 --url "$API_RELAY_AUDIT_URL" \107 --model "${API_RELAY_AUDIT_MODEL:-claude-opus-4-6}" \108 --profile "${API_RELAY_AUDIT_PROFILE:-general}" \109 --output api-relay-audit-report.md110```111112## Profiles and Cost Controls113114| Scenario | Recommended flags |115|---|---|116| Fast first pass | `--skip-infra --skip-context --skip-latency-variance` |117| Normal relay audit | `--profile general` |118| Web3 or wallet relay | `--profile web3` |119| Complete audit | `--profile full` |120| Suspicious relay with request-count gating | `--warmup 5` to `--warmup 20` |121| Avoid intentionally broken requests | `--skip-error-leakage` |122| Avoid streaming checks | `--skip-stream-integrity` |123| Avoid upstream channel classification | `--skip-channel-classifier` |124125Warn the user before enabling `--aggressive-error-probes` because oversized probes can create metered usage on pay-as-you-go relays.126127## What the 14 Steps Cover128129| Step | Area | Purpose |130|---|---|---|131| 1 | Infrastructure recon | DNS, WHOIS, SSL, HTTP headers, and panel hints. |132| 2 | Model list | Available models, model count, and ownership fields. |133| 3 | Token injection | Hidden system-prompt size via token delta. |134| 4 | Prompt extraction | Direct attempts to extract hidden prompts. |135| 5 | Instruction conflict and identity | Whether user instructions and identity settings are overridden. |136| 6 | Jailbreak extraction | Indirect prompt-extraction attempts. |137| 7 | Context length | Canary-based truncation detection. |138| 8 | Tool-call substitution | Package-install command rewriting, AC-1.a. |139| 9 | Error leakage | Credential, header, stack trace, path, and internal-field leakage. |140| 10 | Stream integrity | SSE event whitelist, usage monotonicity, signatures, terminal `message_stop` completeness, and stream model identity. |141| 11 | Web3 prompt injection | Wallet-safety refusal probes, profile-gated. |142| 12 | Infrastructure fingerprint | Known relay framework signatures, informational only. |143| 13 | Latency variance | Bimodal or unstable routing hints, informational only. |144| 14 | Upstream channel classifier | Bedrock, Vertex, OpenRouter, Cloudflare AI Gateway, or transparent Anthropic relay hints from headers, message IDs, and body signals. |145146## Report Summary Template147148After running the audit, summarize in this format:149150```markdown151## Audit Result: <relay host>152153Overall risk: LOW / MEDIUM / HIGH154155- Token injection: <delta or unavailable>156- Prompt extraction: <count or summary>157- User control: <instruction/identity result>158- Context length: <full/truncated/inconclusive>159- Tool-call substitution: <clean/substituted/inconclusive>160- Error leakage: <none/medium/high/critical/inconclusive>161- Stream integrity: <clean/anomaly/inconclusive>162- Upstream channel: <direct/known channel/transparent/inconclusive>163- Web3 profile: <not run/clean/injected/inconclusive>164- Informational: <infra fingerprint and latency variance highlights>165166Recommendation: <use / use with caution / do not use>, based only on the report evidence.167```168169## Common Pitfalls1701711. Do not treat "no finding" as proof of safety. It only means these probes did not catch tampering.1722. Do not paste or repeat API keys in chat. Prefer `API_RELAY_AUDIT_KEY`.1733. Do not skip dual-distribution context when editing the project itself: changes to modular audit logic usually need root `audit.py` parity.1744. Do not promise product timelines, vendor cooperation, or risk-policy changes from an audit result.1755. If a relay is non-Anthropic or does not support thinking streams, Step 10 may be inconclusive rather than clean.176177## Verification Checklist178179- [ ] `skills/api-relay-audit/SKILL.md` frontmatter has `name`, `description`, `version`, `author`, `license`, and `metadata.hermes.tags`.180- [ ] Description is under 1024 characters and starts with "Use when".181- [ ] The audit command uses `$API_RELAY_AUDIT_KEY`, not a literal key.182- [ ] The report was generated as Markdown and the key was not echoed.183- [ ] Any public reply or GitHub comment is grounded only in the report, README, ROADMAP, FOR_JOHN, or current code.
Run npx skillmds@latest add toby-bridges/api-relay-audit-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
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. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: makes network calls, reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under AGPL-3.
toby-bridges (@toby-bridges) published this skill. Their other Agent Skills are listed on their SkillMD profile.