Agent Wranglers

AID-26Required

Give agents the fewest rights they need

Give each agent token only the rights its task needs, and make it short-lived and easy to revoke.

How to do it

Use fine-grained tokens, such as a repository-scoped token that can push branches but not merge or change settings. Set each token to expire, such as within 30 days. Use read-only database users for analysis. See give agent tools the least power they need.

How to check

With the agent's token, try to merge to the main branch, delete the repository and read another repository. All three fail. The token shows an expiry date.

Sources

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/ai-assisted-development/isolation-and-credentials/least-privilege-agents">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.