Target repo: rapartlu/agent-orchestrator
This is the fleet-facing source of truth for replacing the shared Operator PAT with per-agent GitHub App installation tokens.
Every agent should authenticate to GitHub as its own bot identity.
- PRs, reviews, comments, labels, and issue operations are authored through the agent's own installation token.
- No agent process should depend on a shared operator PAT at runtime.
- Tokens are short-lived, cached in memory, and refreshed before expiry.
claude-agent-orchestrator
Use the orchestrator callback endpoint registered in GitHub App settings. For local and staging setups, keep this as a dedicated GitHub App callback route rather than a reusable human OAuth callback.
- One GitHub App.
- One installation per target repository.
- One installation token per agent runtime.
- The runtime injects the token into
ghand API clients as the agent's own identity.
The matrix below is the intended minimum set. Grant the narrowest permissions that let each agent complete its own work.
| Agent role | Primary repo(s) | GitHub App permissions |
|---|---|---|
| Orchestrator | rapartlu/agent-orchestrator |
Contents: Read & write, Issues: Read & write, Pull requests: Read & write, Metadata: Read |
| Reviewer | rapartlu/agent-reviewer |
Contents: Read, Issues: Read & write, Pull requests: Read & write, Metadata: Read |
| Dashboard | rapartlu/agent-dashboard |
Contents: Read, Issues: Read, Pull requests: Read, Metadata: Read |
| Research | rapartlu/research-agent |
Contents: Read, Issues: Read & write, Metadata: Read |
| Proxy | rapartlu/agent-proxy |
Contents: Read, Metadata: Read |
| Meeting facilitator | rapartlu/meeting-facilitator-agent |
Contents: Read, Issues: Read & write, Metadata: Read |
Notes:
- If an agent must review or edit PRs, grant
Pull requests: Read & write. - If an agent only reports findings, prefer
Issues: Read & writeand keepContentsread-only. - Avoid broad org-wide access unless a repo genuinely needs it.
- Load the app private key and installation ID for the agent.
- Mint a short-lived GitHub App JWT.
- Exchange the JWT for an installation token.
- Cache the token in memory until 5 minutes before expiry.
- Refresh on expiry or when GitHub returns an auth failure.
- Inject the token into
GH_TOKENandGITHUB_TOKENfor the agent process. - Let the agent's own repo identity drive authorship and audit trail.
ghCLI calls must run with the per-agent installation token.- GitHub API calls must use the same token.
- No token should be written to disk.
- No token should be shared across agents.
- Commit author metadata should match the bot identity for that agent.
- Orchestrator
- Reviewer
- Dashboard
- Research
- Proxy
Ship each stage only after verifying that the resulting PR, review, or comment is authored under the new bot identity.
- Remove the shared Operator PAT from
.env. - Remove any PAT references from
CLAUDE.md. - Confirm the runtime only reads per-agent GitHub App credentials.
- Keep the installation token cache in-memory only.
Once the app spec is accepted:
- Register the app in the GitHub UI.
- Grant the initial installations for the fleet repos.
- Flip the fleet flags in
RESOURCES.mdand Telegram. - Verify the next PR from each staged agent is authored by the new bot identity.