How Your Credentials Are Leaked by LLM Agent Skills: An Empirical Study
Organizations: Griffith University, Australia · Wake Forest University, USA · Nanyang Technological University, Singapore · University of New South Wales, Australia ·
Abstract
Large Language Model (LLM) agents increasingly rely on third-party skills that operate within privileged execution environments and routinely handle sensitive credentials, yet how these credentials are leaked remains largely unexplored. To fill this gap, we present the first large-scale empirical study on credential leakage in agent skills. From 170,226 artifacts on SkillsMP, the largest open-source skill marketplace, we sampled 17,022 skills via stratified random sampling and analyzed each through static secret extraction (regex and AST parsing), dynamic sandbox testing with mock credentials, and cross-referencing developer intent against runtime behavior. Our analysis identifies 520 affected skills containing 1,708 security issues, and yields a taxonomy of 10 leakage patterns. Three findings stand out. First, 76.3% of cases require jointly analyzing natural-language descriptions and programming logic, showing that credential exposure in skills is fundamentally cross-modal. Second, debug logging accounts for 73.5% of vulnerabilities because agent frameworks feed stdout into the LLM context window, turning routine debugging into a credential exposure vector. Third, 89.6% of leaked credentials are immediately exploitable -- 92.5% during routine execution without elevated privileges -- and the fork-based distribution model defeats remediation, as secrets removed from 107 upstream repositories persist across 50+ independent forks. Following responsible disclosure, all malicious skills have been removed and 91.6% of hardcoded cases remediated. We release our dataset, taxonomy, and detection pipeline to support future agent security research.
Figures & tables
| Credential Type | Description | Examples |
| Authentication and access credentials | ||
| API keys & cloud credentials | Identifiers or key sets used to authenticate requests to third-party services or cloud infrastructure. | OpenAI ( sk-... ); Groq ( gsk-... ); AWS ( AKIA... ); GCP service account JSON keys |
| OAuth tokens | Tokens issued through OAuth 2.0 flows that grant scoped access to protected resources. | Google OAuth tokens; GitHub tokens; refresh tokens |
| Database credentials | Connection strings or username/password pairs used to authenticate to database services. | PostgreSQL; MySQL; MongoDB connection strings; embedded passwords |
| Local secrets and cryptographic material | ||
| Passwords & passphrases | Plaintext passwords or passphrases used for authentication. | SMTP passwords; admin panel credentials; CLI argument passwords |
| Category | Total | Percentage (%) |
| By Functional Category | ||
| Web Scraping | 89 | 17.1% |
| Data Processing | 76 | 14.6% |
| API Integration | 68 | 13.1% |
| File Management | 52 | 10.0% |
| Automation | 47 | 9.0% |
| Category | Pattern | Leakage Channel | Issues (%) | Skills |
| Vulnerability Skills (437 skills, 1,371 issues) | Hardcoded Credentials | Source code, documentation, config files | 249 (18.2%) | 107 |
| Insecure Storage | CLI arguments, process parameters, URL parameters | 110 (8.0%) | 77 | |
| Information Exposure | Console logs, debug output, API responses | 1,007 (73.5%) | 352 | |
| Artifact Leakage | Shell history, temp files, cache, git config | 5 (0.4%) | 5 | |
| Malicious Skills (83 skills, 337 issues) | Remote Exploitation | Remote Code Execution (RCE) backdoors, reverse shells | 176 (52.2%) | 55 |
| Credential Compromise | Social engineering, env theft, SSH key theft | 28 (8.3%) | 16 |
LLM Agent Security
Large language model agent security studies attacks and safeguards for systems that plan, use tools, retain memory, and act across applications.
See all 327 papers