AI Security · Threat Intelligence
Attackers use AI tools to steal secrets from public GitHub code
Microsoft says attackers are using AI-powered tools to quickly find and exploit secrets like credentials and API keys exposed in public GitHub repositories, leading to cloud account compromise and data theft.
Ross Grant3 min read

The short version
Attackers are using AI tools to quickly search public code on GitHub for secrets like passwords and API keys that developers sometimes leave behind. Once they find these secrets, they can use them to break into cloud accounts and steal data. Microsoft says this process is now much faster and more automated than before. If you write code, it's important to check your repositories for any secrets and remove them immediately.
By the numbers
- 5 minutestime from secret exposure to Azure Key Vault data theft in one caseMicrosoft
- October 28, 2026first observed successful sign-ins with compromised credentialsMicrosoft
What happened?
Microsoft says attackers are using AI-powered frameworks to search public GitHub repositories for exposed secrets like credentials and API keys. Once found, these secrets are used to access cloud resources, steal data, and compromise organisations. The attacks can move quickly, with one case seeing data stolen from Azure Key Vault just five minutes after secrets were found. Only Microsoft has reported this activity so far.
How the attack worked
Microsoft has reported that attackers are now using AI-powered frameworks, such as ARTEX, to automate the search for exposed secrets in public GitHub repositories. These secrets include credentials, API keys, and other authentication details that are sometimes accidentally left in code by developers. In the past, attackers had to manually search for these secrets, which took time. Now, AI agents can scan large numbers of repositories quickly, analyse the results, and even carry out follow-on attacks without much human involvement. In one case, Microsoft observed an AI agent move from scanning GitHub to stealing data from Azure Key Vault in just five minutes.
The attackers used the stolen secrets to access cloud resources, including Microsoft Entra ID tenants, Azure Key Vaults, Storage Accounts, and AI services. They also targeted SharePoint and OneDrive, downloading files and accessing mailboxes. The attacks were traced to specific IP addresses, including one that is a Tor exit node, which can hide the attacker's true location. According to Microsoft, the attackers used valid application credentials to sign in as service principals (the identities applications use to access resources) across multiple organisations. This allowed them to discover more resources, exfiltrate data, and abuse cloud services.
What was taken
The secrets found and abused included OAuth application credentials, storage account keys, App Service settings, connection strings, publishing credentials, and AI and machine learning datastore credentials. With these, attackers could access sensitive files, mailboxes, and cloud resources, and even download data from services like SharePoint and OneDrive. Microsoft says that once secrets are exposed in public repositories, organisations should assume the associated applications are compromised.
The response
Microsoft recommends that organisations regularly scan their code repositories for exposed secrets and remove any they find. They should also immediately rotate (change) any exposed keys or credentials. GitHub offers automatic secret scanning for public repositories, and organisations can enable additional monitoring to detect leaks in other repositories. For Azure DevOps users, GitHub Advanced Security can scan for sensitive content and block certain secrets before they are pushed to the repository. Microsoft also advises moving away from storing secrets in code and using managed identities for authentication instead. Simply deleting the exposed secret from the repository is not enough; the secret must be revoked or rotated to prevent further abuse.
What you should do
If you manage code repositories, especially public ones, scan them for secrets and remove any you find. Rotate any exposed credentials immediately. Use tools like GitHub's secret scanning and push protection to prevent secrets from being committed in the first place. Where possible, use managed identities instead of storing long-lived secrets in code. Review permissions and apply the principle of least privilege, so that if a secret is exposed, the damage is limited.
Read the full Microsoft report (opens in a new tab) for more technical details and recommendations.
Why it matters
This shows how AI is making attacks on exposed secrets much faster and more effective. Developers and organisations need to take extra care to keep credentials out of public code and use automated tools to catch leaks before attackers do.
Key points
- Attackers are using AI to automate the search for secrets in public code.
- Exposed secrets can lead to rapid cloud account compromise and data theft.
- Microsoft observed data theft from Azure Key Vault within five minutes of exposure.
- Developers should scan code for secrets and rotate any that are exposed.
- Using managed identities and least privilege can reduce the impact of leaks.
Sources
Microsoft
Primary source


