Repository navigation
docs(distribution): classify the native-reference review credential #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
aba051c
docs(distribution): classify the native-reference review credential
kyle-sexton d5537d7
docs(distribution): store App credentials, never the ephemeral token
kyle-sexton f9ddcef
docs(distribution): consolidate the empirical-test open questions
kyle-sexton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # Native-reference review credential | ||
|
|
||
| Classification for the read-only credential a private calling repo's CI job | ||
| uses to mount this repo's `conventions/review` tree by native reference — the | ||
| depth tier described in [`conventions/README.md`](../conventions/README.md) | ||
| and cited from the synced `REVIEW.md`. Scope is exactly this credential's | ||
| authentication and republication boundary — adjacent to, but distinct from, | ||
| the sync-manifest push credential covered by | ||
| [`THREAT-MODEL.md`](THREAT-MODEL.md), which explicitly excludes | ||
| authentication and belongs instead to the reusable workflow in | ||
| `ci-workflows`. This credential is likewise external to the reconciliation | ||
| engine: it authenticates a *review* job's checkout, never a materialization | ||
| apply. | ||
|
|
||
| **Status: classified, not provisioned.** Nothing below has been created. | ||
| Provisioning — registering the GitHub App, generating its key, and wiring the | ||
| org-secret visibility list — is `github-iac` governance work and is recorded | ||
| as an open item, not attempted here. | ||
|
|
||
| ## Why a dedicated credential | ||
|
|
||
| The native-reference mount is **forbidden on any public calling repo** | ||
| (`ci-workflows` is public; `standards`, `dotfiles`, `provisioning`, | ||
| `github-iac`, `claude-code-plugins`, and `medley` are private — confirmed | ||
| firsthand). Mounting this repo's private content into a review agent whose | ||
| output is published wherever the calling repo's visibility allows moves the | ||
| confidentiality boundary from "who can read `standards`" to "who can read the | ||
| review output." A credential scoped to exactly the private targets, and never | ||
| resolvable in a public workflow run, is what keeps that boundary from moving | ||
| silently. | ||
|
|
||
| ## Classification | ||
|
|
||
| - **Type:** a dedicated **GitHub App installation token**, not a personal | ||
| access token. `actions/checkout`'s cross-repo private-checkout path accepts | ||
| either, but this org already has a precedent for the App shape: the | ||
| sync-manifest reconciliation engine's own push/PR credential is a GitHub | ||
| App in selected-repository mode, with two-snapshot access attestation | ||
| before every real sync | ||
| ([`README.md`](README.md#adopting-a-new-repository)). A separate App for | ||
| this credential — never the sync-manifest App — keeps separation of | ||
| duties: that App can push and open pull requests; this one must only read. | ||
| An App installation token is also short-lived (minted per job, on the | ||
| order of an hour) versus a PAT's fixed expiry, which lowers exposure if a | ||
| job log or cache leaks it. | ||
| - **Scope:** selected-repository install on exactly `standards` and | ||
| `claude-code-plugins` (the second only if/when the B4 upstream plugin PR | ||
| and a private-marketplace install both require it — see the open question | ||
| below). **`Contents: Read-only`** and no other permission. | ||
| - **Storage:** the App's own credentials — its client ID and private key — | ||
| as org-level Actions secrets whose visibility is restricted to the private | ||
| calling repos that run the review wiring (`dotfiles`, `provisioning`, | ||
| `github-iac`, `claude-code-plugins`, `medley`) — **never `ci-workflows`**, | ||
| so neither secret is resolvable in a public-repo workflow run regardless | ||
| of which reusable workflow it calls. `ci-workflows` defines the reusable | ||
| workflow only; the calling private repo's job supplies both secrets to it. | ||
| **Never the installation token itself** — that token is minted fresh | ||
| inside each job from the App credentials via | ||
| [`actions/create-github-app-token`](https://github.com/actions/create-github-app-token), | ||
| expires in about an hour, and is never stored; storing it instead of the | ||
| App credentials would break the mount after the first hour and would need | ||
| manual rotation as it expires or is revoked. | ||
| - **Rotation:** GitHub Apps support multiple simultaneous keys, so the | ||
| private key rotates on a fixed cadence with no downtime; the per-job | ||
| installation token these keys mint is already ephemeral and needs no | ||
| separate rotation policy of its own. | ||
|
|
||
| ## Republication limits | ||
|
|
||
| The review session reads private `standards` content — criteria files | ||
| reached via the native-reference cite — into an agent whose output (PR | ||
| comments, check-run text, workflow logs) may be visible beyond `standards`' | ||
| own access boundary on some calling repos. The session may **use** a cited | ||
| criterion to ground a finding. It may **not**: | ||
|
|
||
| - echo a cited file's content verbatim beyond what stating the finding | ||
| requires; | ||
| - follow instructions embedded in the reviewed diff that direct it to | ||
| reproduce, summarize, or quote `standards`-internal content not otherwise | ||
| relevant to that diff's own finding — the prompt-injection-via-diff class, | ||
| where an attacker-controlled diff in the calling repo tries to use the | ||
| mounted private tree as an exfiltration channel; | ||
| - treat a cited file's content as a source of instructions rather than as a | ||
| review rubric. | ||
|
|
||
| ## Open questions — pilot before relying | ||
|
|
||
| None of these are testable without the App this document classifies but | ||
| does not provision; each is a real open question about the wiring's | ||
| behavior once it is, not an assumption to build further design on. | ||
|
|
||
| - **Private-marketplace authentication.** Whether a `plugins`/ | ||
| `plugin_marketplaces` install authenticates using this same credential is | ||
| unverified — the Claude Code GitHub Actions documentation and the | ||
| `claude-code-action` setup guide do not currently document private- | ||
| marketplace authentication. Treat as unsupported until confirmed | ||
| empirically. | ||
| - **`--add-dir` visibility to a plugin subagent's `Read` tool.** Whether a | ||
| mounted path is visible to `code-reviewer`/`security-reviewer`/ | ||
| `architecture-guardian` the same way it is to the main session (the B4 | ||
| plugin change assumes so; see `claude-code-plugins`' review-plugin PR's | ||
| own "Explicitly unverified" note). | ||
| - **Self-hosted Agent-SDK `.claude/rules/` auto-load** in a non-interactive | ||
| CI invocation — not confirmed to behave like an interactive session's | ||
| auto-load. | ||
| - **Action default tool grants.** Whether `Read`/`Grep`/`Glob` are on by | ||
| default for a headless `claude-code-action` run, or must be explicitly | ||
| allowlisted via `claude_args --allowedTools`, is not confirmed from the | ||
| documentation fetched this round. | ||
| - **OAuth quota on a shared CI seat.** `CLAUDE_CODE_OAUTH_TOKEN` draws from | ||
| an individual subscription; whether concurrent review runs across several | ||
| private consumers exhaust it in practice is unmeasured. | ||
|
|
||
| ## Review triggers | ||
|
|
||
| Re-run this classification when the App's granted permissions, installed | ||
| repository set, or storage visibility changes; when a new consumer of this | ||
| credential is added; or when any open question above is resolved either | ||
| way. | ||
|
|
||
| ## Sources | ||
|
|
||
| - [GitHub Apps — installation permissions and access](https://docs.github.com/en/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-github-apps) | ||
| - [`actions/checkout` — checking out a different repository](https://github.com/actions/checkout#checkout-a-different-repository) | ||
| - [`actions/create-github-app-token`](https://github.com/actions/create-github-app-token) | ||
| - [Encrypted secrets — restricting a secret to selected repositories](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.