SpyCloud icon depicting layered documents on teal background.

What Happens When an API Key or Service Account Appears in a Stealer Log?

Table of Contents

Check your exposure

Takeaways

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:

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:

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.

Contain, replace, and review.

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.

Keep reading

SpyCloud BlueKit BiTM Analysis image for phishing service context.
Out of the Blue(Kit): Analysis of a $250-a-week browser-in-the-middle phishing service
BlueKit is a highly advanced PhaaS kit. Since August 2026, SpyCloud has observed hundreds of captures targeting businesses, government agencies, non-profits, and individuals, some of which contained evidence indicating that a new technique termed “browser-in-the-middle” was used to capture both sessions and passkeys.
Key icon over a green square with a red malware badge on dark network background.
Can Infostealers Steal AI Agent and Coding Assistant Credentials?
Infostealers copy session cookies, OAuth tokens, and API keys from AI tools. See how stolen tokens skip MFA and what to revoke after an infection.
SpyCloud comparison icons showing checks and crosses.
Comparing SpyCloud Alternatives and Competitors
Compare SpyCloud alternatives and competitors, and learn how to evaluate identity threat detection and response platforms on data and automation.

Check Your Company's Exposure

See your real-time exposure details powered by SpyCloud.