Suppose an analysis returns the expected answer after reading an unapproved notebook. The answer check passes. The file-access check should fail.
Ai2's new write-up on scientific agents makes room for that distinction: evaluating a coding agent can include whether it accessed files outside the researcher's authorized scope. Its interview study also distinguishes checking a final answer from understanding how the work was done. [1]
I want that distinction visible in a concrete example. Below is a local path check against synthetic files. It helps describe an access rule; it is not an agent sandbox.
Give “inside this folder” a precise meaning
A string prefix is tempting. An approved directory called approved also prefixes approved-extra. A link inside approved can lead somewhere else entirely.
Python's Path.resolve() follows symbolic links, while relative_to() checks path-component ancestry. [3] Together they can identify these mistakes in a stable fixture.
Original diagram from the executed synthetic fixture. No real research data is shown.
Save the program as scope_check.py and run python3 scope_check.py in Python with symbolic-link support. It creates temporary synthetic files and removes them when finished. It does not read their contents during the check.
from pathlib import Path
from tempfile import TemporaryDirectory
def within(root, candidate):
try:
candidate.resolve(strict=True).relative_to(root.resolve(strict=True))
return candidate.is_file()
except (ValueError, OSError, RuntimeError):
return False
with TemporaryDirectory() as folder:
base = Path(folder)
approved = base / "approved"
sibling = base / "approved-extra"
private = base / "private"
for directory in (approved, sibling, private):
directory.mkdir()
(approved / "data.csv").write_text("x,y\n1,2\n")
(sibling / "data.csv").write_text("synthetic decoy\n")
(private / "notes.txt").write_text("synthetic private note\n")
(approved / "link.csv").symlink_to(private / "notes.txt")
cases = {
"data": approved / "data.csv",
"notes": private / "notes.txt",
"prefix sibling": sibling / "data.csv",
"symlink": approved / "link.csv",
"missing": approved / "missing.csv",
}
for label, candidate in cases.items():
naive = str(candidate).startswith(str(approved))
checked = within(approved, candidate)
print(label, naive, checked)
The output columns are the label, prefix result and resolved-path result:
data True True
notes False False
prefix sibling True False
symlink True False
missing True False
The string check accepts paths because their spelling looks familiar. The second check asks where the path actually points and whether it exists as a file. The missing-file case also prevents “allowed location” from being mistaken for “available input.”
Keep access evidence beside result evidence
For an analysis task, I would record the approved input set separately from the output assertion. One record answers which material the task may use. Another answers whether the output is correct. An observed access trace can then be compared with the approved set, including rejected attempts.
That separation makes failures explainable. An incorrect answer with compliant access calls for debugging the analysis. A correct answer with forbidden access calls for fixing the execution boundary. Combining them into a single success flag loses the reason to intervene.
The tiny function has a clear limit: another process could change a link between checking and opening. It also cannot stop an agent from using another reader. Real enforcement belongs at the file-access boundary, with isolation and an access mechanism designed for the threat model. This example checks a fixed set of paths; it does not provide that enforcement.
What the interviews can support
The underlying report describes semi-structured interviews with 17 US-based scientists, recruited through research networks and contacts. It is exploratory qualitative work, not a representative opinion poll or a benchmark of agent reliability. [2]
That makes it useful for finding requirements to test. It cannot tell me what percentage of all scientists would approve a given workflow, or certify that this example satisfies a lab's rules. The people responsible for the work still need to define its permitted inputs, methods and review.
A result assertion is worth keeping. A separate access assertion tells a different part of the story.
References
- Kyle Wiggers, Ai2 — Where scientists draw the line on AI agents
- Morgan, Mun and colleagues — Alongside us and not against us: Scientists on How Scientific AI Agents Can be Developed Responsibly
- Python — pathlib, resolve and relative_to
Asset credits
Original path-check diagram, released under CC BY 4.0. Credit: Shivam Dwivedi.
AI disclosure
AI was used to draft the article.

Top comments (0)