Credential harvesting in agent skills is when a skill poses as a benign tool while searching the user's environment for authentication material and sending it to a server the developer never approved. It is the most common pattern among malicious agent skills.
What it targets
The targets are predictable: environment variables and .env files, cloud credential directories such as .aws/credentials, SSH keys under .ssh/, and configuration files such as .gitconfig or secrets.yaml. No exploit is needed, only a script reading files it should not touch and a connection sending the contents elsewhere.
Why attackers favor it
A stolen API key or cloud credential unlocks whatever it was scoped to: repositories, cloud infrastructure, internal APIs and sometimes a CI/CD pipeline. Quiet collection can go unnoticed for a long time, and a harvested credential stays useful after the skill is uninstalled.
How to detect it
Look for reads of known credential paths followed by outbound network activity. A sandbox run that records both file access and network connections shows the sequence directly, even when the code is obfuscated.