AI agents now hunt leaked GitHub secrets faster than teams can revoke them

In a case Microsoft disclosed in early November 2026, an AI agent using an open-source AI pentesting framework searched public GitHub, found a leaked application client secret, and signed in to Microsoft Entra ID as a service principal. Five minutes after the search started, the agent began pulling data from Azure Key Vault.

That intrusion was published by the Microsoft Threat Intelligence team, as part of a campaign built on ARTEX, an open-source AI penetration testing framework that hands its tools to large language model (LLM) driven agents. While the time to exfiltration first made headlines, the real story was how quickly the agent adapted.

In the original research post, they noted that a batch of Key Vault requests failed because they used the wrong API version. About 28 seconds later, the agent succeeded by using the same secrets against the correct version. The agent logged the errors, adjusted its requests, and moved ahead with its goal. No human assistance or adjustment was needed.

automated credential rotation

Timeline of an ARTEX AI agent going from a GitHub search to pulling Azure Key Vault data in five minutes.

A few days later, the FBI published a FLASH alert on ARTEX reporting that some intrusions moved from initial targeting to privileged access in under three hours. Researchers have since tied an ARTEX-derived framework called AntiFox to similar activity in AWS environments.

It is clear that the age of autonomous AI agent attacks has arrived. Yet we are not facing completely new problems. Leaked credentials have been a problem for as long as there has been public code.

The time between a leak and its first abuse is what changed.

Years of accumulated tech debt and poor secrets hygiene are allowing these attacks to succeed at an unprecedented rate. Part of surviving what comes next will require securing your whole credential layer.

Discovery of secrets no longer needs a dedicated scanner

ARTEX works from an objective, described in simple, plain language. No deep pentesting or red teaming knowledge is needed. This is part of what makes it so useful, but also what makes it dangerous when adversaries leverage it. The agent plans the steps, runs the tools, and decides what to do with each result.

Security tools being turned into attackers’ weapons has precedent. Metasploit and Burp Suite have sat on both sides of the security line for years. ARTEX adds judgment to that kind of tooling, and judgment used to be the part an attacker had to supply personally.

Artex is just one of many variations of automated attack frameworks. GitGuardian recently cataloged roughly 45 agentic attack frameworks, counting forks and variants. Only four ship a secrets scanner wired to the agent. The rest rely on general-purpose abilities like running shell commands and fetching web content.

Those turn out to be enough.

In a controlled test, GitGuardian researchers pointed an ARTEX build with no secrets scanner at a simulated GitHub repository seeded with nine credentials. The planted secrets sat in configuration files, in commit history, and on side branches. Some prompts told the agent to look for exposed secrets. Others only asked it to assess the repository’s security posture.

In every run where the agent investigated, it found eight of the nine. It started searching within 6 to 13 seconds, including in runs where the prompt never mentioned credentials. The agent decided on its own that secrets were the most useful thing in the repo.

The model declined to use what it found, so the test stops at discovery. Microsoft’s incident shows what comes after.

Git history remembers every secret a developer tried to delete

The agent in that test used git and grep, the same commands developers run every day. It walked the commit log, checked out branches, and searched old file revisions. One AWS key had been removed in the very next commit after it was added. The agent recovered it anyway.

That is how Git is supposed to work. Every commit is a snapshot, so deleting a line in commit 41 leaves it fully intact in commit 40. A developer who spots a mistake and pushes a fix has cleaned up the current view of the repository. The credential is still one git log -p away, and it still authenticates until someone revokes it.

Human attackers have known this for years. An agent simply never forgets to check.

The supply of usable credentials keeps growing

GitGuardian’s 2026 State of Secrets Sprawl report counted 28.65 million new hardcoded secrets in public GitHub commits during 2025, a 34% increase over 2024. Spread across the year, that is roughly 78,500 new secrets every day.

While that volume is troubling, it becomes even more disturbing when you consider that more than 64% of the secrets confirmed valid in 2022 still worked when GitGuardian retested them in January 2026. Unless it comes with an explicit expiration built in, secrets last forever. A key leaked four years ago can still open a production database today, and an agent searching public code at machine speed reaches old commits as easily as new ones.

The problem of public exposure extends past the repositories a company owns and actively monitors. Developers often keep personal and open-source projects open on the same machines as work-related code. It is all too easy to push something from your production system into code in a personal account. So far, we have sent nearly 12 million emails to around 6 million developers who have done just that via the GitGuardian Good Samaritan Program.

A key in a developer’s side project grants exactly the same access as one leaked from your main product repo.

A valid credential means reach into your systems

Microsoft documented a sequence defenders should expect to see again and again. It is one we have been seeing for years, just at human speeds. The agent obtained a usable identity and enumerated what that identity could touch. Then it used that access to find more access and resources.

No matter what example story or bit of research you investigate, the attacks ultimately succeed through logging in, not breaking in. We repeatedly see agents simply abusing secrets, no matter how they gained the initial foothold.

One thing that makes this particularly challenging to defend against is that a valid credential produces a valid sign-in, and that traffic looks like an application doing its job. Controls tuned for failed logins and brute-force attempts stay quiet. Broad standing permissions do the rest.

These attacks run through the credential layer. That layer is the set of credentials that let code, machines, developers, and AI agents access systems, wherever those credentials live or move. Repos, pipelines, and vaults are all part of it. So are developer laptops, collaboration tools, and public code. Each security tool covers the part of that layer it was built to see, and the agents work across the boundaries between them.

Step 1: Find exposed credentials before an agent does

An agent finds a leaked secret within seconds of starting to look. Defenders need to find these secrets first, ideally when they were first copied into plaintext outside any vault.

  • Public GitHub: For most teams, that starts with monitoring public GitHub activity tied to the organization. It is vital to include developers’ personal accounts and repositories outside corporate ownership, contextually tying any of your secrets back to your security response.
  • Internal repositories: That same level of scrutiny needs to be applied to internal repositories, across their full histories.
  • Pipelines and collaboration tools: Scanning for secrets can start with code, but that is only one part of the credential layer. Automated scanning needs to account for CI/CD pipelines, ticketing and messaging platforms. Anywhere a secret could be copied in plaintext is a surface an agent is going to immediately scan once it has the chance.
  • Developer machines: Many current secret security programs neglect to account for developer machines, where credentials get created and copied long before they reach a repo. Automated infostealer-based supply chain attacks count on these secrets being stored locally in plaintext, and your security program should, too.

For every finding, teams need to know whose credential it is, whether it still works, and what it can reach.

Step 2: Make a found credential worthless fast

Removing a secret from code feels like the right immediate step, but this assumes the repo wasn’t already copied. Until someone revokes or rotates it, you must assume the key is compromised and that any access it grants will be abused.

Prioritizing what to work on first when confronting secrets sprawl should start with valid credentials. Anything that is tied to production infrastructure, sensitive data, or privileged identities should get a higher risk score.

  • Before rotating: Teams need to know which applications depend on the credential so the fix doesn’t cause an outage.
  • After rotating: They need to check sign-in and access logs for anything the identity created while it was exposed. New keys, new accounts, and new role assignments are the usual footholds.

Agents are moving at machine speed, and we must automate our rotation and revocation processes to keep pace. A remediation process that runs through a human-speed ticket queue and gets applied in a weekly change window loses the race every time.

Step 3: Stop adding to the supply

Preventative tools go a long way to stopping new exposures while you work to clean up existing leaks.

  • AI coding assistants: Guardrails on AI coding assistants keep secrets out of prompts, tool calls, and generated code. These work across all machines, including those being used by your ‘citizen developers’ who might never commit code.
  • Version control: For any code that is going to be version controlled, pre-commit scanning and push protection catch credentials before they enter a repository’s history. Catching these before they are committed is the last point where cleanup is wholly local and before your pipelines rely on the key.

Long-lived credentials deserve the hardest look when determining your course of action. A token that expires after one hour is worth very little to an agent that finds it next week. Compared with a key that lives for a year, that one-hour token shrinks the maximum exposure window significantly. Narrow scoping does the same work on blast radius, limiting what an attacker can reach in the short time the credential is useful.

Start with what is already public

More frameworks will follow ARTEX and AntiFox, and each generation will get better at finding credentials and using the access they grant. The most useful first step to prevent AI agent attacks is an honest inventory of what an attacker can already find.

GitGuardian offers a free GitHub Security Audit that maps the developers associated with a company’s domain, including leaks in personal repositories outside the GitHub organization, and flags which exposed credentials are still valid.

Every secret in that report is one an agent can find in seconds. The goal is to make sure that by the time it does, the credential no longer works.

Don't miss