Install any skill in seconds. Free to start, no credit card required.
Get Started Free →API key and token strategy — one token per purpose, least-privilege separation, distinct scopes for CI/automation vs. manual operations vs. read-only access. Use when designing token/credential architecture, rotating credentials, setting up API access for multi-purpose systems, or implementing least-privilege token management.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-21 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 13% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 25% | 0% |
Principle: Each API key or authentication token should have a single, well-defined purpose with a descriptive name. This is not binary ("broad vs. narrow") — it's 2–3 tokens with clearly demarcated scopes, one per category of use.
Why this matters:
| Situation | Decision | |---|---| | Platform with one caller only (one manual script) | 1 token with minimal scope. Acceptable. | | Platform with 2+ different callers (CI + agent + scheduled job + manual ops) | Separate by caller category. Minimum 2: one for CI/automation + one for ops. | | One "universal" token used everywhere | Anti-pattern. Refactor. | | 10+ fragmented tokens (one per workflow) | Anti-pattern. Consolidate into 2–3 categories. |
Adjust these for your platform, but the pattern is universal:
<service>-ci-bot — deploy, trigger, release actions only. Deployed to CI/automation systems (GitHub Actions, GitLab CI, scheduled tasks, etc.).<service>-ops-bot — full read/write for operational tasks. Stored securely for manual use, agent-driven operations, sysadmin scripts.<service>-readonly-bot — read-only access. For dashboards, monitoring, audit logs. Optional; skip if not needed.Every project using multiple tokens must maintain an API inventory (suggested: docs/api-inventory.md or equivalent) listing:
github-ci-bot, slack-ops-bot)This inventory is your audit trail and your incident-response checklist.
default, test, bot1) → rename to purpose-descriptive names..env files (with .env in .gitignore) or local credential managers. Never commit token values.All platforms with API authentication: cloud providers (AWS, GCP, Azure), SaaS platforms (GitHub, GitLab, Slack, Discord), infrastructure tools (Terraform, Kubernetes), deployment systems, monitoring/observability platforms, and any third-party integrations.
Use this across all AI agents and tooling, regardless of platform or framework.
Other measured skills in the registry, with their headline benchmark lift.