Skip to content

A leaked API key opened xAI’s private models for about two months

An xAI staff member committed a private API key to a public GitHub repository. It gave access to at least 60 private and fine-tuned models, including unreleased Grok versions.2

Get 30 minutes free every day, forever.3SOC 2 Type II499.9% uptime SLA on Pro4
xAI API keyMay 2025Refused

48 of 50

Stopped Limited: the payment went out through the bank’s own system This case: xAI API key. The gate refuses it.

What happened

The key still worked about two months after the first alert.

  1. The commit. An xAI technical staff member committed a private API key to a public GitHub repository.

  2. 2 March 2025. GitGuardian alerted the employee. The key kept working.

  3. 30 April. GitGuardian alerted xAI’s security team. The repository came down hours later.2

How the gate handles it

With the sealed gate, the leaked key would have been refused off its machine.

Only a SealedBox key could have leaked, and it works only through the gate, where one stop ends it. Press Play to watch a leaked key used elsewhere.5

Requests with a leaked key from an unknown machineSample6
  1. requestPOST /s/model/v1/chat/completions {"model":"private-ft-7"}from: laptop_unknownRefused403standin_bound_elsewhere
  2. requestPOST /s/model/v1/chat/completions {}after: stopStopped423

RefusedA SealedBox key used off its machine is refused, and one stop ends it.

How easy

xAI could have tied every model key to its own machine in three steps.

Sample
Seal a keyxai
xAI API key
Paste your xAI API key
Your code never holds the real key.
Key rulesxai
Calls from its own machine
Calls from anywhere else
Every use of this key is recorded.
Where approvals goAsk first
Slack
Microsoft Teams
Telegram
Email
A person approves or denies each call that asks first.

Approvals and signed records come with Pro, Gate only and Custom. On Free, a rule that asks first refuses instead.7

In code

Or in three lines of code.

The same three steps, from the terminal.

Sample
What each line does
1Seal the keysealedbox keys sealCode gets sbk_live_6Ua2…p7.
2Set the rulessealedbox rules addOff its own machine, the key is refused.
3Connect approvalssealedbox approvals connectAsk-first calls go to #security.
Try it

Put the gate in front of your agent today.

Run three practice calls in five minutes, then check their records on your own computer. Test mode, on every plan.

Start free$ sealedbox try5-minute practice run9
Scope

What the gate doesn’t change, and three failures like this one.

Related cases
Answers11

Questions about this case and the gate.

Still have a question?Book a callAll questions
What could someone do with the key from the repo?

Nothing from their own machine. A SealedBox key used off its own SealedBox machine is refused.

How quickly does a stop take effect?

On the next call. A stop from the console, API or SDK ends every key of that agent on every gate instance.

Would we know if the key was used outside the gate?

A month-end check against the service’s own log shows any use without a receipt.

What can the key reach on its own machine?

Only the services and calls its rules allow. Each is checked at the gate before the real key opens.

Can we limit a key to certain models?

Yes. Rules read the JSON body of each call, so a rule can allow named models and refuse the rest.

Could the real xAI key be worked out from the leaked one?

No. A SealedBox key holds no secret; the real key is sealed and opens only inside the gate’s chip.