Repository navigation
fix: align Claude enclave tool approvals with output contract - #11240
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
On the legacy gVisor runner, the new approvals let caller-directed tasks overwrite the session transcript and expose private data through audit artifacts outside result-schema and disclosure limits.
2 open issues
What changed in this PR
This PR aligns AWF’s Claude enclave tool approvals with shell diagnostics and the required /awf/out contract, while expanding bounded diagnostic evidence.
Changes:
- Sets an AWF-owned policy permitting shell and file operations.
- Adds finite tool classifications and preserves denial, error, and result milestones beyond event limits.
- Updates production-policy fixtures, failure coverage, and architecture documentation.
| File | Description |
|---|---|
src/enclave/claude-unattended.test.ts |
Updates opt-in pinned-CLI fixtures for production approvals and output failures. |
src/enclave/agent-provider-environment.test.ts |
Checks fixed approvals despite inherited or caller-supplied settings. |
src/enclave/agent-entrypoint-diagnostics.test.ts |
Covers tool classifications, empty output, and capture saturation. |
scripts/ci/collect-enclave-smoke-debug.test.ts |
Tests diagnostic retention and validation after event saturation. |
scripts/ci/collect-enclave-smoke-debug.cjs |
Accepts and validates the new diagnostic fields. |
docs/enclaves-architecture.md |
Documents finite classifications and retention guarantees. |
containers/enclave/agent-executor/session-diagnostics.js |
Preserves denial classes, tool errors, and final results. |
containers/enclave/agent-executor/agent-provider-environment.js |
Sets fixed unattended Claude shell/file approvals. |
containers/enclave/agent-entrypoint.py |
Classifies tools and correlates requests with completion errors. |
Review effort: Max (auto)
| AWF_ENCLAVE_AGENT_CLAUDE_ALLOWED_TOOLS: 'Read,Glob,Grep', | ||
| // Fixed AWF policy: shell diagnostics and /awf/out writes remain inside the outer sandbox. | ||
| AWF_ENCLAVE_AGENT_CLAUDE_PERMISSION_PROMPTS: 'none', | ||
| AWF_ENCLAVE_AGENT_CLAUDE_ALLOWED_TOOLS: 'Bash,Read,Write,Edit,Glob,Grep', |
| ])); | ||
| }); | ||
|
|
||
| pinnedTest.each([ |
|
@copilot address all review feedback |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 999b29f |
|
✅ Build Test Suite completed successfully!
|
|
🔑 Smoke Copilot BYOK AOAI (api-key) is testing Azure OpenAI BYOK (api-key) mode on this pull request... |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "clients2.google.com"See Network Configuration for more information.
|
|
✅ Smoke Claude passed
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.
|
Chroot Version Comparison
Result: Not all tests passed (Node.js version mismatch), so the
|
Fixed and pushed as e18d90c. The full root suite passes (12,415 tests) and the affected suites pass (498 tests). Python CodeQL reports no alerts; JavaScript analysis was skipped because the database exceeded tool limits. |
| AWF_ENCLAVE_AGENT_CLAUDE_ALLOWED_TOOLS: 'Read,Glob,Grep', | ||
| // Fixed AWF policy: shell diagnostics and /awf/out writes remain inside the outer sandbox. | ||
| AWF_ENCLAVE_AGENT_CLAUDE_PERMISSION_PROMPTS: 'none', | ||
| AWF_ENCLAVE_AGENT_CLAUDE_ALLOWED_TOOLS: 'Bash,Read,Write,Edit,Glob,Grep', |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@copilot merge main and resolve conflicts then address all remaining review feedback |
…e-enclave-permission-denial # Conflicts: # containers/enclave/agent-executor/session-diagnostics.js # scripts/ci/collect-enclave-smoke-debug.cjs
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Merged |
Track transcript close errors explicitly and stage the pinned native Claude executable outside private runner installation paths before dropping the engine identity. Cover symlink resolution, byte preservation, and executable mode in a portable regression test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.78% | 93.77% | 📉 -0.01% |
| Statements | 92.32% | 92.31% | ➡️ -0.01% |
| Functions | 93.02% | 93.02% | ➡️ +0.00% |
| Branches | 86.61% | 86.58% | 📉 -0.03% |
📁 Per-file Coverage Changes (3 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/enclave/invocation-staging.ts |
100.0% → 97.1% (-2.86%) | 100.0% → 97.3% (-2.71%) |
src/commands/main-action.ts |
92.0% → 91.7% (-0.25%) | 91.7% → 91.4% (-0.24%) |
src/enclave/docker-host-executor.ts |
95.2% → 95.0% (-0.21%) | 89.7% → 89.5% (-0.16%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Use one descriptor for staged executable checks and reads. Keep ownership operations separate from the generic resource-returning I/O wrapper, preserving redacted errors and exception propagation. Restore the explicitly selected fixed sandboxed Claude tool policy after autofix removed required shell and output tools. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…losed' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Route diagnostic fixture faults through the actual path.open boundary. Preserve exact open/close failure classification without relabeling already-reported read/write failures, while retaining direct context-managed file lifetime for CodeQL. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.78% | 93.77% | 📉 -0.01% |
| Statements | 92.32% | 92.31% | ➡️ -0.01% |
| Functions | 93.02% | 93.02% | ➡️ +0.00% |
| Branches | 86.61% | 86.58% | 📉 -0.03% |
📁 Per-file Coverage Changes (4 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/enclave/invocation-staging.ts |
100.0% → 97.1% (-2.86%) | 100.0% → 97.3% (-2.71%) |
src/commands/main-action.ts |
92.0% → 91.7% (-0.25%) | 91.7% → 91.4% (-0.24%) |
src/enclave/docker-host-executor.ts |
95.2% → 95.0% (-0.21%) | 89.7% → 89.5% (-0.16%) |
src/enclave/host-executor-server.ts |
91.2% → 91.2% (+0.00%) | 90.1% → 89.8% (-0.29%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts


Claude could exit successfully while tool refusal left required
/awf/outempty. Production approved only read tools; the successful pinned fixture substituted shell/write approvals instead of exercising production policy.AWF-owned policy
Bounded diagnostics
Production-path coverage
result-empty(33).