Reject api keys

From RedHatProductSecurity/prodsec-skills · View interactive version

Reject api keys is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Reject raw API key authentication in inference engines. Use when designing, reviewing, or auditing authentication mechanisms for inference engines or LLM API endpoints in production environments.

How to use this skill

Skill file

Reject Raw API Keys in Inference Engines

Security Requirement

Inference engines MUST reject raw API keys as an authentication mechanism. If legacy interoperability requires API key support, the inference engine (or an API gateway in front of it) MUST proxy and convert API keys into short-lived IdP-issued tokens before processing the request.

Rationale

API keys present significant security risks in production:

Acceptable Approach for Legacy Interop

When legacy systems require API key authentication:

Client sends API key
  → API Gateway intercepts
  → Gateway exchanges API key for short-lived IdP token
    (via client_credentials or token exchange)
  → Gateway forwards IdP token to inference engine
  → Inference engine validates IdP token (never sees API key)

Implementation Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.