Skip to content

Create the prepared grader snapshot directory as owner-only - #1941

Merged
JacobStephens2 merged 1 commit into
mainfrom
issue-1939
Nov 10, 2026
Merged

JacobStephens2 merged 1 commit into
mainfrom
issue-1939

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

 let directory = tempfile::Builder::new()
     .prefix("prepared-grader-")
+    .permissions(fs::Permissions::from_mode(0o700))
     .tempdir()?;

A Trial with checks copies the prepared repository into prepared-grader-* in the shared temporary directory before the session starts. That directory is now created owner-only, the same way the code Grader packet is.

Seam: the snapshot directory's mode, observed from the Trial completion callback while the directory still exists.

Evidence

Execution evidence

  • Before: cargo test --bin thirdshift evals::experiment::execution::tests::the_prepared_grader_snapshot_directory_is_private_to_its_owner -- --exact

    assertion `left == right` failed
      left: 509
     right: 448
    

    509 is mode 0775; 448 is mode 0700.

    After: the same command:

    test evals::experiment::execution::tests::the_prepared_grader_snapshot_directory_is_private_to_its_owner ... ok
    test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1695 filtered out; finished in 0.44s
    

    cargo test --bin thirdshift evals::experiment::execution::tests then passed all 22 tests. scripts/affected-tests main ran the full Rust suite: PASS cargo nextest run (2538.44s).

No visual change.

Unaddressed findings

Standards: none.

Spec: none.

Security: none.

Changed files the review left unread: none.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Reverting the commit restores the previous directory mode. Trials already running keep the directory they created.

Blast Radius: Trials

Every Trial with mechanical checks creates this directory. Other accounts on the machine can no longer read the prepared repository there. Checks still grade that copy.

Closes #1939

Built with grok grok 1.0.70 (f50904eaee6c) [stable] · default model · default effort

The prepared repository for mechanical checks lives in a shared temporary
directory. Create that directory with mode 0700 so other accounts cannot
read it.
@JacobStephens2
JacobStephens2 merged commit a612932 into main Nov 10, 2026
16 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1939 branch November 10, 2026 10:23
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create the prepared grader snapshot directory as owner-only

1 participant