Skip to content

chore(tools): Add sandboxed unix_utils tool#505

Merged
JeanMertz merged 6 commits intomainfrom
prr74
Apr 4, 2026
Merged

chore(tools): Add sandboxed unix_utils tool#505
JeanMertz merged 6 commits intomainfrom
prr74

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

Adds a unix_utils tool to the local tools crate, giving the assistant access to a curated set of common unix utilities: base64, bc, date, file, head, jq, shasum, sort, tail, uname, uniq, uuidgen, and wc.

Each invocation goes through two layers of security. First, argument validation scans every argument — both whole and split on common delimiters — for path references outside the workspace root, rejecting tilde home expansions, .. traversals, and absolute paths to existing system files. Second, on macOS, the subprocess runs inside a sandbox-exec Seatbelt profile that is deny-default: only the workspace root, the binary's symlink chain, its shared library directories, and a small set of per-util extras (e.g. timezone data for date) are allowed. Writes and network access are denied.

The tool is wired into the dev persona via a new unix skill, and a corresponding tool definition is added under
.jp/mcp/tools/unix/utils.toml.

Adds a `unix_utils` tool to the local tools crate, giving the assistant
access to a curated set of common unix utilities: `base64`, `bc`,
`date`, `file`, `head`, `jq`, `shasum`, `sort`, `tail`, `uname`, `uniq`,
`uuidgen`, and `wc`.

Each invocation goes through two layers of security. First, argument
validation scans every argument — both whole and split on common
delimiters — for path references outside the workspace root, rejecting
tilde home expansions, `..` traversals, and absolute paths to existing
system files. Second, on macOS, the subprocess runs inside a
`sandbox-exec` Seatbelt profile that is deny-default: only the workspace
root, the binary's symlink chain, its shared library directories, and a
small set of per-util extras (e.g. timezone data for `date`) are
allowed. Writes and network access are denied.

The tool is wired into the `dev` persona via a new `unix` skill, and a
corresponding tool definition is added under
`.jp/mcp/tools/unix/utils.toml`.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 8297bff into main Apr 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant