The CISO POST All field notes
AI security · FIELD MEMO 029

An exposed secret can become a breach in five minutes

AI has compressed the time between a leaked credential and a cloud compromise. Startups need fewer permanent secrets, automatic rotation, and guardrails that expect human mistakes.

A secret in a public repository used to create a dangerous window. AI is closing that window. Microsoft recently observed an agent move from finding client secrets on GitHub to exfiltrating data from Azure Key Vault in five minutes. Discovery, validation, and follow-on action can now happen before anyone on your team notices the original mistake.

The attacker no longer needs a long afternoon

Secrets have always escaped into public repositories, configuration files, support tickets, chat messages, and developer laptops. What has changed is the speed at which an exposed credential can be found and used.

Microsoft recently described attackers using an AI-driven framework to search public GitHub repositories for credentials and conduct the next steps of the attack. In one observed case, an agent progressed from finding client secrets to taking data from Azure Key Vault in five minutes.

Five minutes is not a realistic response window. A repository alert may enter a queue. By the time someone removes the key from the file, the credential may already have been used.

Removing the text from GitHub is also not containment. The secret remains valid until it is revoked or rotated.

The design principleDo not rely on people to keep permanent secrets safe. Reduce the secrets, shorten their lives, and limit what each one can reach.

The problem starts with secret sprawl

Most young companies cannot answer a simple question: how many long-lived credentials exist, who uses them, and what can they access?

Static keys accumulate because they are convenient. They appear in environment files, deployment settings, test scripts, shared documents, and code. Some were created for a proof of concept and quietly became permanent.

The human path creates another source of exposure. Someone pastes a configuration block into a free AI prompt to debug an error. A developer gives a third-party tool a key because it promises to complete a quick task. A token enters a ticket or chat thread so another person can reproduce a problem.

Awareness training helps, but it cannot inventory every credential or prevent every rushed decision. The safer approach is to reduce how often humans and applications handle reusable secrets at all.

Start by removing permanent credentials

The first question should not be, “Where can we store this key more safely?” Ask whether the key needs to exist.

Use workload identities, managed identities, or role-based access wherever the platform supports them. Let the application prove what it is and receive short-lived access instead of embedding a permanent credential in code or configuration.

When an application needs a secret, keep it in a managed secrets service or key management system. Code should request the value at runtime using its workload identity. Developers pass a reference or parameter, not the secret itself.

This leaves less reusable material in source code, fewer keys copied between people, and a clearer place to control access.

Make rotation automatic

Rotation sounds simple until one key is used by six services and nobody knows which deployments will fail when it changes. That is why long-lived credentials become difficult to remove. The problem is not generating a replacement. It is finding every dependency and changing it safely.

Prioritise credentials that can reach production, customer data, identity systems, source code, cloud administration, or other secrets. Give each one an owner, purpose, scope, and expiry. Remove unused keys before building a complicated rotation process around them.

For credentials that must remain, automate rotation through the secrets platform and make applications retrieve the current value at runtime. Test whether rotation works without manual code changes or emergency deployment. A control that exists in a policy but breaks production when used is not an operating control.

Short lifetimes reduce the period in which stolen material remains useful, provided its permissions were limited in the first place.

Limit the blast radius

A short-lived credential with excessive access can still cause serious harm. Every application identity should receive only the permissions and environments it needs.

Separate development from production. Avoid one key that works across multiple customers, cloud accounts, or internal services. Restrict where a credential can be used when the platform supports it. Monitor unusual use by location, workload, volume, or resource.

If one exposed key can read other secrets, change identity permissions, and access customer data, rotation alone is doing too much work.

Protect people at the point of error

Humans will copy the wrong block, paste into the wrong window, or try a convenient tool under pressure. A mature control system accepts that reality.

Add secret scanning before code is committed and again in the central repository. Scan collaboration and ticketing workflows where practical. Use browser, endpoint, secure web gateway, or inline data-loss controls to detect credential patterns being pasted into public AI services and unapproved tools. A useful control can warn the user, block a high-confidence secret, or route them to an approved alternative.

These guardrails need care. Aggressive blocking creates false positives and drives people to unmanaged devices. Begin with the highest-risk credential formats and destinations, then provide a safe way to complete the task.

A practical first response

Do not begin with a company-wide hunt for every string that looks like a password.

Start with credentials that can reach production and sensitive data. Find long-lived cloud keys, application client secrets, API keys, personal access tokens, and credentials stored in code or deployment settings. Revoke what is unused. Move what remains into managed secret storage. Replace permanent credentials with workload identity where possible. Then test rotation and alerting as an operating process.

People will remain part of the system. The goal is not to declare them the weakest link and hope they become perfect. It is to build layered defences so one ordinary mistake does not become a breach five minutes later.

Assume a leaked secret will be tested immediately. The strongest defence is to remove long-lived credentials, retrieve secrets at runtime, rotate automatically, and interrupt accidental disclosure before it leaves the user’s device.
FIELD MEMO 029

Useful now, not someday.