toby-bridges/api-relay-audit
Local Python CLI and DSH plugin for auditing LLM API relay behavior
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
audit.py uses Python's standard library and curl; requirements.txt lists httpx>=0.24.0 for the modular path.general, web3, and full profiles./relay-audit reuses the active DSH provider configuration and receives credentials through a local environment variable.Platform and security teams vetting a relay before routing production or coding-agent traffic, with local evidence they can rerun and review.
You need continuous inline enforcement, definitive upstream model attestation, a relay safety certificate, or coverage for non-Claude routes through the DSH plugin.
Quick Start & Installation
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
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/toby-bridges/api-relay-audit.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about api-relay-audit
How does the audit integrate with an existing agent setup?
/relay-audit reuses the active provider's base URL, model, and credential reference; DSH passes the resolved credential to the local process through an environment variable. The verified integration is the DSH command registry; no MCP server entrypoint is established.What hardware and runtime overhead should I plan for?
--connectivity if you only need a lower-cost connectivity check.Can we run this in-house or embed it in a commercial service?
When is this a better fit than hvoy.ai or cctest.ai?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy