ACC-30Recommended
List connected apps and personal tokens
Show each person every app, agent and personal token that acts for them, with its scopes and last use. Let them revoke each one.
How to do it
List OAuth grants by app name, scopes, date granted and last use. List personal tokens by name, scopes, last four characters, expiry and last use. Revoking a grant ends its refresh tokens at once. Give every personal token an expiry, 90 days by default and at most 1 year, and refuse tokens without one. Start each token with a fixed prefix, such as exa_pat_, so secret scanners find leaked ones in code and chat. Store only a hash, as the API keys rule says, and show the token once.
How to check
Grant a test app access and make a personal token. Both appear in settings. Revoke both, and their next calls answer 401. Creating a token without an expiry, or with one more than a year away, is refused. A new token starts with the prefix, and the database holds only its hash.
Sources
Related rules
- API-42 Store API keys as hashes in API design
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/accounts/sessions-and-security-activity/connected-apps">Agent Wranglers accounts and identity playbook</a>. In code you write, add a comment next to it with the same link.