Repository navigation
Use effective runner identity and owner-only configs for safeoutputs - #75443
Conversation
…ed configs Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
✅ PR Specification Reviewer completed successfully!
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully!
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
There was a problem hiding this comment.
Reviewed head 439627a916214ad8e3a80c2fb8eaf4f320a0b9f4 against base 565bf516865c76a0c744dcac4815abf59014d245. Applicable contracts: docs/src/content/docs/specs/safe-outputs-specification.md v1.29.18, Asset Staging Ownership and Transport; specs/compiler-threat-detection-spec.md v1.0.97, §7.9 and v1.29.15 mapping; and the MCP gateway reference.
Blocking contract synchronization gap: the intentional behavior now applies identity to both built-in backends and adds owner-only generated safeoutputs files, but the formal specifications still describe only the safeoutputs backend identity and do not state the generated-file guarantees. The inline comment proposes focused v1.29.19 / next-unreleased updates while preserving existing 0600/0700, anti-link, and other-backend obligations.
Coverage limit: the added opt-in mcpg regression does not establish the existing MUST-level Linux conformance requirement for a separate host-uploader process reading 0600 staged files and traversing 0700 Claim directories; that evidence remains outstanding. No tests or conformance scripts were run per static-review instructions.
Generated by PR Specification Reviewer for #75443 · copilot · gpt50 · ~5 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review-specs to run again
There was a problem hiding this comment.
What this change does: It makes the built-in backend containers use the runner effective UID/GID and routes generated safeoutputs files through the existing owner-only writer. It adds filesystem, identity, engine-format, and opt-in mcpg coverage, then documents the behavior.
Should fix:
-
Remove the duplicate effective-identity test (
actions/setup/js/start_mcp_gateway.test.cjs:L357-369)- What this is: This VM test checks the default effective UID/GID lookup.
- Problem: The later per-engine test already runs
main()with mockedgeteuid()/getegid()and asserts--user 2001:31for every engine, so this block adds no coverage and runs twice under the surrounding backend parameterization. - Fix: Delete this
itblock and keep the engine-path test as the default-identity regression. - If we skip it: Two extra module evaluations and 14 lines must be maintained without catching a failure the later test misses.
Verdict: fix 1 first.
Lean: -14 lines possible.
Generated by ✂️ Ponytail Reviewer for #75443 · codex · routed: gpt56 max · ~5 AIC · ⌖ ~1 AIC · ⊞ 118
Comment /ponytail to run again
There was a problem hiding this comment.
Review summary
No actionable correctness, security, or performance issues found in the changed lines. The owner-only file writes use no-follow descriptors, and the backend identity propagation is covered by targeted tests.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd, /diagnosing-bugs, and /codebase-design. Requesting changes on the lock-file drift and a test that does not exercise its claim.
📋 Key Themes & Highlights
Key Themes
- Lock-file drift: the
docker/login-action@v4.8.0pin is removed from.github/aw/actions-lock.json, but both syncedaction_pins.jsoncopies still have it. - Vacuous engine matrix: the five
GH_AW_ENGINEcases never reach engine conversion, becausewriteMcpConfigurationthrows beforedetectEngineTyperuns. - CI coverage gap: the core UID/GID test is skipped unless
GH_AW_TEST_MCP_DOCKER=1, and nothing at the PR head sets it. - Docs overclaim: the
0600sentence does not cover the early comment-memoryprintf >config write.
Positive Highlights
- ✅
writeFileusesO_NOFOLLOW,0o600on open, andfchmodSync, which closes the existing-file permission gap. - ✅ The effective-vs-real identity test and the GID 31 coverage are good regression checks.
- ✅ The symlink-rejection test in
generate_safe_outputs_tools.test.cjscovers an important path.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
|
@copilot address review feedback |
There was a problem hiding this comment.
🟡 Changes recommended
The opt-in regression depends on the v0.5.4 pin, so pruning it during a gateway upgrade breaks image lookup instead of testing the supported gateway.
2 open issues
What changed in this PR
Updates gh-aw’s built-in MCP launcher to use the runner’s effective identity and enforce owner-only safeoutputs files on self-hosted runners.
Changes:
- Use effective numeric UID/GID while preserving explicit backend identity settings.
- Apply the secure file writer to generated tools, metadata, and validation files.
- Add identity and permissions coverage, including an opt-in Docker regression, and clarify gateway versus backend behavior.
| File | Description |
|---|---|
docs/src/content/docs/reference/mcp-gateway.md |
Documents identity, permissions, and the historical gateway/backend distinction. |
actions/setup/js/start_mcp_gateway.test.cjs |
Adds effective-identity, low-GID, and Docker ownership coverage. |
actions/setup/js/start_mcp_gateway.cjs |
Defaults built-in backends to effective UID/GID. |
actions/setup/js/generate_safe_outputs_tools.test.cjs |
Checks restrictive permissions and symlink rejection. |
actions/setup/js/generate_safe_outputs_tools.cjs |
Uses the secure writer for generated JSON files. |
.github/aw/actions-lock.json |
Removes the docker/login-action@v4.8.0 pin. |
Review effort: Max (auto)
| const name = path.basename(directory); | ||
| const pins = JSON.parse(fs.readFileSync(new URL("../../../.github/aw/actions-lock.json", import.meta.url), "utf8")).containers; | ||
| const nodeImage = pins["ghcr.io/github/gh-aw-node"].pinned_image; | ||
| const gatewayImage = pins["ghcr.io/github/gh-aw-mcpg:v0.5.4"].pinned_image; |
| The gh-aw launcher defaults the built-in `agenticworkflows` and `safeoutputs` backend containers to the runner's UID and GID, with a container-local writable `HOME` at `/tmp`. This keeps private logs and staged assets readable by host redaction and artifact-upload steps without relaxing file permissions. Explicit container-user settings and configured `HOME` values are preserved; other MCP servers are unchanged. | ||
| The gh-aw launcher defaults the built-in `agenticworkflows` and `safeoutputs` backend containers to the runner's effective numeric UID and primary GID, including nonzero GIDs below 1000, with a container-local writable `HOME` at `/tmp`. Identity is applied to the backend arguments sent to mcpg, independently of the parent gateway container, across engine configuration formats. This keeps owner-only (`0600`) config files readable and outputs runner-owned without relaxing file permissions. Generated safeoutputs config, tools, tools metadata, and validation files use `0600`, including when replacing existing files. Explicit container-user settings, configured `HOME` values, and `--group-add` arguments are preserved; supplementary runner groups are not automatically granted to backends. The gateway separately receives the Docker socket group needed to launch child containers; other MCP servers are unchanged. | ||
|
|
||
| The v1.0.1 compiler already emitted `--user ${MCP_GATEWAY_UID}:${MCP_GATEWAY_GID}` for the parent gateway, but not for the safeoutputs backend. A report of a missing gateway user flag therefore needs the unmodified generated command and compiler metadata to reconcile it. Missing a backend user flag alone does not establish why container root could not read a runner-owned `0600` file on a particular self-hosted runner; host permissions and Docker user mappings still need separate evidence. |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Updated the regression to derive the mcpg lock entry from |
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 383a8a0
|
Sous-chef requested-head: 383a8a0 |
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
Verified the Actions-bot feedback against current head Review summaries:
Published-head impacted-JS CI passed 302 tests with one opt-in Docker test skipped; all reported checks are successful or skipped. A local focused rerun could not start because this checkout lacks Vitest, so the validation evidence above is from existing CI, not a claimed local run. The outstanding CHANGES_REQUESTED reviews still require reviewer clearance; resolving threads does not dismiss or replace those reviews. No workflow was dispatched, review dismissed, or merge performed. |
|
@copilot merge main and resolve conflicts |
…un-safeoutputs-mcp # Conflicts: # docs/src/content/docs/specs/safe-outputs-specification.md Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Merged and published |
|
🎉 This pull request is included in a new release. Release: |


Safeoutputs child containers need runner identity to access owner-only files on self-hosted runners; the parent gateway’s Docker user is not inherited.
31. Preserve explicit users,HOME, and configured supplementary groups.0600for tools, tools metadata, and validation files—including existing files.31, private input reads, and output ownership without sudo.