Grant Claude default /tmp read/write permissions in sandboxed workflows#31357
Grant Claude default /tmp read/write permissions in sandboxed workflows#31357
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot enable write to /tmp/ by default for all workflows using Claude |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in |
|
@copilot recompile, ensure lock files have the fix |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Recompiled with current HEAD and verified lock files are up to date—no lock-file diffs were produced. The |
There was a problem hiding this comment.
Pull request overview
Updates Claude’s computed --allowed-tools allowlist to include path-scoped file tool permissions for sandbox writable paths (including /tmp by default), and regenerates affected workflow lockfiles accordingly.
Changes:
- Extend
computeAllowedClaudeToolsStringto acceptSandboxConfigand append path-scopedRead/Write/Edit/MultiEdittool patterns for sandboxfilesystem.allowWrite(always including/tmp). - Wire the new parameter through Claude engine call sites and update unit/integration tests.
- Regenerate compiled workflow lockfiles to reflect the updated Claude
--allowed-toolsoutput (including proper shell quoting where*patterns are present).
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/claude_tools.go | Add sandbox-aware path-scoped allowed-tools generation (default /tmp) and extend function signature. |
| pkg/workflow/claude_engine.go | Pass workflowData.SandboxConfig into allowed-tools computation. |
| pkg/workflow/claude_engine_tools_test.go | Add coverage for /tmp being included by default / via filesystem.allowWrite. |
| pkg/workflow/git_commands_test.go | Update helper calls for new allowed-tools function signature. |
| pkg/workflow/git_commands_integration_test.go | Update helper calls for new allowed-tools function signature. |
| pkg/workflow/neutral_tools_simple_test.go | Update helper calls for new allowed-tools function signature. |
| pkg/workflow/bash_defaults_consistency_test.go | Update helper calls for new allowed-tools function signature. |
| .github/workflows/smoke-claude.md | Add sandbox filesystem allowWrite configuration (includes /tmp). |
| .github/workflows/test-create-pr-error-handling.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/smoke-agent-scoped-approved.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/smoke-agent-public-none.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/smoke-agent-public-approved.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/smoke-agent-all-none.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/smoke-agent-all-merged.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/lockfile-stats.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/hourly-ci-cleaner.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/go-pattern-detector.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/github-mcp-tools-report.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/example-workflow-analyzer.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/daily-team-evolution-insights.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/daily-safe-outputs-conformance.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/daily-otel-instrumentation-advisor.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/daily-grafana-otel-instrumentation-advisor.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/daily-choice-test.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/copilot-agent-analysis.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/commit-changes-analyzer.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
| .github/workflows/aw-failure-investigator.lock.yml | Regenerate lockfile to include /tmp path-scoped file tool patterns in Claude allowlist. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 68/68 changed files
- Comments generated: 2
| // Grant path-scoped file tool access for sandbox writable paths. | ||
| // Claude workflows should always be able to use /tmp even when not explicitly | ||
| // listed in sandbox.agent.config.filesystem.allowWrite. | ||
| if sandboxConfig != nil { | ||
| writablePaths := []string{defaultClaudeTmpWritePath} |
| // Claude path-scoped tool permissions must be absolute. | ||
| if !strings.HasPrefix(path, "/") { | ||
| continue | ||
| } |
/tmpdefault permissions