Microsoft has warned that threat actors are now using agentic AI tools to hunt for exposed credentials and secrets in public code repositories, then use them to attack cloud environments.

This is more than a theoretical risk. Microsoft Threat Intelligence says it has observed AI-driven tooling searching public GitHub repositories for credentials, application secrets and API keys, then using those credentials against Microsoft Entra ID, Azure and Microsoft 365 resources.

In one observed case, an AI agent progressed from finding exposed client secrets in GitHub to exfiltrating data from Azure Key Vault in around five minutes.

What are AI tools looking for?

Attackers are searching for information that should never have been made public in the first place, including:

  • application client secrets;
  • API keys;
  • storage account keys;
  • connection strings;
  • publishing credentials;
  • OAuth application credentials; and
  • credentials linked to AI and cloud services.

These secrets can end up in public repositories when developers or administrators place them inside configuration files, scripts or source code and then upload that code to GitHub.

Why does agentic AI make this more dangerous?

Searching public repositories for leaked credentials is not a new attack technique. The difference is speed and scale.

Traditionally, an attacker had to search repositories, inspect code, identify useful credentials, test them and decide what to do next. Agentic AI tooling can automate much of that process.

Microsoft says the offensive framework it observed could scan multiple repositories, analyse what it found and continue with follow-on attacks with less hands-on-keyboard involvement from the attacker.

That means a credential accidentally exposed online can potentially be discovered and abused much faster than businesses may expect.

What happened after credentials were found?

Microsoft observed leaked or stolen application credentials being used to sign in to Microsoft Entra ID tenants and access connected Azure and Microsoft 365 resources.

In affected environments, the attackers searched for further credentials and mapped cloud resources. Microsoft also observed compromised applications accessing SharePoint and OneDrive, including file downloads and mailbox-item access.

The threat actor also queried Microsoft Graph and Azure resources to identify subscriptions, permissions, storage, AI model deployments and other potentially valuable services.

Why application credentials matter

This type of attack does not necessarily involve stealing an employee’s normal Microsoft 365 password.

Applications often authenticate using their own identities, known as service principals. These application identities can be granted direct access to Microsoft 365 and Azure resources.

If a client secret or other application credential is exposed, an attacker may be able to authenticate as that application and access whatever the application is authorised to reach.

That is why application permissions should be treated with the same care as user permissions.

Deleting the exposed secret is not enough

Microsoft makes an important point: if a credential has been publicly exposed, organisations should assume it has been compromised.

Simply removing the secret from GitHub does not make it safe again. Copies may still exist in repository history, caches, archives, logs or systems operated by attackers.

The correct response is to revoke or rotate the exposed credential immediately and investigate whether it has already been used.

What should businesses do?

1. Check public code repositories

Businesses that develop software, scripts, integrations or automation should review their public GitHub and other code repositories for exposed credentials and secrets.

GitHub provides secret-scanning capabilities that can help identify credentials committed to repositories.

2. Rotate anything that has been exposed

If a password, API key, application secret or connection string has appeared publicly, treat it as compromised even if it has now been deleted.

Revoke or rotate it and then check authentication and audit logs for suspicious use.

3. Reduce reliance on long-lived secrets

Microsoft recommends moving away from long-lived client secrets where possible.

For Microsoft Azure environments, managed identities can allow applications to authenticate without storing credentials directly in code or configuration files.

4. Review application permissions

Applications should only have access to the data and services they genuinely need.

If an application credential is compromised, excessive permissions can significantly increase the damage an attacker is able to cause.

5. Monitor service-principal sign-ins

Organisations using Microsoft Entra ID should monitor application and service-principal sign-ins, not just user logins.

Unexpected authentication from unusual IP addresses, repeated failed secret attempts or one source authenticating to several different applications can warrant investigation.

Does this affect normal Microsoft 365 users?

The technical weakness described by Microsoft primarily concerns exposed application credentials and cloud secrets rather than ordinary user passwords.

However, the consequences can still affect Microsoft 365 data. Microsoft observed compromised applications accessing SharePoint and OneDrive content in affected tenants.

For SMEs, the lesson is that cloud security is no longer only about protecting individual user accounts. Applications, integrations, automation tools and AI services also have identities and permissions that need to be managed securely.

How does this relate to AI governance?

KES recently covered Microsoft’s warning that AI agents should be treated as an insider-risk consideration. This new research shows the other side of the same issue: attackers are also using AI agents to accelerate reconnaissance and exploitation.

We have also covered how Microsoft Copilot can now take approved actions across connected business applications. As AI systems gain more ability to act on data and systems, identity, permissions and credential management become increasingly important on both the defensive and offensive sides.

What should KES customers take from this?

Most small businesses will not have teams of developers maintaining large public GitHub repositories, but many now use cloud integrations, APIs, website plugins, automation platforms and AI services that rely on application credentials.

The practical questions are therefore:

  • Where are your application passwords and API keys stored?
  • Could any of them be present in public code, scripts or documentation?
  • Do old integrations still have active credentials?
  • Do applications have more permissions than they need?
  • Would you know if an application identity was being abused?

As attackers automate more of the discovery and exploitation process, exposed credentials are likely to be found faster. Good credential hygiene is becoming more important, not less.

Quick answers

Are hackers really using AI to find passwords?

Microsoft has observed threat actors using agentic AI tooling to search public repositories for credentials, application secrets and API keys. The tooling can then help automate follow-on activity.

What happens if a secret is exposed on GitHub?

Assume it is compromised. Removing it from the repository is not enough; the credential should be revoked or rotated and its historical use investigated.

Can exposed application credentials lead to Microsoft 365 access?

Yes. Microsoft observed compromised application identities accessing connected Microsoft 365 resources, including SharePoint and OneDrive.

What is the safest alternative to storing application secrets?

Where supported, Microsoft recommends approaches such as managed identities that reduce or eliminate the need to store long-lived credentials in code.

Source

Information checked 11 November 2026. Threat techniques and Microsoft security guidance continue to change, so organisations should review current vendor guidance and their own application credentials, permissions and audit data.

author avatar
KES Team
The KES Team helps small and medium-sized businesses make practical use of technology. Based in Kent, we support businesses with Microsoft 365, IT support, cyber security and cloud services. Our Learning Centre explains technology changes in plain English, focusing on what they mean for your business and what to check next.