Fix cache-memory writes under Cloud Hypervisor sandboxing - #55427
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch PR file list
|
|
/smoke-copilot |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #55427 does not have the 'implementation' label and has 67 new lines of code in business logic directories (threshold: 100).
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
❌ Ponytail Reviewer failed. Please review the logs for details. Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
Pull request overview
Fixes cache-memory writes in Cloud Hypervisor sandboxes by aligning generated filesystem and engine permissions.
Changes:
- Adds cache-memory directories to
filesystem.allowWritewith tests. - Narrows Claude write permissions under Cloud Hypervisor.
- Upgrades gh-aw-firewall to v0.28.7 and regenerates pins/workflows.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/sandbox.go |
Adds cache paths to sandbox write policy. |
pkg/workflow/sandbox_test.go |
Tests cache path policy generation. |
pkg/workflow/compiler_orchestrator_workflow.go |
Applies cache write paths during compilation. |
pkg/workflow/cloud_hypervisor_test.go |
Tests generated policy and startup ordering. |
pkg/workflow/claude_tools.go |
Aligns Claude permissions with sandbox paths. |
pkg/workflow/claude_engine_tools_test.go |
Tests narrowed Claude permissions. |
pkg/constants/version_constants.go |
Bumps default firewall to v0.28.7. |
pkg/workflow/data/action_pins.json |
Adds v0.28.7 image digests. |
pkg/actionpins/data/action_pins.json |
Adds matching action-pin data. |
.github/aw/actions-lock.json |
Records v0.28.7 container pins. |
.github/workflows/smoke-ci.lock.yml |
Regenerates workflow with v0.28.7. |
.github/workflows/notion-issue-summary.lock.yml |
Regenerates workflow with v0.28.7. |
.github/workflows/hippo-embed.lock.yml |
Regenerates workflow with v0.28.7. |
.github/workflows/firewall.lock.yml |
Regenerates workflow with v0.28.7. |
.github/workflows/example-permissions-warning.lock.yml |
Regenerates workflow with v0.28.7. |
.github/workflows/daily-arxiv-researcher.lock.yml |
Regenerates workflow with v0.28.7. |
.github/workflows/codex-github-remote-mcp-test.lock.yml |
Regenerates workflow with v0.28.7. |
.changeset/patch-cache-memory-sandbox-write-access.md |
Documents the patch release. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 20/303 changed files
- Comments generated: 0
- Review effort level: Balanced
|
🧪 Agentic Commands has started processing this issue comment |
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Verdict
Non-blocking: I don't see a changed-line correctness regression worth blocking here.
The patch does the right thing in the places that matter
- Cache-memory paths are now derived from the canonical helper before being threaded into Cloud Hypervisor
filesystem.allowWrite, which closes the sandbox/engine permission mismatch the PR is fixing. - The compiler path that extracts cache-memory config updates sandbox write permissions before workflow rendering, and the regression tests cover both ordering and the generated
allowWritepayload. - The default firewall bump to
v0.28.7matches the existing version gates and embedded image pins already present in-tree.
I checked for restore-only cache handling, startup ordering, and accidental broadening of Claude /tmp access under non-Cloud-Hypervisor runtimes, and none of those looked newly broken in the changed surface.
🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 33.6 AIC · ⌖ 6.77 AIC · ⊞ 7K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd — well-structured bug fix with solid test coverage. The PR has already merged; leaving observations for follow-up if needed.
📋 Key Themes & Findings
Positive Highlights
- ✅ Root cause correctly addressed:
cacheMemoryDirFornow used as the canonical source for both engine tool grants and sandboxallowWrite, eliminating the divergence that causedEROFS. - ✅
ensureCacheMemoryWritePathsis idempotent — the double-call inTestEnsureCacheMemoryWritePathsexplicitly guards against duplicate path insertions. - ✅ Startup ordering validated:
TestCloudHypervisorCacheMemoryAllowWriteassertscreateDirIdx < awfIdx, which is the right regression guard per/diagnosing-bugs. - ✅ New
TestClaudeEngineSandboxAllowWriteNarrowsDefaultTmpAccessdirectly covers the/tmpnarrowing behaviour.
Observations (non-blocking, for follow-up)
1. [/tdd] TestClaudeEngineComputeAllowedToolsWithSandboxAllowWrite now covers a different code path
Adding Runtime: AgentRuntimeCloudHypervisor to the existing test silently flipped it from testing the append path (writablePaths = append(writablePaths, allowWrite...)) to the replace path (writablePaths = allowWrite). The append path for non-CloudHypervisor runtimes no longer has dedicated coverage. Consider splitting into two named sub-cases.
2. [/diagnosing-bugs] Empty allowWrite: [] under Cloud Hypervisor drops all write permissions
In appendSandboxWritableTools, when Runtime == AgentRuntimeCloudHypervisor and allowWrite is non-nil but empty, writablePaths is set to []string{} — Claude receives no write tools. This is a latent footgun if a workflow author explicitly sets filesystem.allowWrite: []. A guard or documentation note would prevent future confusion.
3. [/tdd] Integration test asserts exact JSON array order
TestCloudHypervisorCacheMemoryAllowWrite hard-codes the allowWrite array as a literal substring. If ensureDefaultAgentWritePath or ensureCacheMemoryWritePaths ever reorder insertions, the test will false-negative. Unmarshalling the lock YAML and asserting set membership would be more robust.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 32.7 AIC · ⌖ 9.93 AIC · ⊞ 7.6K
Comment /matt to run again
Cache-memory paths were granted through engine tools but omitted from
filesystem.allowWrite, causing sandboxed writes to fail withEROFS. The default firewall version also lacked the restricted-/tmpstartup fix required for end-to-end operation.Unify write permissions
filesystem.allowWrite.cacheMemoryDirForhelper./tmpaccess only when Cloud Hypervisor enforces the explicit policy.Preserve startup ordering
Upgrade the firewall
v0.28.7.Generated policy now includes cache storage:
{ "filesystem": { "allowWrite": [ "/tmp/gh-aw/agent", "/workspace", "/workspace/.awf-home", "/tmp/gh-aw/cache-memory" ] } }