How We Protect Keys in Your Prompts
If a governed agent prompt contains an API key, Clevername detects it, strips it before it reaches the AI model, and offers to store it securely in your BYOK key store. Available on every tier (Free, Pro, Team, Enterprise) with no configuration required.
The short version
Every prompt routed through Clevername's governance gateway is scanned for API key patterns before it reaches any AI model. If a key is detected, it is immediately strippedfrom the prompt — the AI never sees it. You are then offered the choice to store it securely in your BYOK key store (GCP Secret Manager in production, AES-256-GCM in local dev) or discard it. This happens automatically on every tier with zero setup.
What we detect
Clevername recognizes API key formats from 30+ providers:
sk-...sk-ant-...AIza...AKIA...Bearer ey...sk_live_...ghp_...Long random stringsWhy this matters
API keys pasted into prompts are forwarded to AI providers in plaintext. This means your key could appear in provider logs, training data, or be exposed in a breach. Key interception prevents this by ensuring your key never leaves Clevername's backend.
What happens when you paste a key
- 1
You send a message containing a key
You paste "Use this key: sk-abc123..." into the chat. The message is sent to Clevername's backend over TLS.
- 2
Key is detected and stripped
Before the message is forwarded to any AI model, our scanner identifies the API key pattern and removes it. The AI receives your message with the key replaced by [KEY REDACTED].
- 3
Provider is identified
Clevername determines which provider the key belongs to (OpenAI, Anthropic, etc.) by matching its format. If the format is ambiguous, the key is validated against multiple providers in parallel to identify it.
- 4
You are offered a choice
The chat shows a message asking if you want to store the key securely. You can confirm (stores it in GCP Secret Manager), cancel (discards it), or ignore the prompt.
- 5
Key is stored or discarded
If you confirm, the key is encrypted and stored in GCP Secret Manager with CMEK protection — the same infrastructure used for keys you add manually. If you cancel, it is permanently discarded. Either way, the AI model never saw it.
Multiple keys per provider
You can store more than one key for the same provider. When a second key is detected for a provider you already have, Clevername asks you to give it a label(e.g., “Production” or “Testing”) so you can distinguish between them later.
OpenAI: sk-a...3f9b
Default setup. One key per provider, used for all requests.
OpenAI (prod): sk-a...3f9b OpenAI (dev): sk-x...7c2d
Label each key. Bind specific keys to specific agents for isolation.
Agent-key bindings
For teams running multiple AI agents, you can bind specific keys to specific agents. This means Agent A can only use the key you assigned to it — it cannot access keys bound to Agent B. Bindings are enforced at runtime by the guardrail engine.
| Agent | Bound key | Access |
|---|---|---|
| Support Bot | OpenAI (prod) | Can use this key only |
| Code Reviewer | Anthropic (dev) | Can use this key only |
| Unbound agent | None | Cannot use any key unless explicitly bound |
Key health monitoring
Clevername validates your stored keys every 6 hours by making a lightweight API call to the provider. If a key has been revoked, expired, or hit its rate limit, you are notified so you can replace it before your agents start failing.
Key validated successfully. Provider returned a valid response.
Key is valid but approaching a rate limit or usage cap.
Key was revoked, expired, or rejected by the provider. Replace it.
Detection logged
Every key detection event is logged with the provider, whether it was stripped, and the action taken (stored, discarded, or held). The key value itself is never included in logs.
Storage logged
If you confirm storage, the write to GCP Secret Manager generates a Cloud Audit Log entry with a timestamp and the service account that performed the write.
Usage logged
Every time a stored key is fetched for an API call, a DATA_READ audit log entry is created. Enterprise customers can export these to their own SIEM for independent verification.
SOC dashboard visibility
The SOC console includes a Key Interception card showing 24-hour stats: keys intercepted, keys stored, keys rotated, and keys denied. Admins can see trends and respond to anomalies (e.g., a sudden spike in detected keys may indicate a credential leak).