GUIDE · CONCEPT 11 min ·

A rotation schedule cannot beat a five-minute attackerMeasure revocation time, not key age

On November 5, 2026, Microsoft reported an AI agent that went from searching GitHub for client secrets to pulling data out of Azure Key Vault in five minutes. A 90-day rotation schedule leaves a leaked secret about 45 days of life on average. The numbers that matter now are how fast you revoke and how many secrets worth stealing you still issue.

TL;DR· the answer, in twenty seconds

What happened: Microsoft Threat Intelligence reported on November 5, 2026 that an agentic offensive framework, ARTEX, has searched GitHub for secrets since August. In one case an agent went from finding an OAuth client secret to exfiltrating Azure Key Vault data in five minutes.

The minimum fix: Time one revocation drill end to end on your highest-value static secret this week. If it takes longer than an attacker needs to use the key, that secret should not exist in a form an agent can read or commit.

The lesson: Rotation age tells an auditor how old your keys are. It says nothing about how long a leaked key stays useful. Track time to revoke and the number of static secrets you still issue.

On November 5, 2026, Microsoft Threat Intelligence published Threat actors use agentic AI tooling to find and abuse exposed secrets, and the headline number was five minutes: an AI agent went from searching GitHub for client secrets to exfiltrating data from Azure Key Vault in that time.

The standard answer to "what happens if a key leaks" is still a rotation policy. Keys rotate every 90 days, the policy says so, and the auditor checks the dates. That answer was weak before. Against an attacker who reads public commits as they land and acts in minutes, it is no answer. A key rotated on a 90-day schedule and leaked at a random moment has about 45 days of life left. The agent needed five minutes.

What Microsoft watched an agent do in five minutes

Microsoft's post describes an agentic AI offensive framework that threat actors adopted as offensive infrastructure. Coverage from GitGuardian and the Cloud Security Alliance identifies it as ARTEX. GitGuardian's write-up by Dwayne McDaniel describes it as a penetration testing framework published on GitHub in late July 2026 and pulled on October 8, right after the first report of use by threat actors. Pulling the repository did not stop the attacks. Censys counted about 1,400 exposed ARTEX instances on November 4, per GitGuardian.

The chain Microsoft reports has three stages.

  1. Starting in August 2026, the framework sent large volumes of GitHub search queries. They combined a target organization's name with secret keywords, cloud service keywords, or the name of an AI provider.
  2. It took a leaked client secret for a single-tenant OAuth application and requested a token as that application. No user signed in. No MFA prompt fired. The sign-ins show up as service principal sign-ins, starting October 28.
  3. Acting as the application, it enumerated cloud resources and pulled secrets out of Key Vault.

From there the agents moved the way a patient human operator would. Microsoft lists Azure VM Run Command, searches of Azure DevOps for more secrets, SharePoint and OneDrive downloads, and mailbox access through Microsoft 365. They went after operations that return credentials: storage account keys, App Service settings, connection strings, publishing credentials, AKS user credentials and AI service connections. Every one of those feeds the next hop.

The detail that should bother you most is the error handling. One batch of Key Vault requests failed with HTTP 400 because the agent sent a data-plane API version to Azure Resource Manager. About 28 seconds later it reran the batch with ARM API version 2023-07-01 and got HTTP 200. Microsoft records the same pattern at about 60 seconds for an Azure SQL firewall query and about 80 seconds for an Application Insights query. A human attacker who hits a 400 at 3 a.m. reads docs, gets coffee, maybe gives up. This one did not.

Microsoft and the Cloud Security Alliance research note from November 9 both stress that five minutes is a single observed case, the fastest path seen, not a typical timeline. Fine. It is still a speed your controls have to beat, and no rotation schedule does.

Rotation age measures the wrong thing

A rotation policy answers one question: what is the oldest a key can be? The question a leak raises is different: how long does a leaked key stay useful to whoever found it?

For a static secret, that useful life is the shorter of two numbers. One is the time left until the next scheduled rotation. The other is the time from the leak until someone notices and revokes the key. Rotation shortens the first number. It does nothing for the second.

Run the arithmetic for a 90-day schedule. A leak lands at a random point in the cycle, so on average the key has 45 days left, which is 64,800 minutes. Against a five-minute attacker that is about 13,000 times more time than they need. Move to a 30-day schedule and you have 15 days left on average, still thousands of times too long. You could rotate every hour and an attacker working at Microsoft's observed speed would still have time to finish.

This is not new. Orca Security planted cloud keys in public places for its 2023 honeypot report and saw a key exposed on GitHub used within two minutes. What changed in 2026 is the second half of the chain. Finding the key was always fast, because scrapers watch the GitHub event stream. Turning the key into data took a person who knew the target's cloud. ARTEX shows an agent doing that part too, retrying its own mistakes, at the cost of some inference.

The CSA note puts the conclusion in one line: "a 30-, 60-, or 90-day rotation schedule cannot contain a freshly leaked credential." It still recommends rotation, and so do I, because rotation retires stale secrets nobody remembers creating. GitGuardian's State of Secrets Sprawl 2026 found that more than 64% of secrets confirmed valid in 2022 were still valid when retested in January 2026. Rotation fixes that problem. It does not fix the leak you had this morning.

A commenter on the r/netsec thread about Microsoft's post made the opposite argument. Their point was that the story ends at "public GitHub secret": once the secret is public and nobody noticed it going up, the attacker's speed is beside the point. They are half right. Prevention matters more than speed. But "you should have caught it before the push" is not a control you can measure, and your mitigation story for the leaks you miss still has to hold up. Every team misses some.

Deleting the commit and quarantining the key do not end access

The first thing most people do when they spot a leaked secret is delete it from the repository. That fixes nothing. Microsoft's post says it outright: removing the original disclosure does not invalidate the credential or the copies in Git history, caches and logs. Assume someone read a secret pushed to a public repository before you saw the alert.

The second instinct is to trust the provider's automation. Palo Alto Networks' Unit 42 tested it in From Exposure to Lockdown, published September 21, 2026. Margaret Kelley created an IAM user, pushed its access key to a public repository, and logged what happened. GitHub push protection flagged the key first; the researchers pushed anyway, as a real developer under deadline might. The push landed at 18:50:05 UTC. AWS attached the AWSCompromisedKeyQuarantineV3 managed policy at 18:50:15, ten seconds later. GitHub's email arrived a second after that.

Ten seconds is fast. But the quarantine policy is a list of explicit denies on high-risk actions such as creating users, attaching policies, launching instances and some S3 and Bedrock calls. Unit 42 notes that AWS "purposefully denies specific actions rather than completely disabling the compromised access key." Anything outside the deny list still works with the leaked key. An agent that probes, gets a 403, and tries the next API is the exact attacker that gap favors.

Azure has a different version of the same gap. Microsoft's containment steps for an affected application say to remove all client secrets, certificates and federated credentials, and to disable the service principal if needed, because "tokens already issued remain valid until expiry." If the agent minted an access token before you deleted the secret, that token keeps working until it expires, an hour or more later for an Entra access token. Revocation has to cover the tokens the secret already produced, not only the secret.

So "revoked" means three things, and each has its own latency:

  • The secret itself stops authenticating.
  • Tokens minted from it stop working, by disabling the principal or waiting out their lifetime.
  • Everything the principal could read needs rotation too, because the attacker may already hold copies. Microsoft's guidance is to rotate every secret in any Key Vault the affected application could read.

The third step is where response times go from minutes to weeks. A service principal with read access to three vaults can turn one leaked secret into a rotation project across dozens of systems.

Where coding agents put secrets in this path

ARTEX searched GitHub. It did not care how the secret got there. Coding agents raise the odds that one does.

The Sprawl 2026 report counted 28.65 million new hardcoded secrets in public GitHub commits in 2025, up 34%, and found a 3.2% secret leak rate in commits made with Claude Code assistance against a 1.5% baseline for all public commits. GitGuardian cautions that this is not a simple tool failure, and I agree; the agent does what the developer's environment lets it do. I covered the mechanics in AI agents commit secrets 2x more often. The short version: an agent that can read a key will paste it into a test fixture, a config file or a debug script when that is the fastest way to make the task pass.

Microsoft's report also names the targets. Queries paired company names with keywords for AI providers, and the agents went after API keys for major AI services and AI inference credentials. GitGuardian's report counted 1,275,105 leaked AI service secrets in 2025, up 81%. Those are the keys coding agents handle all day.

Look at where an agent puts a secret it has read:

  • Source and test files it writes, which go out in the next commit.
  • Config files it creates for tools and MCP servers. GitGuardian found 24,008 unique secrets in MCP-related config files.
  • Its own transcripts and settings files, which end up in dotfile repos, bug reports and container images.
  • Pull request descriptions and commit messages, when it explains what it did.

Each of those is a public surface away from a GitHub search. Push protection and pre-commit scanning catch a share of them, and you should run both. GitHub's push protection blocks known secret formats at push time. But the Unit 42 test shows the bypass that real developers use: the warning fired and the push went through anyway. A scanner reduces how often a secret leaks. It does not change how fast a leaked one gets used.

The only change that alters the math is the agent never holding a usable static secret in the first place. A key that lives outside the agent's process, gets added to one command or one request at the moment it runs, and never lands in a file the agent can read, has no path into a commit.

Track revocation time and static secret count

If rotation age is the wrong metric, three numbers replace it. The CSA note proposes the same three, and they are the ones I would put on a dashboard.

  1. Median time from detection to revocation. Time it from the moment a scanner, GitHub alert or provider notice fires until the secret and its issued tokens stop working. If you have never measured it, assume it is days.
  2. Share of workloads that hold no static secret. Managed identities, workload identity federation, and tokens minted per run all count. A static API key in an environment variable does not.
  3. Blast radius of each remaining static secret. What can it read, and what will you have to rotate if it leaks? A key with read access to a vault carries the risk of every secret inside that vault.

Start with an inventory. On Azure, this lists every app registration that still authenticates with a client secret, and when each secret expires:

# App registrations that still use password credentials (client secrets)
az ad app list --all \
  --query "[?passwordCredentials].{name:displayName, appId:appId, expires:passwordCredentials[].endDateTime}" \
  -o table

# Revocation drill for one app: time each step
time az ad app credential delete --id <appId> --key-id <keyId>
time az ad sp update --id <appId> --set accountEnabled=false

Microsoft's own advice is to move OAuth apps off secret-based authentication to managed identities. Every row this query returns is a credential that would let an agent do what ARTEX did.

For a repository, check the full history, not only the working tree. A secret your agent wrote and then removed is still in history:

# Scan every commit on every branch, not just HEAD
gitleaks git --log-opts="--all" .

Then run one drill. Pick your highest-value static secret, create a test copy with the same scope, and time how long it takes your team to detect a fake leak and get all three revocation steps done. Write the number down. If it is longer than the five minutes Microsoft observed, and it will be, you have two options. Make revocation faster with automation that fires on the detection event, or stop issuing that secret in a form anything can leak.

Microsoft also lists detection signals worth wiring up today: Entra errors AADSTS7000215 and AADSTS7000222, which mean someone is presenting a bad or expired credential for your app; one address signing in to three or more service principals; and one application requesting tokens for ARM, Key Vault, Storage and Graph in a short window. Microsoft's note on the first signal: "a failure followed by a success is urgent."

What this means for your stack

Do the inventory and the drill this week. List every static secret your coding agents can read, from .env files, shell profiles, MCP configs or cloud CLI caches. For the most valuable one, time detection and revocation end to end. That one number tells you more about your exposure than any rotation report.

The pattern that fixes the category is to stop handing agents secrets worth stealing. Use federated or managed identity where the platform supports it. Where you need a static key, keep it outside the agent's process and add it at the moment a command runs, so it never reaches a file, a transcript or a commit. Keep rotation for hygiene and judge your response by revocation time.

hasp is one working implementation of the second half. hasp run hands a stored secret to one approved command as an environment variable for that process alone and keeps it out of the agent's shell, config files and context. Source-available (FCL-1.0), local-first, macOS and Linux, no account.

Whatever you use, assume the next leaked key gets used before your alert reaches a human. Design so that when it does, the key was never in the repository to find.

Sources· cited above, in one place

NEXT STEP~90 seconds

Stop handing the agent your real keys.

hasp keeps secrets in one local encrypted vault, brokers them into the child process at exec, and never lets the agent read the value.

  • Local, encrypted vault — no account, no cloud, no telemetry by default.
  • Brokered run — agent gets a reference, the child process gets the value.
  • Pre-commit + pre-push hooks catch managed values before they ship.
  • Append-only HMAC audit log answers "did the agent touch the prod token?" in seconds.
→ okvault unlocked · binding ./api
→ okgrant once · pid 88421
→ okagent never read

macOS & Linux. Source-available (FCL-1.0, converts to Apache 2.0). No account.

Browse all clusters· eight threads, one index