Microsoft reported on 5 November 2026 an agent going from a GitHub secret search to Key Vault data in five minutes. What ends access, in what order, and which signals to hunt.
Five minutes from a code search to a key vault
On 5 November 2026 Microsoft Threat Intelligence published a report on attackers using ARTEX, an agentic AI penetration-testing framework, to search public GitHub repositories for exposed secrets and then use them. Since August, Microsoft wrote, the framework had been sending large volumes of code-search queries that combined a target organisation's name with keywords for secrets, cloud services and AI providers. Searching code for credentials is old. What changed is that the agent also reads the results and acts on them, and in at least one case Microsoft "observed an AI agent advance from scanning GitHub for secrets to exfiltrating data from Azure Key Vault in just five minutes."
A second report on 6 November described another group, which Microsoft tracks as Storm-3358, using the same framework against financial organisations. This guide uses the reports to answer a practical question: when an application secret has leaked, what actually ends the attacker's access, in what order, and which signals show that someone is using it? The facts quoted here come from snapshots of the two reports taken on 7 and 8 November 2026. The companion code applies Microsoft's hunting rules to a synthetic sign-in log.
Deleting the commit ends nothing
The most common first reaction to a leaked secret is to delete it from the repository, or rewrite history to remove it. Microsoft's report is blunt: "Publicly exposed credentials remain usable until revoked or rotated; removing the original disclosure alone does not remediate the exposure." The secret has already been copied by whoever searched for it, and it is still valid wherever it is accepted.
The same is true one level down. Removing a client secret stops anyone from getting new tokens with it, but the report notes that "tokens already issued remain valid until expiry." Microsoft's identity platform documentation gives the default access token lifetime as a random value between 60 and 90 minutes. So if an attacker obtained a token at 10:04 and you removed the secret at 10:10, assume the token keeps working until about 11:34. The companion code's exposure_end function makes that arithmetic explicit.
What the agent went after
The report lists the operations the attacker targeted once signed in as an application: storage account keys, App Service settings, connection strings and publishing credentials, machine learning connections and datastores, and Kubernetes user credentials. These are operations that return more credentials. One leaked application secret becomes a set of downstream keys, each of which must be treated as exposed.
Two details are specific to agent-driven attacks. Microsoft saw "adaptive troubleshooting" in the logs: a batch of requests to enumerate Key Vault secret metadata failed with HTTP 400 because it used a data-plane API version against the control plane, and about 28 seconds later the same paths were retried with a supported version and succeeded. A human operator might give up on an error; an agent reads it and adjusts. And the agents "repeatedly demonstrated a focus on credentials that provide access to AI services", which Microsoft links to public reports of attackers stealing AI service credentials, sometimes to run the same agentic workflow. A leaked model API key can pay for the next attack.
The response, in order
Microsoft's containment guidance, rearranged by what each step ends:
| Step | What it ends | What it does not end |
|---|---|---|
| Block the source address for workload identities with Conditional Access (requires Workload ID licensing; single-tenant apps only) | new sign-ins from that address | sign-ins from any other address |
| Remove every client secret, certificate and federated credential on the application, including any the attacker added; disable the service principal if needed | new tokens for the application | tokens already issued |
| Revoke user sessions, Azure DevOps personal access tokens and SSH keys of affected users | access through those user credentials | application tokens |
| Rotate everything stored in any Key Vault the application could read, and any credentials found in documents it accessed | use of downstream secrets the attacker copied | nothing upstream |
| Search sign-in, Activity, Key Vault, Storage, Entra audit, DevOps and Microsoft 365 audit logs as far back as retention allows | uncertainty about what was taken | nothing by itself |
The order matters. Rotating downstream secrets before removing the application credential lets the attacker read the new values. Removing the credential without rotating downstream secrets leaves everything it already copied usable.
Note the phrase "including those added by the threat actor". An attacker with enough permission on an application can add a credential of its own, so removing the one that leaked is not sufficient. List all credentials on the application, compare them with what you expect, and remove anything you cannot account for.
Signals that someone holds your credential
The report's hunting guidance includes three patterns that apply to any tenant:
- A secret failure followed by a success. Sign-in error AADSTS7000215 means an invalid client secret was presented; AADSTS7000222 means an expired one. Either "indicate someone holds a credential for your app; a failure followed by a success is urgent."
- One address, many applications. One address authenticating to three or more service principals with mixed success.
- One application, many resources. One application requesting tokens across Azure Resource Manager, Key Vault, Storage and Microsoft Graph in a short window.
The companion code implements these as functions over sign-in records and runs them on a synthetic morning at Belgavi's Book Store. Normal traffic comes from two jobs on known addresses. A forgotten script presents the old secret of returns-bot once. An outside address then tries leaked secrets for two applications, gets in with one, and fans out across four resources within three minutes.
def failure_then_success(records):
out, last_fail = [], {}
for r in sorted(records, key=lambda r: r["t"]):
if r["result"] in ("AADSTS7000215", "AADSTS7000222"):
last_fail[r["app"]] = r
elif r["result"] == "success" and r["app"] in last_fail:
f = last_fail.pop(r["app"])
out.append({"app": r["app"], "failed_at": f["t"], "success_at": r["t"], "same_ip": f["ip"] == r["ip"]})
return outOn that log the rules produce four findings: report-export failed and then succeeded from the outside address; order-sync failed from the outside address and later succeeded from its normal job; the outside address touched three applications with mixed results; and report-export reached all four resource types within ten minutes. The returns-bot failure alone is not a finding, because nothing succeeded after it.
The order-sync finding shows why these are leads, not verdicts. The success came from the legitimate job, so the application was not used by the attacker. But a failure from an outside address still means someone holds a secret for it, perhaps an old one, and it belongs on the rotation list.
Defences aimed at the agent
The report also recommends something new: honeypots and decoys that give an autonomous attacker attractive but worthless targets, tarpits that "consume the agent's time and budget", and "fake wins" that "present convincing evidence that the agent's objective is complete, which can cause it to stop on a false success." Microsoft says these controls reduced attack traffic reaching real assets in its own testing. That is a vendor's statement about its own environment; treat it as a reason to experiment, alongside, not instead of, the steps above.
The long-term fix
The report recommends migrating applications away from secret-based authentication and using managed identities, which "eliminates the possibility of secret exposure in code". For workloads that run outside Azure, workload identity federation serves the same purpose: the workload exchanges a token from its own platform instead of holding a secret. Either way there is no long-lived secret to commit by accident. Where secrets remain, push protection can block supported secret formats before they are pushed, and secret scanning can watch public repositories beyond your own.
Failure modes
- Rotating in the wrong order. New downstream values read by a still-valid application token are leaked again.
- Trusting the leak date. The commit date is when you found it, not when it was copied. Search logs as far back as retention allows.
- Missing attacker-added credentials. Removing the leaked secret leaves the one the attacker created.
- Forgetting AI keys. Model provider keys in the same configuration are the ones the report says the agents sought out.
What remains uncertain
The five-minute figure is one observed case. Microsoft does not say how many organisations were affected, and the reports describe Microsoft's own telemetry. The hunting rules are heuristics; they will produce false positives in any tenant with unusual automation and should be tuned before they page anyone.