Skip to main content

What the GitHub credential needs

This is the list to hand your GitHub admin before the token is minted. Every item on it is a way for a credential to authenticate cleanly and then either empty the source or quietly undercount it, which is the failure the go-live procedure exists to catch — arrived at from the one direction the checks in Take a source live do not cover.

Prism does not care which kind of token it is. The ingest sends Authorization: Bearer <the token>, which classic and fine-grained personal access tokens both accept. What differs is what you have to ask for.

A GitHub App is the third kind, and it is configured differently — three values rather than a token, because Prism mints the token itself. The permission list below is the one to ask for either way; Widen a source's scope has the procedure. Prefer it wherever the choice is open: an installation token's scope is the App's grant rather than a person's visibility, it carries no user seat, and it gets higher rate limits. A fine-grained token scoped to All repositories is a perfectly good credential for an organisation of any size, and is the simpler place to start.

Classic PAT: repo + read:org, and SSO-authorised for the org wherever SAML is enforced. repo is the part to be uneasy about — GitHub has no read-only private-repo scope, so it grants write as well. Prism never uses it; if your organisation is minting for least privilege, a fine-grained token is the answer, and the four notes below are the price of it.

Fine-grained PAT:

On the tokenWhat to ask for
Resource ownerthe organisation you are measuring — one per token
Repository accessAll repositories
Repository permissionsPull requests: Read · Issues: Read · Metadata: Read
Repository permissions, if mcps.githubLive.enabledthe three above plus Contents: Read · Checks: Read · Commit statuses: Read

The first row is the whole list for the ingest, which is what Take a source live is about: no Contents, nothing at organisation level, and no write of any kind. What the ingest stores is pull-request and issue metadata — authors, timestamps, states, labels, review outcomes, and the added/deleted line counts — never a diff, and never the body of a comment or a review.

By default the optional GitHub Live MCP reads the same github-token, so it widens that one list rather than getting a list of its own. It exists to open one named pull request on request, and its detail tool can return that PR's diff, its changed files, its comments and its CI checks — so it needs more than the three permissions above, and it changes the answer to "does Prism read our code". It is off by default (mcps.githubLive.enabled) and is not in every deployment.

If you are turning it on, add three grants to the token you are already minting — Contents: Read (the diff and changed-files views), Checks: Read and Commit statuses: Read (the CI-checks view; these are two separate GitHub permissions and the CI aspects fail with Resource not accessible by personal access token without them). Still nothing at organisation level, and still no write.

Or give the live MCP a token of its own. Set secrets.githubLiveToken to a second token. The live MCP then reads that token and never github-token. Each token carries only its own list:

TokenRepository permissions, all Read
secrets.githubToken, the ingest'sPull requests · Issues · Metadata
secrets.githubLiveToken, the live MCP'sPull requests · Metadata · Contents · Checks · Commit statuses

The live MCP is the part of Prism that reads text the model chose, so a narrower token there is worth the second token. With existingSecret, put the token under the key github-live-token and set mcps.githubLive.ownToken=true. Without that setting the live MCP reads github-token, because the chart cannot see which keys your Secret holds.

Why one list by default. With one token, the ingest and the live MCP both read secret key github-token, and compose gives both ${GITHUB_TOKEN}. So a grant list written for the live MCP alone would drop Issues: Read, and the ingest's issue half would authenticate cleanly and ingest nothing — the exact silent failure the go-live procedure exists to catch. With one token, ask for the union above. With two, each list above is enough.

Issue this one fine-grained even if you issue nothing else fine-grained. A classic token cannot read a private repository without the repo scope, and repo also grants write — push, merge, branch deletion — so the live MCP would be holding a credential that can change your source code in order to read a pull request, with a single setting inside the image (GITHUB_READ_ONLY=1, baked in) as the only thing between the two. A fine-grained token has no write to withhold.

1. One resource owner per token. A fine-grained token reaches resources owned by a single user or organisation — that is the design, not a setting. ingest.github.orgs is a comma list and the ingest reads one credential for all of it, so an install measuring two organisations cannot be done with one fine-grained token. A classic PAT on an account that can see both, or one Prism per organisation, are the two ways out. Decide it before minting rather than relying on the pre-flight: what step 3 reports for the second organisation depends on how visible it is to a token that does not own it — org_not_visible where it is private, org_visible_but_no_prs_found where the organisation page is readable but its pull requests are not, and nothing at all where it has public repositories, because their pull requests are found and the check goes green on a fraction of the org.

2. "All repositories", not "Only select repositories". This is the nastier one, because it does not fail. A token scoped to a subset of repositories walks successfully and ingests that subset; the pre-flight passes, the self test is green, and every org-wide figure is a subtotal wearing the label org-wide (every repo in the index). Nothing anywhere names the repositories that were never fetched. If your organisation insists on an allowlist it has to list every repository you intend the figures to cover — and somebody has to remember it when a new one is created.

3. Three repository permissions — six with the live MCP — and nothing at organisation level. Pull requests: Read is the core grant — the PR list, the sizes, and the review timestamps behind time-to-first-review. Issues: Read is the second and it is not optional: Prism ingests issues as well as pull requests, and search returns only what the token can see. GitHub does not document which grant surfaces a private issue in search, so treat this as the one to prove rather than assume — run the third curl in Verify a credential by hand a second time with type:issue in place of type:pr, and expect a count from both. Metadata: Read is GitHub's mandatory baseline, selected for you as soon as you pick any other repository permission. No organisation permission is needed, which is worth saying because it is the natural thing to reach for: the one organisation-scoped call the ingest and the pre-flight make is GET /orgs/<org>, and GitHub documents that endpoint as requiring no fine-grained permission at all. A 404 there is a question about approval or visibility — note 4 — and no organisation grant will fix it.

4. Organisation policy, and an owner's approval. Two switches sit above the token and neither is yours: the organisation has to permit fine-grained tokens at all (it can block them, and on GitHub Enterprise Server an enterprise-level policy sits above that), and where the organisation requires approval an owner has to approve this specific token. An unapproved token is not a rejected one — it authenticates, and keeps the read-only access to public resources that every fine-grained token carries. What that looks like depends on your organisation, and neither shape is good:

  • All repositories private, which is most Enterprise Server installs. The token sees nothing, and the pre-flight says org_not_visible or org_visible_but_no_prs_found — exactly what a firewall or a repo-scope problem says. Check the organisation's personal access token settings before you go to the network team; it is much the cheaper of the two to check.
  • Some repositories public. Worse, because it goes green: the token can see those, the search finds their PRs, the pre-flight passes, and you flip a source that will mirror the public half of your organisation and label it org-wide. That is note 2 again, reached by a different route.

GraphQL is a second hop, and the pre-flight does not gate on it. The ingest makes a GraphQL call per day bucket for PR sizes, reviews and issue-to-PR links — a different endpoint from the REST search, which is why verifying by hand asserts it separately in step 4. Step 3 of the go-live procedure records that hop and then decides without it, so a credential that passes the REST assertions and cannot reach /graphql is still reported ready to flip. Run step 4 of Verify a credential by hand with the token you are about to install, not with your own. Token type is not the usual reason it fails — fine-grained tokens could not call GraphQL when they launched, but GitHub added that in April 2023 and Enterprise Server did not offer fine-grained tokens until after it, so on any instance that can mint one the answer is an instance or proxy blocking /graphql, not the token. A source flipped on without that hop still ingests — the run leaves those columns null on the days it could not enrich, writes down which days those were, and finishes. Verify a credential by hand says how to read that back.

Expiry. A fine-grained token's lifetime is chosen when it is minted. GitHub allows a non-expiring one, but your organisation or enterprise can forbid that and can cap the maximum well under a year — so find out which you have been given rather than assuming. If it expires, record the date and name the person who owns the rotation at go-live, while somebody is thinking about it: the scheduled probe does report an expired credential, but it reports it on the day it stops working, and a token nobody owns is a token nobody renews. Rotate a credential is that job.