Repository navigation
How can i restrict access to certain files and directories? #693
|
Hi, I checked the policy, and it only has network commands. Is it possible to restrict file system access? Thanks |
Replies: 1 comment 2 replies
|
The sandbox only sees what you mount, so You're right that Without that, a small shell guard covers the common mistake of launching from home: sbx() {
if [ "$1" = run ]; then
case "$PWD" in
"$HOME"|"${HOME%/*}"|/) echo "sbx: not mounting $PWD, cd into a project first" >&2; return 1 ;;
esac
fi
command sbx "$@"
}It only checks the current directory, so an explicit path you pass is still up to you, but it stops the default mount from ever being |
The sandbox only sees what you mount, so
~/.sshand~/.kubeare only exposed when the workspace is your home directory (or a parent of it). Per the Architecture and Security docs, a direct workspace is mounted read-write at the same absolute path,sbx runuses the current directory when you don't pass a path, and outside the workspace and the shared skills store the agent can't reach the host filesystem. So the risky case is startingsbx runfrom~, which mounts your whole home read-write. Starting it from~/code/myproject, or passing the project directory as the workspace path, keeps those dot directories out of the VM. If you also don't want the agent editing your working tree, clone mo…