0xOX0X
Cybersecurity

Securing AI API Proxies: Hardening Gateways Against Prompt Theft

Quick Answer

Assume any provider behind an aggregator can see your prompts. Pin reviewed providers, redact sensitive data in a gateway you control, test with canary strings, and protect admin consoles with security keys.

By Marcus VanceUpdated 2026-12-015 min read
A hardware security key plugged into a laptop for FIDO2 authentication in a secure AI development environment.

What Happened With OpenRouter's Inference Providers

On November 22, 2026, OpenRouter published Data Processing Incidents on Inference Providers. Security researchers, credited in the post as Dragos, had reported that some inference providers had data compromised or were not following their stated data policies. OpenRouter said the findings did not show a breach of OpenRouter itself. It took three actions:

  • Off-boarded three providers, which it did not name in the post.
  • Removed 125 endpoints from Zero Data Retention (ZDR) eligibility, including some removed as a precaution.
  • Notified all potentially affected customers.

The post links provider notices, including one from Together titled "Security event: prompt leakage for requests in June and July of 2026." OpenRouter also said it is checking network paths for cases where requests and responses may be forwarded to third parties.

The lesson is broader than one aggregator. When you route prompts through any intermediary, your data reaches every provider behind it. A "no logging" or ZDR label is a promise from that provider, and promises need checking.

Why Prompt Leakage Matters

Prompts often carry more than users expect: internal code, customer records, contract text and system instructions. Unlike a stolen password, leaked prompt content cannot be rotated. Once it is out, it is out.

That makes two controls worth the effort: sending less sensitive data in the first place, and choosing providers whose data terms you can verify.

Triage: Where Your Prompts Can Leak

Risk pointWhat can go wrongWhat to check
Aggregator routingA request is served by a provider you did not review.Pin allowed providers in your router settings, or require ZDR-eligible endpoints only.
Provider loggingPrompts are stored or forwarded despite the policy.Read the provider's data terms and any incident notices; use canary strings (see below).
Your own logsYour gateway or app logs full prompts.Log metadata only, or redact before logging.
API keysA leaked key lets someone else send requests on your account.Scope keys per app, set spend limits, and rotate keys on any suspicion.
Admin consolesAn attacker signs in and changes routing or reads history.Use phishing-resistant login (security keys or passkeys) for every admin account.

Protect the Admin Consoles With Phishing-Resistant Login

Adversary-in-the-middle phishing kits can relay a password and a TOTP code in real time. FIDO2 security keys and passkeys resist this, because the browser only lets the key sign for the real domain it was registered on. A look-alike login page gets nothing it can reuse.

This protects the accounts that control routing, keys and billing. It does not stop a provider from mishandling prompts you send it. Treat it as one control among several, not the fix for provider-side leakage.

Run Your Own Gateway in Front of the Aggregator

A diagram of a hardened AI gateway proxying requests to multiple LLM providers.

A small gateway that you control, running in your own cloud account, gives you one place to enforce rules before any prompt leaves:

  1. Redact sensitive fields such as emails, ID numbers and secrets before forwarding.
  2. Allow-list providers and models per application, so a routing change cannot send regulated data to an unreviewed host.
  3. Log metadata only: who called, which model, token counts and latency, not prompt text.
  4. Hold the real API keys in the gateway, so applications never see them.

The configuration below is illustrative, not a specific product's format:

json
{
  "gateway_config": {
    "listen_port": 8443,
    "upstream": "https://openrouter.ai/api/v1",
    "policy": {
      "redact": ["email", "national_id", "api_key_pattern"],
      "allowed_providers": ["<reviewed-provider-1>", "<reviewed-provider-2>"],
      "require_zdr_endpoints": true
    },
    "logging": {
      "mode": "metadata_only",
      "retention_days": 7
    }
  }
}

Redaction lowers the impact of a leak; it does not make a leaky provider safe. Highly sensitive workloads still belong with providers whose contracts and data terms you have reviewed directly.

Test Providers With Canary Strings

  1. Create a unique canary string that looks like a secret but means nothing, for example a made-up API key format.
  2. Send it in a test prompt to each provider you plan to use, and record the date and endpoint.
  3. Search for it later in public paste sites, code search and any threat-intelligence feed you subscribe to.
  4. Drop the provider from your allow-list if the string ever appears outside your systems, and report it to the provider and the aggregator.

A clean result does not prove a provider is safe; it only means this test found nothing.

Aggregator or Direct Provider?

  • Use an aggregator for prototyping and low-sensitivity workloads where model choice matters more than data control. Pin providers and require ZDR where available.
  • Use a direct provider contract (for example with the model vendor or your cloud platform) for customer data, regulated data or proprietary code, where you need a data processing agreement you can enforce.
  • In both cases, protect admin accounts with security keys and keep full prompts out of your own logs.

Next action: list every application that sends prompts through an aggregator this week, mark which ones carry customer or regulated data, and move those to pinned providers or a direct contract first. For network-level access controls around your gateway, see Cloudflare Access vs Twingate and blocking adversarial distillation scrapers on custom AI APIs.

Share this article

Frequently Asked Questions

Can I still use OpenRouter safely after the provider removals?

For low-sensitivity work, yes, if you pin reviewed providers and require ZDR-eligible endpoints. Assume any provider that serves a request can see the prompt, so keep customer and regulated data on providers whose contracts you have reviewed directly.

Do security keys stop prompt leakage?

No. Security keys and passkeys protect the admin accounts that control routing, keys and billing from phishing. They do not stop a provider from mishandling prompts you send it.

How do I check whether a provider leaks my prompts?

Send a unique canary string in a test prompt, record where you sent it, and search for it later in public sources and any threat-intelligence feeds you use. A clean result does not prove a provider is safe.

Free Weekly Dispatch

Get the Weekly SMB AI & SaaS Brief

Practical software benchmarks, prompt templates, and ROI breakdowns delivered every Tuesday. No fluff, unsubscribe anytime.