Engineering

Five Minutes From GitHub to Your Key Vault

Microsoft watched an AI agent go from a secret on GitHub to stolen Azure Key Vault data in five minutes. Policies measured in days can't keep up with that.

Eduardo Diaz · 2026-11-06 · 6 min read

security secrets management ai agents cloud

Yesterday Microsoft published a case where an AI agent found a secret in a public GitHub repository and was pulling data out of an Azure Key Vault five minutes later. If your company still rotates keys every 90 days, that's about 130,000 minutes to the attacker's five.

Here's what Microsoft reported, what it means if you don't have a security team, and five questions I'd put to your dev team this week.

What Microsoft actually reported

On November 5, Microsoft Threat Intelligence published Threat actors use agentic AI tooling to find and abuse exposed secrets. The short version:

To be precise, because this will get exaggerated: five minutes is one observed case, not an average. The leaked credential was an application secret, not someone's password. And according to Cybersecurity Dive's coverage, Microsoft's advice to anyone who finds secrets in a public repo is that they "should assume those secrets have been compromised."

Fast attackers aren't new. Cheap, constant ones are.

To be fair, this isn't new. In 2023, Orca Security planted an AWS key on GitHub as a honeypot and observed it being used within two minutes. Bots have been scraping GitHub for keys for years. And the leaks keep coming: GitHub says more than 39 million secrets were leaked across GitHub in 2024.

What changed is the step after the find. A scraper grabs a key. An agent grabs the key, tries it, works out which services it opens, retries when something fails, and keeps going until it reaches something valuable. Microsoft describes the agent adapting and retrying within a minute or so when a request failed. That used to need a skilled person at a keyboard. Now it runs all night, against everyone, for very little money.

A leaked key used to be a risk. Now it's a countdown, and the clock is measured in minutes.

Why your rotation policy doesn't help here

Most small companies I talk to have some version of "we rotate credentials every 90 days" or "we review access each quarter." Those are fine habits. They're just not protection against this.

If a machine can go from your leaked key to your data in five minutes, a policy measured in days is a calendar reminder. By the time the next rotation comes round, the damage is done and the logs are old.

Finding leaks faster still matters, but you won't win a race against software that never sleeps. Make a leaked secret worthless, or make sure there's nothing in the code to leak.

The goal isn't to catch a leaked key faster than the attacker. It's to make sure a leaked key opens nothing worth stealing.

What actually makes a leaked secret worthless

None of this is exotic. It's mostly configuration and discipline.

No long-lived keys in code. Not in the repo, not in a "temporary" test script. Microsoft's post puts it plainly: "using managed identities for application authentication eliminates the possibility of secret exposure in code." For CI pipelines, the equivalent is workload identity federation (OIDC), where GitHub Actions or your build system gets a short-lived token from your cloud provider instead of storing a permanent key.

Short-lived, narrowly scoped credentials where you can't avoid them. A token that expires in an hour and can only read one storage container is a much smaller problem than a key that never expires and can do anything.

Secret scanning and push protection on every repository. Including old ones, forks and the prototype from two years ago. Push protection stops a supported secret before it ever leaves a developer's laptop. Abandoned repos are where this goes wrong most often, which is why I wrote about abandoned code being an open door.

Least privilege, so one key can't open the vault. Microsoft recommends applying least privilege "to service principals and other workload identities." In plain terms: the app that sends emails shouldn't be able to read your database secrets.

Alerts on unusual vault and sign-in activity. If a service identity suddenly signs in from a new IP and starts listing secrets, someone should hear about it in minutes. Microsoft specifically calls out service principal sign-in logs and Key Vault diagnostics as places to look.

A written "key leaked" runbook. Who revokes it, who rotates it, what gets checked, who gets told. It should be a page anyone on the team can follow at 11pm, not a meeting someone has to schedule.

Your response to a leaked key should take minutes, not a meeting.

Don't forget your AI keys

One detail founders should notice: Microsoft says these agents "repeatedly demonstrated a focus on credentials that provide access to AI services." An exposed AI API key is two problems. First, someone runs up your bill on your account. Second, depending on how it's set up, it may give access to the prompts, files or data your product sends to that model.

Many teams treat AI keys casually because they were added quickly during a prototype. Treat them like database credentials. We've made a similar argument about giving AI read access before write access: scope first, convenience second.

Five questions to ask your dev team or vendor this week

You don't need a security department to get real answers. Ask these, and ask for a yes or no plus a short explanation:

  1. Are there any long-lived cloud or API keys in our code, config files or CI settings? If yes, what's the plan to replace them with managed identities or OIDC?
  2. Is secret scanning with push protection turned on for every repository we own, including old and archived ones?
  3. If one of our keys leaked right now, what could it reach? Ask them to name the actual systems.
  4. Would anyone be alerted if a service account started reading our secrets vault from a new location?
  5. Do we have a written runbook for a leaked key, and how long would it take to revoke and rotate? The right answer is minutes.

If the answers are vague, that tells you where to spend next.

How we handle this, and where to start

On the systems we build for clients, we keep secrets out of code, store them in the cloud provider's secret manager, give services role-based identities instead of shared keys, and set up secret scanning in CI. It's the default we think every build should start with.

If you're not sure where your company stands, start with the five questions above. If you'd like a second pair of eyes on the answers, or help moving off long-lived keys without breaking production, that's the kind of work we do on our services page. And if the urgent-patch side of this sounds familiar, our recent post on what to do in a patching emergency covers the other half of staying ahead of fast attackers.

Sources

Keep reading

← Back to Insights