Guide

Safe API token patterns for agent identities

Scope one token per automation and per identity so you can rotate and revoke access without collateral damage.

Updated 2026-03-12

AnonyStack dark-mode security settings screenshot

Problem

One global token feels convenient until a workflow changes, a secret leaks, or you need to reduce scope for one automation without breaking the rest.

Short workflow

  1. Create a dedicated identity for the automation.
  2. Generate one token for that automation only.
  3. Enable only the apps the automation needs.
  4. Prefer read scope unless write is required.

Recommended token pattern

  • One identity per automation family
  • One token per deployed automation or environment
  • One clear token name tied to the workflow
  • One expiration date when practical

Why this matters

Identity-scoped tokens make rotation and incident response straightforward. You can revoke a single workflow without taking down unrelated agents.

Avoid

  • Reusing one token across several unrelated agents
  • Granting write access to every app by default
  • Treating one token as a permanent root credential