altimate-code
altimate-code copied to clipboard
bash tool ignores external_directory: deny for most commands, redirections and binaries run by path
Problem
permission: { external_directory: "deny" } stops the file tools (read, glob, grep, edit, write, apply_patch, list) from touching paths outside the project, but the bash tool only applies it to a fixed list of file commands (cd, rm, cp, mv, mkdir, touch, chmod, chown, cat, ls) and to workdir. Anything else runs:
- reads by any other command:
head /abs/outside/file,grep -r x ../sibling-worktree - writes through redirection:
echo x > /tmp/scratch.txt,cmd >> /outside/log - executing a binary by path outside the project:
/path/to/host-checkout/.venv/bin/python ... - commands that run after
cd /outside && ...when the command itself is not on the list
In headless runs configured with external_directory: deny, the agent wrote scratch files under /tmp, ran the host checkout's .venv/bin/python from a sandbox worktree, and read a sibling worktree's files by absolute path. Benchmark runs that rely on the setting cannot be trusted, and "no file access outside the repository" cannot be claimed.
Expected
- With an effective
external_directorydeny, a bash command that names a literal path outside the project (argument, redirection target, command path, or a directory itcds into) is refused with an error that names the path. - Directories the configuration allows (for example the tool-output directory, or an explicitly allowed scratch dir) keep working; a directory configured as
askgoes through the normal permission prompt. - Unset, the default
ask, andallowkeep today's behaviour exactly.