The policy script
The script reads the command as JSON, opens the files it names through the workspace, and refuses a Python script whose code deletes files:guard.py
WritesOnlyToOut below does
for writes.
The workspace
- Python
- TypeScript
What the agent sees
- Hidden files are absent, not refused.
aws.txtandserver.pemread as missing, andlsleavesserver.pemout.secretsstays listed only becauseREADME.mdis shown back inside it. - Hidden variables read as unset.
$AWS_SECRET_ACCESS_KEYexpands to nothing;$TEAMis untouched. - Denied commands exit 126 with
Permission denied, the same wording a shell gives. The reason stays with the host. - The script reads the file before it runs.
python3 clean.pyis refused becauseclean.pycallsos.remove. A script that only reads runs. - The coded policy sees every file call. The write from
echoand the write from Python’sopen()both reachpre_vfs, and both are refused outside/data/out. - An ask goes to the host.
rm out/notes.txtmatches the ask rule, soapproveanswers it before the line runs. Withouton_ask, the line returns pending until the host answers.
analyst. The coded policy
applies to every session of the workspace, so the host’s own writes outside
/data/out are refused as well.
Learn more
- Agent profiles: every profile key and how rules match.
- Policies: the eight methods and their answers.
- Scripts: what a policy script reads and prints.
- Explain: check a line against the rules before it runs.