Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

WeaknessASC-2026-0033Other weakness

Long-lived credentials in agent and MCP configuration

MediumMitigated

API keys and tokens sit in plain text in MCP configs, agent settings and environment files, where any process, package or injected agent can read them.

How to detect it

  • Secrets in mcp.json, agent settings or .env files committed or shared
  • Agents that can read their own configuration directory

How to resolve it

  • Load secrets from a secret manager or OS keychain at runtime
  • Use short-lived, narrowly scoped tokens
  • Keep configuration directories out of the agent's readable workspace

How to investigate

  1. Search repositories and machines for the exposed secret
  2. Rotate it and check its usage logs

Sources

Open it in the Learning Center's vulnerability database