What this check measures
Measures systematic excess input tokens above baseline framing overhead that reveal hidden relay system prompts or billing padding.
Measures systematic excess input tokens above baseline framing overhead that reveal hidden relay system prompts or billing padding.
Hidden relay instructions can hijack model persona, steer tool behavior, waste context capacity, and inflate every billed API call.
Run on newly onboarded API relays, unexpected billing spikes, or before deploying strict agentic workflows.
Many middleman relays prepend boilerplate jailbreak guards, persona overrides, or hidden routing tags. Even when the model conceals that text, usage accounting often leaves a clean positive offset.
Compute exact expected prompt token counts locally using baseline OpenAI message framing rules.
Send controlled low-noise completion requests and extract usage.prompt_tokens from JSON and SSE responses.
Compare observed vs expected overhead above chat-template margin and report excess token delta.
Small fixed chat-template deltas pass; large unexplained offsets trigger warn/fail with observed vs expected delta metrics.
Delta between locally estimated input tokens and API-reported prompt_tokens across repeated probe payloads.
Cannot measure silent injection if a relay rewrites or strips usage.prompt_tokens to match client-side guesses, or omits usage metadata entirely.
Implemented in @lmspeed/audit v0.3.3 (ruleset independent-2026-11-22.2); supplementary capability/injection design cross-checked against Veridrop, LLMprobe-engine, and meow-llm-detector specs.