Takeaways
- An application programming interface (API) key in a stealer log has already left the organization, is often sold or posted, and keeps working until someone revokes it at the service that issued it.
- Infostealers copy keys and service account credentials from the device where they’re used, so tools that scan code repositories for secrets never see them.
- A service account credential in a log can stay usable for months, because offboarding, forced rotation, and multi-factor authentication (MFA) prompts never reach it.
- The first response answers which device leaked the credential, whether it still works, what it can reach, and who owns it.
- A password reset changes none of this, so each exposed key or credential has to be revoked and replaced at the service that issued it.
Security teams usually learn about an exposed key from a code scanner or a cloud bill. A stealer log is a third source, and the scanner never saw the key it holds. This post covers what happens to a key after it lands in a stealer log, what service account credentials look like in one, and what to do first.
What happens when an API key appears in a stealer log
A key in a stealer log has already left the organization. It stays usable until someone revokes it, and whoever holds the log can find it, test it, then use or resell it without the owner knowing.
The path usually runs in five stages:
- Collection. An infostealer on a developer or administrator device copies the files and tools it was built to read, including configuration files and local environments where keys sit. Okta noted that newer variants have added explicit rules for artificial intelligence (AI) provider API keys and known AI tool configuration paths.
- Packaging. The malware sends everything from the device to its operator as a log, one folder per infected machine. Okta’s analysis of one 7 GB dump found 5,871 such folders. SpyCloud’s data shows that exposed keys often arrive alongside session cookies, third-party application credentials, and personally identifiable information.
- Distribution. Logs are sold or posted on forums and messaging channels, and some are given away. Okta’s dump came from a free Telegram release in August 2026.
- Search and testing. Nobody reads logs by hand. Keys follow recognizable formats, so tools pull them out in bulk, and scanners can check whether a key still works. Okta used custom patterns and the open-source scanner TruffleHog to find 24 still-valid keys for Google Gemini, OpenAI, Groq, and OpenRouter in that dump. SpyCloud Labs has also observed automated feeds that post live OpenAI project keys with a machine identifier, hostname, and local username attached, details that don’t come from a repository scrape.
- Use or resale. A working key gets used or resold. SpyCloud Labs has seen stolen AI access resold at steep discounts, and keys for other platforms lead to whatever those platforms hold.
The API keys and tokens SpyCloud recaptured in 2025 show how wide that reach is:
| Platform type | Recaptured in 2025 |
|---|---|
| Cloud and infrastructure (Amazon Web Services (AWS), Google, Microsoft) | 36K+ tokens |
| Payment and remittance | 60K+ keys and tokens |
| Developer platforms (Atlassian, GitHub) | 3.3K+ tokens |
| Slack | 1.3K+ API tokens |
| AI platforms (OpenAI, Anthropic) | Hundreds of keys |
| Package repositories (PyPI, npm) | Dozens of tokens |
Secrets scanners search code repositories and build pipelines for keys that were committed by mistake. An infostealer takes keys from the laptop or server where someone actually uses them, so the key may never have been in a repository or pipeline at all. A scanner can report nothing exposed while a working key sits in a stealer log.
What service account credentials look like in stealer logs
Service account credentials reach logs the same way keys do: through the administrator and developer machines where they’re used. SpyCloud has seen service account credentials, connection strings, and Secure Shell (SSH) keys pulled from configuration files, integrated development environment (IDE) extensions, and local environments. In a log, a service account credential usually isn’t labeled as one. It can appear as a username and password in a configuration file, a connection string in an application setting, or a private key in a user folder. The log doesn’t say which account it belongs to or what that account can do, so identifying it falls to the team.
Service accounts are non-human identities (NHIs), and an exposed one can stay usable for months because the routines that protect employees don’t apply to it. SpyCloud’s research finds that four traits make NHIs attractive to attackers: a lack of MFA or strong identity assurance; limited rotation and unclear ownership; broad and long-lived permissions; and detection that depends on unusual usage, often well after damage is done.
| Employee credentials | Service accounts and API keys | |
|---|---|---|
| Ending access | Revoked at offboarding | No departure event to trigger a review |
| Rotation | Password resets and expiry policies | Limited, and often no clear owner to rotate them |
| Sign-in checks | MFA prompt at sign-in | Often no MFA or strong identity assurance |
| Spotting compromise | Unusual sign-in alerts | Depends on unusual usage, often after damage is done |
| Access scope | Tied to one person’s role | Broad and long-lived |
Ownership is where it stalls. In SpyCloud’s 2026 survey, 95% of organizations believed they had adequate visibility into AI and NHI exposures, but only 36% monitored them, and only 56% had formal policy and clear ownership for AI and NHI privileges.
What attackers do with exposed keys and service accounts
An exposed key is usually where an attack starts. SpyCloud’s research finds that attackers prioritize NHIs that sit deep inside trusted workflows, and in the 2026 survey, compromised NHIs were the most common initial access route, impacting 31% of affected organizations against 17% for phishing and social engineering. Attackers enumerate what a credential can reach, then pivot to higher-privilege accounts or systems. Service accounts make that easier because they hold standing permissions, and because detection depends on unusual usage, the activity can look routine until it is well underway.
The outcomes follow the credential’s permissions:
- Data exfiltration: Reading customer databases and cloud storage
- Resource abuse: Spending the victim’s cloud compute or AI service credit
- Supply chain compromise: Using a package repository token to introduce malicious code into a trusted software supply chain, which spreads the access well beyond the original exposure
- Financial fraud: Abusing payment platform keys
What to do first when a key or service account shows up in a stealer log
The first response answers four questions: which device leaked the credential, whether it still works, what it can reach, and who owns it. A password reset answers none of them.
Find the owner and confirm the credential is live.
- Start with the device. The log identifies the infected machine and user, which points to who held the credential. Isolate and clean the device before issuing replacements, because a stealer that’s still running copies the new key too. The post-infection remediation use case covers the wider process.
- Identify the provider, the key type, and the application or environment it belongs to.
- Find the owner. Many providers show who created a key and which project or account it belongs to. Search repositories and continuous integration and continuous delivery (CI/CD) secret stores for the key or its prefix, and check cloud and identity inventories for a service account’s owner. If no owner turns up, assign one now, since a credential nobody owns can’t be rotated.
- Confirm whether the key is still live from the provider’s console or audit log. Calling the API with the exposed key can add activity that looks like the attacker’s.
- Check what it can reach: its permissions, scopes, and the data and systems behind it. The scope decides how large the response gets.
Contain, replace, and review.
- Revoke the key and issue a replacement. Where the provider supports overlapping keys, create the new one, cut dependent applications over, and revoke the old one right away. If the key is already being abused, revoke first and repair the dependent service afterward.
- Update every application and pipeline that used the key, and store the replacement outside files on disk, where a stealer would look.
- For a service account, restrict or disable it where dependent applications can tolerate it, issue new credentials, and reduce its privileges to what the service needs.
- Review activity logs for the exposure window, looking for unfamiliar locations, unusual volume, new keys, new resources, and privilege changes.
- Check what else left with it. The same log likely holds passwords, session cookies, and other keys from that device, and stolen AI agent credentials has the platform details for AI tool keys.
- For vendor-held access, notify the vendor and verify their remediation.
Whatever tool surfaces an exposure, a finding is only as useful as what it tells the responder. A useful finding contains:
| Element | What the responder uses it for |
|---|---|
| The credential and its type | Matching it to a provider and an application |
| The source device and user | Starting the cleanup and finding the owner |
| When it was captured | Setting the exposure window to review |
| Whether it is still active | Deciding how urgently to revoke it |
| What it can reach | Sizing the response |
| Its likely owner | Knowing who revokes and replaces it |
SpyCloud recaptures stealer logs from criminal infrastructure, so it can show which keys and service account credentials have left an organization and which device or vendor leaked them. Its recaptured data spans more than 100,000 data sources, 105+ tracked malware families, and 63M+ API keys and tokens, and Endpoint Threat Protection flags infected devices and the cookies stolen from them.
Stop credential exposure before attackers strike
Vaults, least privilege, short-lived credentials, scheduled rotation, and audit logging lower the chance a key leaks, and SpyCloud’s research recommends inventorying NHIs and assigning each one an owner before enforcing them. Least privilege and just-in-time access also means extending zero trust to machine identities. None of these controls can pull back a key a stealer already copied, so external visibility belongs next to them. SpyCloud recaptures the logs where those keys end up, so teams can find [exposed API keys] and [service account credentials] and rotate them first.
See which keys have left your environment.
Request a demo to see how SpyCloud finds exposed service accounts and API keys, and the device or vendor each came from, before attackers can use them.
Your organization's data may already be exposed.
Billions of assets from this year’s identity events are circulating right now.
FAQs
Infostealers copy keys from the device where they’re used, such as configuration files, local tools, and developer environments. Secrets scanners look for keys committed to code repositories and build pipelines, so a key taken from a device never shows up in their results. SpyCloud Labs has seen live keys posted with a machine identifier, hostname, and local username attached, which a repository scrape wouldn’t include.
A key isn’t tied to its owner’s password, so a reset leaves it working. It has to be revoked and replaced at the service that issued it, and every application that uses it has to be updated.
A service account is an identity, a user-like entity for software, and an API key is a credential. A service account can hold several credentials, including passwords, certificates, and API keys, so exposing the account can give an attacker broader access than a single key. Both are non-human identities and need ownership, rotation, and monitoring.
Set rotation by how sensitive the credential is and how many systems depend on it. Rotate standard credentials on a schedule, high-sensitivity keys more often, and any credential immediately after suspected exposure, whatever the schedule says. Automating rotation through a secrets management tool lowers the operating burden, and it depends on someone owning each credential.
Often, yes. Most cloud providers and software-as-a-service (SaaS) platforms offer an API to revoke or rotate keys, so a team can automate the response through a security orchestration, automation, and response (SOAR) platform. Revocation is one step. The replacement has to be issued and every dependent application updated, or the service breaks.
An exposed credential reveals trust relationships and access patterns before it reveals anything worth taking. Attackers use the first foothold to map the environment, escalate privileges, and establish persistence before they extract data, which gets more value from the same compromise.