Secrets

Leaked keys and tokens in AI projects

A leaked key can matter more than the data sitting beside it. Revoke first, then find out what the key could reach.

Last reviewed against legislation.gov.uk, National Cyber Security Centre and OWASP GenAI Security Project. Sources

Industrial site map with viruses hovering over buildings marked in red

Two cases

Keys in the open

Wiz reported that the unprotected DeepSeek database held secret keys, API secrets and backend details alongside conversations [7]. Separately, Wiz found that a storage link published with Microsoft's AI research code gave full control of an entire storage account, far beyond the model files it was meant to share [8].

Response

What to do, in order

  1. 1

    Revoke or rotate the key or token. For a shared storage link, invalidate it. Microsoft did so two days after Wiz reported the problem [8].
  2. 2

    Work out what it could reach. A link scoped to a whole account exposes the whole account [8].
  3. 3

    Check the logs for any use of the key. Wiz noted that links of this kind are hard to track and cannot be revoked one by one [8].
  4. 4

    Search your own repositories and shared documents for the same secret.
  5. 5

    Treat everything the key could reach as potentially exposed, and take that into the reporting decision.

What went wrong

Patterns to look for

Green shield with a tick above a phone showing a fingerprint

Over-broad scope

The Microsoft link allowed full control rather than read-only access [8]. Ask of every key: what is the least it needs?

Brick firewall with a flame in front of it

No expiry

The same link's expiry date was pushed out to 2051 [8]. Set expiry dates and review them.

Cloud above a green shield with a padlock beside a server stack

Hidden in logs

Secrets sat in DeepSeek's log table [7]. Stop secrets reaching logs and prompts in the first place, and scrub what is already stored.

Prevention

Controls that help

Wiz's lessons from the Microsoft case included treating account-level tokens as seriously as the account key, using dedicated storage accounts for external sharing, and watching how tokens are used [8].

Related: exposed AI storage.

Check this instead of assuming

List every key and shared link that touches AI data, who created it and when it expires. Anything without an answer should be revoked and replaced.

How CyPro can help

Need a hand working through this?

Finding out whether an incident reaches you is one job. Checking your own systems, tightening access and briefing the board are several more. CyPro's responders and consultants can take any of them on.

Incident responders containing an attack

Incident response

If you may already be compromised, our responders contain it, preserve the evidence, find out what was touched and get you running again safely.

More on cypro.co.uk
Security analysts monitoring systems around the clock

24/7 security monitoring

Our SOC analysts watch your systems day and night for the signs of an attack in progress: unexpected processes, new outbound connections, logins that do not fit.

More on cypro.co.uk
Security lead advising a board

Fractional CISO for the board

A senior security lead who advises the board on what to fix first, what to accept and what to tell customers, and owns the decision record.

More on cypro.co.uk
Penetration tester probing an application for weaknesses

Penetration testing

A focused test of your systems and the controls around them, so you know they hold before an attacker finds out for you.

More on cypro.co.uk
Cyber security consultants planning hardening work

Hardening and segmentation

Our consultants put the controls in place that limit the damage when something is missed: firewall rules, network isolation and tighter admin access.

More on cypro.co.uk
Scanner checking internet-facing systems for weaknesses

Vulnerability scanning

Find every internet-facing system you run, including the forgotten ones, and see which are still on a vulnerable build.

See the scanning service
Rocket launching from a cloud

Talk to a specialist

Worried this affects you?

When data has leaked through an AI tool, its logs or its storage, the early decisions shape what you must report and to whom. An incident response team helps you contain the exposure, establish what was involved and prepare your notifications.