Skip to content

Commit e432060

Browse files
docs: add classic PAT guidance for collaborator/cross-org repos (aws-samples#163)
Fine-grained PATs cannot target repos the user doesn't own (or orgs that haven't opted in). Document the classic PAT alternative with repo + read:org scopes, add a "when to use which" decision table to agent/README.md, and fix the dead "edge cases" reference in the Developer Guide. Co-authored-by: bgagent <345885+scottschreckengaust@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 70092ca commit e432060

5 files changed

Lines changed: 34 additions & 4 deletions

File tree

agent/README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ The Docker image is built for `linux/arm64` to match AgentCore Runtime requireme
1515

1616
### GitHub PAT — Minimal Permissions
1717

18-
Create a **fine-grained PAT** at GitHub > Settings > Developer settings > Personal access tokens > Fine-grained tokens.
18+
Two token types work. Choose based on your access model:
19+
20+
#### Fine-grained PAT (recommended for repos you own)
21+
22+
Go to GitHub > **Settings** > **Developer settings** > **Fine-grained tokens**.
1923

2024
**Repository access**: Select only the specific repo(s) the agent will work on.
2125

@@ -26,7 +30,29 @@ Create a **fine-grained PAT** at GitHub > Settings > Developer settings > Person
2630
| **Issues** | Read | Fetch issue title, body, and comments for context |
2731
| **Metadata** | Read | Granted by default |
2832

29-
No other permissions are needed.
33+
**Limitation:** Fine-grained PATs can only target repos you own or repos in organizations that have opted in to fine-grained token access. If you are a collaborator on someone else's repo (or an org that hasn't enabled the feature), the repo won't appear in the token creation UI.
34+
35+
#### Classic PAT (required for collaborator/cross-org access)
36+
37+
Use a classic PAT when fine-grained tokens cannot reach the target repository — typically when you are a collaborator on a repo owned by another user or an organization that has not enabled fine-grained token access.
38+
39+
Go to GitHub > **Settings** > **Developer settings** > **Personal access tokens** > **Tokens (classic)**.
40+
41+
| Scope | Reason |
42+
|-------|--------|
43+
| `repo` | Full repository access (clone, push, PRs, issues) |
44+
| `read:org` | Resolve org membership for org-owned repos |
45+
46+
Set an expiration (90 days recommended) and store it in Secrets Manager the same way as a fine-grained token.
47+
48+
#### When to use which
49+
50+
| Scenario | Token type |
51+
|----------|-----------|
52+
| Your own repos or your org has fine-grained enabled | Fine-grained |
53+
| Collaborator on another user's repo | Classic |
54+
| Org has not opted in to fine-grained tokens | Classic |
55+
| Targeting repos across multiple orgs | Classic (single token covers all) |
3056

3157
### AWS Credentials
3258

docs/guides/DEVELOPER_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Permission requirements vary by task type:
4141
- `new_task` and `pr_iteration` require Contents (read/write) and Pull requests (read/write).
4242
- `pr_review` only needs Triage or higher since it does not push branches.
4343

44-
Classic PATs with `repo` scope also work. See `agent/README.md` for edge cases.
44+
Classic PATs with `repo` + `read:org` scopes also work and are required when fine-grained tokens cannot reach the target repo (collaborator access, cross-org repos). See [agent/README.md](../../agent/README.md#github-pat--minimal-permissions) for when to use which token type.
4545

4646
### Quick setup (single repo)
4747

docs/guides/QUICK_START.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ The agent authenticates to GitHub using a **fine-grained personal access token (
5757

5858
Keep the token value - you will store it in AWS Secrets Manager after deploying.
5959

60+
> **Collaborator or cross-org repos?** Fine-grained tokens only work for repos you own (or orgs that have opted in). If you're a collaborator on someone else's repo, create a **classic PAT** with `repo` + `read:org` scopes instead. See [agent/README.md](../../agent/README.md#github-pat--minimal-permissions) for details.
61+
6062
### Register the repo in CDK
6163

6264
Every repository the agent can work on must be **onboarded** as a `Blueprint` construct in the CDK stack. The Blueprint writes a configuration record to DynamoDB; the orchestrator checks this before accepting tasks.

docs/src/content/docs/developer-guide/Repository-preparation.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/content/docs/getting-started/Quick-start.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ The agent authenticates to GitHub using a **fine-grained personal access token (
6161

6262
Keep the token value - you will store it in AWS Secrets Manager after deploying.
6363

64+
> **Collaborator or cross-org repos?** Fine-grained tokens only work for repos you own (or orgs that have opted in). If you're a collaborator on someone else's repo, create a **classic PAT** with `repo` + `read:org` scopes instead. See [agent/README.md](/architecture/readme#github-pat--minimal-permissions) for details.
65+
6466
### Register the repo in CDK
6567

6668
Every repository the agent can work on must be **onboarded** as a `Blueprint` construct in the CDK stack. The Blueprint writes a configuration record to DynamoDB; the orchestrator checks this before accepting tasks.

0 commit comments

Comments
 (0)