fix(eval): trial log dirs are world-writable - #67
Conversation
Native-eval start chmod'd agent, verifier, and artifact log dirs to 0o777, so another user on the same host could plant or rewrite trial logs. Create those dirs as 0o755 instead. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 23, 2026, 12:58 PM ET / 16:58 UTC. ClawSweeper reviewWhat this changesThis PR changes native-evaluation trial directories from mode 0777 to 0755 and adds a regression test for those modes. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 7 items remain Keep open: the previously reported P1 remains. The tightened host-owned directories prevent the image-declared non-root user from writing required native-evaluation logs. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherNative evaluation creates host-side trial folders and bind-mounts them into task containers for harness logs, verifier results, and artifacts. Harness commands run inside the task image and must be able to write those mounted paths. flowchart LR
A[Native evaluation job] --> B[Trial directory setup]
B --> C[Host bind-mount folders]
C --> D[Task image user]
D --> E[Harness and verifier logs]
E --> F[Trial results]
Decision needed
Why: The patch changes the security boundary between host users and arbitrary task-container users; forcing root execution or defining per-container mount ownership changes the evaluator's supported execution contract. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use a least-privilege mount-access design that grants each configured container user the required write access without restoring host-wide write access, and cover it with an unprivileged-container regression test. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: run any harness in a task image declaring an unprivileged USER; its required write to /logs/agent or /logs/verifier is denied by a host-owned 0755 mount. Is this the best way to solve the issue? No. Replacing 0777 with host-owned 0755 removes required writes for supported image users; a user-aware least-privilege mount policy is safer. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against 884dd1bb5511. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
What does this PR do?
Trial directories created for native eval are no longer world-writable (
0o777). They are created as0o755so only the owner can write logs and artifacts.Why?
DockerTaskEnvironment.startchmod'dagent,verifier, andartifacts/logs/artifactsto0o777. On a shared host another user could plant or rewrite trial logs. Cleanup paths in the same tree already use0o755for directories.Changes
prepare_trial_dirs()and chmod0o755instead of0o777test_prepare_trial_dirs_are_owner_writable_onlyTests
tests/test_native_eval_runner.py::test_prepare_trial_dirs_are_owner_writable_onlypasses locallypython -m ruff check clawbench app.py scripts testspasses locallyRed: with
0o777the new check reports mode511(0o777) instead of493(0o755). Green: dirs are0o755.What Problem This Solves
Fixes an issue where native-eval trial log directories were world-writable, so another user on the same host could plant or rewrite agent, verifier, or artifact logs.
Evidence
Terminal output from the patched helper:
Real behavior proof
Behavior or issue addressed: Native-eval start created trial dirs with mode
0o777, which lets any local user write logs.Real environment tested: macOS 15, Python 3.14, worktree
/tmp/sb-chmodonfix/trial-dir-mode.Exact steps or command run after this patch:
Evidence after fix: terminal output from the patched helper. Trial dirs are owner-writable only:
Observed result after fix:
prepare_trial_dirscreatesagent,verifier, andartifacts/logs/artifactsas0o755.What was not tested: A live docker compose trial against a remote registry.