How do you keep integration and automation tokens from becoming a breach?
Give every integration its own short-lived credential, prefer workload identity, and treat revocation as done only when the old key fails.
2 min readDEV GroupIntegrations & data movement · Security
How a token becomes a breach
Give every integration its own narrowly scoped, short-lived credential, prefer workload identity over stored secrets, and treat revocation as done only when the old credential is proven to fail. Public reporting from October 2026 shows how the alternative goes. A supply-chain compromise of an AI gateway project traced back to an admin key that had leaked and was believed revoked, but still worked. An automation platform held an unscoped org-owner CLI token, so whoever had it could bypass branch protection and publish a malicious release. A separate advisory described a deploy integration that wrote AI provider keys in clear text into committed files. None of these needed a novel exploit. Each was a token with too much reach, too long a life, or no owner.
One token, one integration
Issue one token per integration, never one shared across several, so a leak has a known blast radius and can be cut without breaking everything else. Grant the minimum: the repositories, scopes, and actions that integration uses, read-only where it only reads. Set short lifetimes and rotate on a schedule, so a leaked token expires on its own. For CI and bots, use OIDC or workload identity: the job proves what it is at run time and receives a credential that lasts minutes. There is no long-lived secret to steal. Never give a bot org-owner or admin rights. If an automation needs to publish, give it publish rights on one package or repository, behind a protected release step. Make branch protection and required reviews apply to admins and bots too. An exemption for automation is the path an attacker takes. Keep secrets out of build artifacts, logs, images, and committed files. Inject them at run time, and run secret scanning in CI and on push, so a key that lands in a commit fails the build and gets rotated, not just deleted from the file. Git history keeps what a later commit removes.
Revocation and inventory
Revocation is not done when someone clicks revoke. It is done when a test call with the old credential fails, in every environment it was used. Keep an inventory: each token, the integration it belongs to, its scopes, its expiry, and a named owner. A token nobody owns is the one nobody rotates. Alert on token use from unexpected places: a new IP range, an unfamiliar runner, an unusual time, or a scope the integration has never used. Token scoping, workload identity, rotation, and the inventory around them are software work at the seams, and that is where we fit.
- Related: making webhook retries safe to repeat
- Related: recovering durable workflows stuck in Running
- Related: catching an AI feature that is confidently wrong
- Related: deciding whether an AI agent's action actually runs
- Integrations & data movement
- Running integrations on long-lived tokens? Start a conversation
Sources
- Public reporting on leaked and over-scoped tokens. Public reporting. October 2026.
Was this useful?
Related notes
Integrations2 min read
Who can read your webhook signing secret, and who can point your webhooks somewhere else?
Show a signing secret once, verify every delivery, and treat a change to where webhooks deliver as a privileged action.
- Webhooks
- Secrets
- Authorization
Applied AI3 min read
How do you keep a stolen AI API key from running up the bill?
Stolen AI provider keys from a hosting breach ran up about $740,000. Cap each key's spend, watch usage like fraud, and rotate without a rebuild.
- Secrets
- Tokens
- Spend limits
- Monitoring
Security3 min read
How do you stop a new sign-up from making itself an owner of someone else's account?
In November 2026 a free sign-up made itself owner of a vendor's own org through one invitation check. Authorize every grant on the server.
- Authorization
- Multi-tenancy
- CI