Skip to content

Keep MCP logs report cache owner-private - #79903

Merged
pelikhan merged 7 commits into
mainfrom
pelikhan/mcp-log-report-privacy
Nov 21, 2026
Merged

pelikhan merged 7 commits into
mainfrom
pelikhan/mcp-log-report-privacy

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

MCP logs reports can contain sensitive workflow data. Store new reports in an owner-only cache so returning a file_path does not make the report readable by other local users.

On Linux and macOS, the cache uses a fresh 0700 directory and exclusively creates 0600 files. Unsafe paths fail closed, and the legacy cache is neither read nor migrated. The report bytes, file_path response field, and both continuation cursor formats are preserved. Reuse verifies the report's SHA-256 digest, and graceful shutdown removes this server's tracked files. Other platforms fail closed. Reviewed #79834; no caller changes are needed.

ADR: ADR-79903: Owner-Private MCP Logs Report Cache

Validation

  • Initial fix: focused Go guardrail and MCP tests, tagged report integration test, Windows build, 370 workflows recompiled, and instruction prefix checks.
  • Review update: focused cursor, macOS file ACL and HTTP tests; Linux and Windows cross-builds; integration suite compiled; gateway suite (230 passed, 2 skipped).
  • Full validation is not green: local sandbox policy blocked macOS ancestor ACL checks, and the broader gate reported Go lint issues.

@pelikhan
pelikhan marked this pull request as ready for review November 21, 2026 22:10
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 22:10
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated by Ponytail Reviewer for #79903 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by PR Specification Reviewer for #79903 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

This comment has been minimized.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed lines and found no actionable correctness, security, performance, or maintainability issues blocking merge. The specialist pass was unavailable because its access to the pre-fetched files was blocked; this conclusion is based on the independent static review. No tests were run per the review instructions.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-0c24a945-f8ce-4368-aa0c-fba2a084a770","parents":[],"payload":{"id":"ldg-b5cf1ccf-b727-4731-81ed-d205b4c14bb6","operation":"append","value":{"finding_count":0,"head_sha":"190ad5e0b8a5bc97d393c777e87e18a635bca607","outcome":"no_findings"}},"sha":"sha256:8424a264bb290e20f6c1cd800ca9776faceff387cdec34b142b9e9378eec462c","timestamp":"2026-11-21T22:16:54.550Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-c547c023-efca-467b-b0ea-5412176f69bf","parents":[],"payload":{"id":"ldg-a3d94f62-0105-4dd3-a9d7-d176bcce5819","operation":"append","value":{"finding_count":0,"head_sha":"190ad5e0b8a5bc97d393c777e87e18a635bca607","outcome":"aligned"}},"sha":"sha256:c86bcbff193861032da6a4cd45e082fd92f1017a36bdd85ff894c933d2eecd71","timestamp":"2026-11-21T22:17:50.362Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (252 new lines in pkg/cli/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/79903-owner-private-mcp-logs-report-cache.md. Review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch. It was generated from the PR diff.

  2. Resolve the 3 [TODO: verify] markers: deciders, the response-size motivation for the file_path design, and Windows support for the logs tool.

  3. Confirm the Alternatives and Consequences reflect the real trade-offs, then change the status from Draft to Accepted when ready.

  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-79903: Owner-Private MCP Logs Report Cache (link unavailable: invalid HTTPS URL)

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say I'll deal with this later. Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context: What is the problem? What forces are at play?
  • Decision: What did you decide? Why?
  • Alternatives Considered: What else could have been done?
  • Consequences: What are the trade-offs (positive and negative)?

ADRs are stored in docs/adr/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 8.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — requesting changes on one integrity gap and one test-coverage regression.

📋 Key Themes & Highlights

Key Themes

  • Integrity check is weaker than the name suggests: the content-addressed dedup trusts file size, not content (inline on mcp_logs_report_cache_unix.go:52).
  • Test coverage regression on Windows: the unix build tag drops pure-logic tests from Windows runs (inline on mcp_logs_guardrail_test.go:1).
  • Lifecycle leak: each server process creates a gh-aw-mcp-logs-* directory that is never removed (inline on mcp_logs_report_cache_unix.go:100).
  • Silent fallback: an explicit --user skips the shared-directory env var (inline on start_mcp_gateway.cjs:1673).

Positive Highlights

  • ✅ Owner-only 0700 directories and 0600 exclusive-create files, with os.OpenRoot and ancestor validation. This closes the shared-/tmp attack surface well.
  • ✅ The shared /tmp/gh-aw mount is valid for the agenticworkflows backend (DefaultTmpGhAwMount), so the file_path handoff works.
  • ✅ The report is not in the agent artifact upload, so the logs do not leak into artifacts.
  • ✅ Tests assert the response does not echo report bytes, and the unsafe-cache case is covered.
  • ✅ The stale logs-cache path has been removed from the code and docs.

The build-tag change is the blocker. The dedup check is a hardening gap rather than an exploitable path, since the directory is 0700 and owned by the process user, but the filename implies a guarantee the code does not enforce. The --user and cleanup items are low-to-medium and can follow up.

Reviewed committed HEAD 190ad5e. Local working-tree edits were not reviewed. go test was not run.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

Comment thread pkg/cli/mcp_logs_report_cache_unix.go Resolved
Comment thread pkg/cli/mcp_logs_report_cache_unix.go Resolved
Comment thread pkg/cli/mcp_logs_guardrail_test.go Resolved
Comment thread actions/setup/js/start_mcp_gateway.cjs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The cache’s mode-only permission checks can leave inherited macOS ACL grants intact, allowing other users to read sensitive reports.

5 open issues
What changed in this PR

This PR hardens the gh aw MCP logs report handoff by replacing the legacy public cache with private storage, while preserving report contents and continuation response fields.

Changes:

  • Adds owner-only Unix cache directories and files, with fail-closed behavior on other platforms.
  • Configures shared report storage for the containerized MCP server.
  • Updates tests, workflow guidance, and generated workflow hashes.
File Description
scratchpad/​layout.md Updates the logs-cache location description.
pkg/​cli/​mcp_logs_report_cache_unix.go Implements private storage, path validation, and content deduplication.
pkg/​cli/​mcp_logs_report_cache_other.go Rejects report storage on non-Unix platforms.
pkg/​cli/​mcp_logs_guardrail.go Delegates report storage to the new cache implementation.
pkg/​cli/​mcp_logs_guardrail_test.go Tests private permissions, unsafe paths, and report access.
pkg/​cli/​mcp_logs_guardrail_integration_test.go Restricts storage integration tests to Unix.
actions/​setup/​js/​start_mcp_gateway.test.cjs Updates report-directory expectations and resolves temporary-path aliases.
actions/​setup/​js/​start_mcp_gateway.cjs Sets the shared report directory for the built-in server.
.github/​workflows/​daily-rendering-scripts-verifier.md Describes the owner-only report handoff.
.github/​workflows/​daily-rendering-scripts-verifier.lock.yml Refreshes hashes for the workflow prompt edit.
.github/​workflows/​daily-cli-tools-tester.md Removes the legacy cache-path assumption.
.github/​workflows/​daily-cli-tools-tester.lock.yml Refreshes hashes for the workflow prompt edit.
.github/​workflows/​ci-front-door-researcher.md Removes legacy cache enumeration guidance.
.github/​workflows/​ci-front-door-researcher.lock.yml Refreshes hashes for the workflow prompt edit.
.github/​aw/​agentic-workflows-mcp.md Documents private storage and same-user shared-mount access.

Review effort: Max (adaptive)

Comment thread pkg/cli/mcp_logs_report_cache_unix.go Resolved
Comment thread actions/setup/js/start_mcp_gateway.cjs Resolved
Comment thread pkg/cli/mcp_logs_report_cache_unix.go Resolved
Comment thread pkg/cli/mcp_logs_report_cache_unix.go Resolved
Comment thread pkg/cli/mcp_logs_report_cache_unix.go Resolved
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

No changes were needed for this status update.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

This status update does not require a change. I did not act on the flagged review output.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

The actionable findings from this review are addressed in the inline threads.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

The cache and gateway changes are in 105745c. Each actionable finding has a reply in its inline thread.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

The collection-state and cursor tests are now separate from the platform-specific cache tests, and the gateway suite covers explicit container users.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

I updated the generated ADR-79903 to match the implementation and linked it in the PR description.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

No changes are needed for this review history update.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

No changes are needed for this specification review history update.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Re: #79903 (comment)

The PR description now links to ADR-79903. It documents the storage policy, agent access requirements, and cleanup limits.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/cli/mcp_logs_report_cache_unix.go:52): address unresolved feedback - Review comment
  3. Review (pkg/cli/mcp_logs_report_cache_unix.go:100): address unresolved feedback - Review comment
  4. Review (pkg/cli/mcp_logs_guardrail_test.go:1): address unresolved feedback - Review comment
  5. Review (actions/setup/js/start_mcp_gateway.cjs:1673): address unresolved feedback - Review comment
  6. Review (pkg/cli/mcp_logs_report_cache_unix.go:139): address unresolved feedback - Review comment
  7. Review (actions/setup/js/start_mcp_gateway.cjs:1673): address unresolved feedback - Review comment
  8. Review (pkg/cli/mcp_logs_report_cache_unix.go:75): address unresolved feedback - Review comment
  9. Review (pkg/cli/mcp_logs_report_cache_unix.go:100): address unresolved feedback - Review comment
  10. Review (pkg/cli/mcp_logs_report_cache_unix.go:133): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "031ce6b8f32541c2a6c94584e420972698610e34",
  "kind": "requested",
  "schema_version": "1",
  "state": "2018c470b31982a194f1e304762460003762d8e33a4285e3a61e907f97c5a8af",
  "work": [
    "27dd8478a1c69cae601141344543346c9946bb02bd6919b7ff03d30f98773933",
    "28dacefb25b794401514bcedee586d6fab0a9508a13897e3a19a82ec10fcee31",
    "41e6665f2a9a011115fd4b5a0c335b301b776c810a4602020417e728ad129d5d",
    "524620784e7a28f8c5d3d43da72d32787f39acc13079f0fbb265f3223bd598d9",
    "a6a8b4aa70a46361a7bdde7e418962af3cd995a81a3cb62a21b6242b925e97bb",
    "aff03a2ae5ceb5672c993089dbaa79477e64c57d108bfca66f71194b39cb8a63",
    "bc21c911b66dcf22baf422c11c9627d75259880dd3f8f8f9103f881f7b9012a9",
    "e94e68a693c90454af4ac14c22988d473cf6345edb09521e8bc0ca272f1312aa",
    "f6ff60ea9a6185604f378fed6afbb17bc22f2e10b16338f1d2adcaa7d3cc5b70"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

@pelikhan
pelikhan merged commit cdfe002 into main Nov 21, 2026
86 checks passed
@pelikhan
pelikhan deleted the pelikhan/mcp-log-report-privacy branch November 21, 2026 23:09

Copilot AI commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

The requested cache and gateway fixes are already present in branch commit ed118cf (including digest/ACL checks, lifecycle cleanup, portable tests, and explicit-user shared-path handling). make merge-main completed locally and compiled 370/370 workflows. The PR was merged as cdfe002c while I was working, so I made no post-merge branch update or CI dispatch. Focused test reruns were blocked by the sandbox Go cache path and npm registry DNS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants