Every day, developers accidentally leak their API keys (Telegram, OpenAI, GitHub). Bots scrape GitHub, and your tokens are gone. I wanted to solve this for my own bots and AI agents, so I built BlindKey — a self-hosted Python gateway that keeps real tokens off the client machines.

How it works

Instead of giving your bot the real API key, the bot gets a revocable client certificate.

  1. The client (bot/agent) connects to BlindKey using mTLS (TLS 1.3).
  2. It sends a request signed with HMAC-SHA256.
  3. BlindKey checks the signature, the nonce (to prevent replay attacks), and an allowlist of allowed methods.
  4. BlindKey injects the real API key and forwards the request to the upstream provider (Telegram, OpenAI, GitHub, etc.).
  5. The response is filtered for secret leaks before being sent back to the client.

Key Features

  • mTLS & HMAC: Bound to the certificate fingerprint. No valid cert + signature = no access.
  • Replay Protection: Nonce cache with TTL.
  • Memory Protection: Custom ResponseBudget to prevent OOM attacks.
  • Audit Log: Hash-chained, tamper-evident logging.
  • Custom Providers: You can easily add any Bearer-token API via config.toml without changing the core code.

The Hard Part: Security Audits

I ran 500,000 fuzzing iterations and an independent AI audit. I found and fixed several edge cases in the approval flow and rate-limiting logic. The project now has 1000+ automated tests and passing CI/CD.

What's next?

I am looking for contributors to help with internationalization, independent audits, and adding more providers.

Check out the repo here: https://github.com/Anonimman01/blindkey

I would love to hear your feedback on the architecture!