# The tool root: what it is and what it is not The file tools (`read`, `write`, `edit`, `search`, `list`) act with the rights of the splinter process. Without a boundary, a model with mutate rights - or a prompt-injected one - can write `~/.ssh/authorized_keys`, `~/.splinter/splinter.conf` (which names the plugins the harness loads), `~/.bashrc`. The authorization classes say *whether* a tool may run, never *where*. `tools_root` in `core { }` closes that: ``` core { tools_root = ~/src # empty (the default) = no boundary } ``` Rules that make it hold: - **Resolve before deciding, then use the resolved path.** A check on one string and a write to another is the whole class of bug this exists to prevent. `realpath()` for existing paths; `resolve_target()` for a path that does not exist yet, so a *dangling* symlink inside the root cannot be followed out of it by the write that creates the target. - **Recursion needs the same check as the argument.** `search` walks directories; `stat()` follows a directory symlink. Every entry is resolved before it is opened, otherwise a link inside the root is a door. - **The root is resolved once at startup.** A symlinked root would make a later comparison lie, and a root that does not exist is refused at startup with the path in the message instead of silently matching nothing. - **`run` is not fenced and cannot be.** A shell opens any path it likes. It starts in the root (convenience), and when that `chdir` fails the failure goes into the tool's observation - after the redirection, so the model reads it as part of what happened, not on the operator's terminal. - **Empty means off.** Anything else would be a change to a working setup disguised as a fix. Tests that guard it live in `tests/test_builtin.c` (absolute path outside, `../..` walk, symlink inside pointing out, dangling symlink, directory symlink through `search`, and the same tree still readable inside the root). Each was verified by removing the check and watching the test go red.