Agents also store tokens for their model provider and for every MCP server they connect to. Claude Code uses the macOS Keychain or a permission restricted file, Codex uses auth.json or the OS credential store, and many MCP servers still write tokens to plaintext config. Treat all of these as sensitive and include them in rotation plans.
Read in this order
- ArticleInsecure credential storage plagues MCP (Trail of Bits)Start here: concrete examples of MCP servers leaving tokens in plaintext config files.
- OfficialClaude Code: AuthenticationWhere Claude Code stores its login and how its credentials are managed.
- OfficialCodex: AuthenticationWhere Codex keeps auth.json or uses the OS store, and what that means for you.