# Repository Briefing: toby-bridges/api-relay-audit
> Source: https://repoforai.com/repo/toby-bridges/api-relay-audit (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/toby-bridges/api-relay-audit
- **Official Docs / Website**: https://apirelayaudit.com
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Python
- **License**: AGPL-3.0
- **Engineering Health**: A (79/100 · Maintenance 35/35 · Adoption 16/25 · Releases 17/20 · License 11/20)
- **Latest Release**: v2.5.0 (2026-10-10) — https://github.com/toby-bridges/api-relay-audit/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: MCP, CLI
- **Momentum**: 939 ★ total (+1 24h / +5 7d) · 86 forks
- **Topics**: `ai-agents`, `ai-audit`, `ai-security`, `anthropic`, `api-gateway`, `claude`, `dsh-plugin`, `llm-audit`, `llm-proxy`, `llm-security`, `model-substitution`, `openai-api`
- **When to Use**: Best for: Platform and security teams vetting a relay before routing production or coding-agent traffic, with local evidence they can rerun and review. Skip if: You need continuous inline enforcement, definitive upstream model attestation, a relay safety certificate, or coverage for non-Claude routes through the DSH plugin.

## Overview
```text
### Architecture & Core Mechanics
API Relay Audit is a local, active testing client rather than a gateway or inline monitor. The standalone `audit.py` uses Python's standard library and curl. The modular development path lives in `api_relay_audit/` and `scripts/`, with `tests/` and an `httpx>=0.24.0` dependency in `requirements.txt`. Probes travel to the chosen relay; results are collected locally as Markdown or JSON. The optional transparency log records hashes only, and submitting redacted evidence is a separate step subject to maintainer review.

The Node package `dsh-api-relay-audit` wraps the local runner for DeepSeek Harness hosts that use the official `@deepseek-ai/dsh-commands` registry. It resolves the current provider's base URL, model, and credential reference, then passes the credential to the audit process in an environment variable. OpenClaw and Hermes skill files remain available for direct use, but active plugin distribution centers on DSH; an MCP server entrypoint is not established.

### Key Capabilities & Differentiators
The 14-step suite uses a six-dimensional risk matrix and retains per-step evidence alongside a LOW, MEDIUM, or HIGH summary. It checks reported input-token surplus, prompt and instruction behavior, context truncation, changes to pinned package-command text, and leakage in error responses. Where Anthropic-style SSE is supported, it inspects event types, usage monotonicity, thinking signatures, and stream model identity. A token surplus warrants checking request wrapping and accounting; it does not prove hidden instructions were inserted.

The relay API can be Anthropic- or OpenAI-compatible, but the DSH distribution expects the selected route to identify as Claude. Model self-identification, stream metadata, latency variance, and channel fingerprints are signals to corroborate, not provider attestation. The default `general` profile excludes wallet-specific checks; `web3` and `full` include checks for transfer guidance and refusal behavior around signed transactions and private keys.

### Trade-offs & Limitations
Compared with hvoy.ai for reputation lookup and cctest.ai for one-click tests and channel fingerprinting, this tool is a better fit when the team needs a repeatable run and evidence it can inspect. Local execution keeps report generation on the operator's machine; it does not remove the need to trust the selected relay with the credential used for testing. Use a dedicated test credential and budget for metered calls before running the full audit.

Treat the result as a point-in-time observation, not a safety certificate. Blocked, unsupported, and ambiguous probes remain inconclusive rather than passing. JSON preserves the full Markdown evidence, so it is not safe to publish without review and redaction. The public example is a synthetic fixture, not a live-service benchmark. Teams distributing the tool or offering remote access to a modified version should review AGPL-3.0 source-code obligations.

### Hardware & Deployment Guide
For a standalone run, use Python and curl, pin a published release, and supply the target URL and a test credential. v2.5.0 supports `--key-env API_RELAY_AUDIT_KEY` and `--format json`; without `--output`, stdout carries one JSON document and progress goes to stderr. No GPU or local model is needed. Live auditing is not offline: the relay receives the probe requests and credential, and a full run may incur token charges. Use `--connectivity` for a lower-cost first pass.

For DSH, the package declares Node `^22.19.0 || >=24.0.0` and requires a compatible host with profiles and the official command registry. Pin a release tag or immutable commit. v2.4.0 introduced reproducibility metadata, stricter Anthropic stream completion checks, and the DSH bundle. Prefer v2.5.0 for JSON output and safer curl handling: error probes and streaming fallback pass credential-bearing headers through config stdin rather than process arguments.
```

## Key Capabilities
```text
- Runtime: Standalone `audit.py` uses Python's standard library and curl; `requirements.txt` lists `httpx>=0.24.0` for the modular path.
- Audit scope: A 14-step suite and six-dimensional risk matrix organize findings across `general`, `web3`, and `full` profiles.
- Stream integrity: Anthropic-style SSE checks inspect event types, usage monotonicity, thinking signatures, and stream model identity where available.
- Agent integration: `/relay-audit` reuses the active DSH provider configuration and receives credentials through a local environment variable.
- Report automation: v2.5.0 can emit one JSON document on stdout with progress on stderr, while retaining the full Markdown evidence.
- Credential handling: v2.5.0 passes curl headers through config stdin for error probes and streaming fallback rather than exposing the key in process arguments.
```

## Quick Start / Clone
```bash
AUDIT_SCRIPT_REF=v2.5.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 / wallet users
python audit.py --key <YOUR_KEY> --url <BASE_URL> --profile web3 --output report.md
```
