# How to give every coding agent its own token and branch limits with git-ai

Repo: [feder-cr/git-ai](https://github.com/feder-cr/git-ai) | Difficulty: Intermediate | Time: 1 hour | Basis: Seen in the wild

Use per-agent tokens, an RPC allowlist and branch policies so each agent can only do what you allow.

**Who it is for:** Engineering manager who just discovered an agent pushed to a protected branch and wants accountability per agent

**The problem:** With shared credentials you cannot tell which agent broke something or stop one from touching branches it should not.

**The outcome:** Each agent has its own identity and permitted actions, and each landed change is logged with the agent that made it.

## Steps

1. Read doc/graft/AGENT-SECURITY.md to see how tokens, the RPC allowlist and branch policies are set
2. Add per-agent tokens and branch policies to your config.toml
3. Restart the server and have two agents land changes under different identities
4. Use the graft CLI to list the changeset log and check each entry shows its actor

## Prompt to paste into your agent

```text
In feder-cr/git-ai, follow doc/graft/AGENT-SECURITY.md to create two agent tokens in <config.toml> with different branch policies. Show that one agent is denied on a protected branch, and verify the changeset log records which agent landed each accepted change.
```

## Caveat

Exact config keys for tokens and policies live in the docs, not the README; follow the docs instead of guessing the TOML.

## Seen in the wild

- X (Oct 2026): https://x.com/i/web/status/2112319865218314452
- X (Oct 2026): https://x.com/i/web/status/2112080627617202280

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/feder-cr-git-ai/give-each-agent-its-own-token/
