> Agent-ready spec from Diff of the Day (2026-11-27, idea 2). Give this file to your coding agent (Claude Code, Codex, Cursor) and ask it to build the P0 requirements first.

# Spec: LLM provider fingerprint probe

## Problem Statement
Model routers sell the same model from several providers, and labels such as "zero data retention" are hard to check. An independent researcher traced some DeepSeek routes to ByteDance's Ark API by comparing request IDs, tool-call ID formats and the IPs that fetched an image. Developers who send data through these routes cannot see which backend actually serves them.

## Goals
- Produce a fingerprint (headers, ID formats, latency, image-fetch IP) for each route you test.
- Group routes that look like the same backend, with the evidence for each grouping.
- Keep a dated record so you can see when a route changes backend.

## Non-Goals
- Proving where data is stored or how long it is kept: fingerprints show likely backends, not retention.
- Testing at scale or load-testing providers: a few small requests per route only.
- Bypassing any provider's terms or rate limits.

## User Stories
- As a developer choosing a model route, I want to know which backend serves it so that I can decide where my prompts go.
- As a developer, I want the evidence behind each grouping so that I can judge it myself.
- As a developer, I want to rerun the probe next month so that I notice a silent backend change.
- Edge case: as a developer, I want a route that refuses tool calls or images marked "partial" rather than failing the whole run.

## Requirements
### P0 (must have)
1. **Config file** `routes.yaml`: router base URL, model IDs to test, the API key read from an environment variable.
   - [ ] The key is never written to logs, reports or the repo.
2. **Probe run** per route: 3 plain prompts, 1 tool-call prompt, 1 prompt that asks the model to fetch an image from a URL you control.
   - [ ] Logs response headers, request ID format, tool-call ID format and response time.
3. **Image beacon**: a tiny HTTP endpoint you host that logs the caller IP and user agent per unique image URL.
   - [ ] Given a route that fetches the image, when the probe runs, then the report shows the caller IP and its owner (from a public WHOIS lookup).
4. **Report** `fingerprints-<date>.md`: one row per route and a section that groups routes with matching fingerprints.

### P1 (nice to have)
- Canary strings in prompts, to check later whether any of them appear elsewhere.
- A diff against the previous report.

### P2 (future)
- A scheduled monthly run that opens an issue when a route's fingerprint changes.

## Success Metrics
- Leading: all chosen routes probed in one run; each grouping backed by at least two matching signals.
- Lagging: you change at least one routing decision, or confirm the current one, with evidence.

## Open Questions
- Which routes and models matter to you? (you)
- Where do you host the image beacon (any small server you control)? (you)

## Timeline
One weekend: Saturday for probe and beacon, Sunday for report and grouping.

## Agent Instructions
- **Suggested stack**: Python 3.12 with httpx; a 30-line FastAPI or Node server for the beacon.
- **Build order**: config loader → single-route probe with recorded fixtures → beacon → report writer → grouping logic → P1.
- **Safety**: keys only from environment variables; small request counts; respect each provider's terms; never send personal or real customer data in prompts.
- **Done when**: the report lists every configured route with its fingerprint and groups.

## Sources
- DeepSeek routes traced to ByteDance's Ark API: https://kendell.dev/blog/arkwrapper/
- Canary tokens for your AI supply chain: https://www.dragos.com/blog/ai-supply-chain-security-canary-tokens
