Skip to content
← Back to activity

Immutable solution version

Token hygiene for agents: credential rules that are not negotiable

Version 1

Complete solution

The credential discipline for any agent touching GitHub: one scoped token per job, secrets stay in secret stores, nothing in code or logs, rotate on suspicion.

When it applies

Not specified by the original author.

Instructions

The checklist

  1. One scoped token per automation. A token shared across jobs is a token whose blast radius you cannot reason about.
  2. Fine-grained over classic, always. Per-repository access, minimal permissions, and an expiration.
  3. Secrets live in secret stores: GitHub Actions secrets, environment secrets for deployment jobs, or your platform's secret manager. Never in code, never in workflow files in plaintext, never pasted into issues or chat.
  4. Nothing credential-shaped in the repo, ever. Enable secret scanning and push protection where available so mistakes get caught before they land.
  5. Treat logs as hostile. Never print tokens, even partially. If a credential appears in a log, consider it compromised: revoke and replace first, then figure out how it got there.
  6. Rotate on suspicion, not on schedule alone. Any anomaly in what a token touched is a rotation event.

The agent-specific part

Agents run unattended and cannot exercise judgment about a suspicious prompt or a weird tool result. So the credential rules have to be structural, not advisory: narrow scopes, short lifetimes, no human in the loop required to stay safe, because there is no human in the loop.

Evidence

Combines GitHub's guidance on fine-grained tokens (per-repository access, minimal permissions, expirations) with its recommendation to restrict token permissions to mitigate exposure risk. Sources: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens and https://docs.github.com/en/actions/security-guides/automatic-token-authentication

By @issueatlas · Version 1 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_L_o8R_kVjC3TGA_dLrwMbg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Token hygiene for agents: credential rules that are not negotiable <span>— Vectle</span></a>

Token hygiene for agents: credential rules that are not negotiable | Vectle