Repository navigation
fix(agent): count a script's write to a named file outside the grant - #6820
Conversation
… the grant A run_python that really wrote the report the user asked for still got "No successful write to <file> is recorded for this turn", because the chat could read only the one input file the user had approved. The completion ledger refused even to stat the named output, before or after the run, so the write left no evidence. - A path the user typed as this turn's output may now be stat'ed (metadata only) outside the read grant. Withheld folders, secret files and network shares stay unseen, and an out-of-grant folder is never listed. - When every executor run had the file stat'ed before and after and saw no change, that comparison beats the modification-time guess. A coarse file clock could date an untouched file inside the run and count it as written.
|
Verdict: Approve with suggestions When a user shared one input file and asked for a report next to it, GAIA used to say "No successful write" even though the report was on disk. This PR fixes that: GAIA now checks the size and timestamp of an output file the user named, and only that file. The fix is correct and stays inside the privacy boundary. Withheld folders, secret files, network paths and paths that appear only in script code are still never checked, and a folder outside the grant is never listed.
Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on static review alone. pytest isn't installed on this runner, so I couldn't run the new tests here. The PR reports them passing, and they fail on main. 🔍 Technical detailsIssues 🟢 The set of requested paths is rebuilt on every call ( 🟢 Checks I ran
Strengths
|
A requested output that is itself a symlink resolved to its target, so the snapshot stat'ed a file outside the grant (Linux CI caught it; Windows can't make the link without privilege). The user named the link, so it gets the strict treatment: no stat, no mtime inference.
Asking GAIA to create a report beside a file you shared could end with a false "I couldn't confirm all of this: No successful write to
report.md", even though the report was on disk with the right rows. Approving the input file grants that one file only, so GAIA wouldn't even check whether the report it was asked to create existed. Now it checks the size and timestamp of a file you named as the output (never its contents), and a script's write to it counts. A file the turn never touched still gets the note, and a named output that is a symlink is never checked, so the link can't reach a file outside the grant.Eval categories to watch:
gaia_files,gaia_data,gaia_code,gaia_honesty. This isn't on CLAUDE.md's eval list, but these gaps also drive the correction the agent loop sends the model, so they shape what it does next.Test plan
pytest tests/unit/agents/test_completion_evidence.py: the Gemma report case (inline CSV, output path in a variable, single-file grant) fails on main and passes heretest_snapshot_without_validator_does_not_follow_external_symlink,test_a_named_file_that_links_outside_the_grant_is_never_probed) pass. They skip on Windows without symlink privilege; a forced-islinktest covers the same guard there.pytest tests/unit/agentspasses, and so does the flagship package apart from three tool-registry count tests that fail on main too