Guide · Security
Secret Shield
Keep API keys and passwords private. The AI never sees them.
With Secret Shield on, every secret in your request is masked with a placeholder before the prompt reaches the AI model. The model and the provider that runs it only ever see the placeholder. Your real value is restored in the answer, so your app or coding agent works as normal.
Masked before the AI. In RAM only. Never stored or logged. Masking is fully automatic, so no person ever sees your prompt. Your secrets are erased the moment the answer ends.
1. You send
DB_PASSWORD=
2. The AI sees
DB_PASSWORD=
3. You get back
DB_PASSWORD=
Why use it
Coding agents read .env files, stack traces and configs, and those often hold keys. Secret Shield keeps those values out of what the AI provider can read or log. It's a safety net, not a reason to paste secrets: keep them out of prompts when you can.
Turn it on
There are three switches. Any one of them turns it on.
X-Qubax-Secret-Shield: on.A key can't switch it off while the account switch is on. To shield only some keys, leave the account switch off and turn it on for those keys. Changes apply to the next request.
Header examples
curl https://api.qubax.ai/v1/chat/completions \
-H "Authorization: Bearer $QUBAX_KEY" \
-H "Content-Type: application/json" \
-H "X-Qubax-Secret-Shield: on" \
-d '{
"model": "claude-haiku-4.5",
"messages": [{"role": "user",
"content": "Why does DB_PASSWORD=... fail?"}]
}'from openai import OpenAI
client = OpenAI(
base_url="https://api.qubax.ai/v1",
api_key=QUBAX_KEY,
# every request from this client:
default_headers={
"X-Qubax-Secret-Shield": "on",
},
)# Claude Code
export ANTHROPIC_BASE_URL="https://api.qubax.ai"
export ANTHROPIC_API_KEY="qbx_..."
export ANTHROPIC_CUSTOM_HEADERS="X-Qubax-Secret-Shield: on"The header accepts on or off. Anything else is a 400. Sending off can't override a key or account that has it on.
Check that it worked
Shielded responses carry these headers:
X-Qubax-Secret-Shieldon when the request was shielded.X-Qubax-Secrets-HiddenNo X-Qubax-Secret-Shield header means the request wasn't shielded.
What it hides
- Known key formats anywhere: OpenAI, Anthropic, Google, GitHub, GitLab, Slack, Stripe, Hugging Face, Groq, xAI, AWS access keys, npm, PyPI, Telegram bot tokens, Qubax
qbx_live_keys and more. - Private keys (PEM blocks, OpenSSH, PGP, Bitcoin WIF), JWTs, and seed phrases of 12 to 25 words.
- Passwords and tokens by their label:
password=…,DB_PASSWORD: …,--api-key …,Authorization: Bearer …, cookies, and the password inpostgres://user:…@host.
It reads every text part of the request: messages and history, system prompt, tool descriptions, tool calls and tool results. Example values like changeme, ${API_KEY} or **** are left alone.
Placeholders
Each secret becomes QBX_SECRET_<KIND>_<ID>, for example QBX_SECRET_APIKEY_K7M2Q9XA. The kind (APIKEY, PASSWORD, PRIVATEKEY, SEEDPHRASE, TOKEN, JWT…) tells the model what was there, so it can still reason about it. A known key format gets the same placeholder on every turn, so prompt caching keeps working. Placeholders are unique to your account and can't be turned back into the value.
Every placeholder in the answer is replaced with your real value: in text, code, tool calls and structured output. The one exception is the model's thinking text, which keeps the placeholders.
Where it works
/v1/chat/completions, /v1/responses, /v1/messages (Anthropic), streaming and non-streaming, and web chat.Shielded requests are always served through our main providers, never through the Qubax Exchange, so a seller never gets the raw prompt.
Errors
Secret Shield fails closed: if it can't hide your secrets, the request isn't sent and you aren't charged.
on or off.Know the limits
- A secret with no known format and no label around it can be missed.
- A password repeated later without its label (a bare value) is sent as it is.
- Images, PDFs, audio and files aren't scanned. Presigned file URLs (S3, Azure) are left intact so the provider can fetch them.
- Placeholders can change token counts slightly, so a shielded request may cost a few tokens more or less.
Related: API keys · Choose providers · Routing modes
Ready to build?
380+ models through one OpenAI & Anthropic-compatible API, up to 99% below OpenRouter.