Repository navigation
feat(tools): exec runs one program with an exact argv and no shell (T7) - #41
Merged
Merged
Conversation
lg2m
force-pushed
the
feat/tool-layer-t7-exec
branch
from
September 14, 2026 21:00
1c82535 to
e9a91aa
Compare
Merged
`exec {program, args, cwd, stdin, timeout_seconds, env}` shares
run_shell's environment, capture, spill, timeout, and header rules with
`shell` through a Launch enum, but spawns the program directly: no
quoting, globbing, $, or pipes. For policy the call is rendered as the
equivalent command line with metacharacter arguments single-quoted, so
the classifier, prefix grants (`cargo test` covers exec cargo [test …]),
the built-in-preference nudge, and the approval preview see one shape for
both tools — and `rm -rf /` as an exec argument is a literal word.
stdin is written by its own task so a program that never reads it cannot
stall capture. The prompt steers the model to exec for single programs
and shell for pipelines. Seven advertised built-ins; TUI renders
`Run program args…`.
lg2m
force-pushed
the
feat/tool-layer-t7-exec
branch
from
September 14, 2026 21:51
e9a91aa to
dc92e5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
T7:
exec— one program, an exact argv, no shellSpec: docs/plans/tool-layer.md § D5 (T7) Linear: ENG-777 Stacked on: #40 (T6) — merge that first; this PR's diff is the last commit.
What changed
exec {program, args, cwd, stdin, timeout_seconds, env}: spawns the program directly with the argument list. No quoting, globbing,$, or pipes — a filename with a space needs no escaping and$HOMEis four literal characters. Bounds:program≤ 256 B,args≤ 64 × 4 KiB,stdin≤ 64 KiB.shellvia aLaunchenum: cleared environment +envallowlist, capture/spill, timeout and process-group kill,exec exit=<code> elapsed= bytes=header, built-in hint.stdinis written by its own task and closed, so a program that never reads it can't stall capture.execcall is rendered as the equivalent command line with metacharacter arguments single-quoted (echo 'rm -rf /' '$HOME'), so the classifier, prefix grants (cargo testcoversexec cargo [test, -p, x]), the strict nudge, and the approval preview all work unchanged — andrm -rf /as an argument is a literal word, whileexec sudo lsis still Forbidden.Run program args…;execis in the config vocabulary.Scope note
The plan listed the env allowlist and the prefer-built-in nudge under T7. Both shipped in T6's shell-v2 commit because they share
ShellPolicyplumbing with the cleared environment; T7 isexecalone. Recorded in the ledger.How verified
cargo test --workspace: 1391 passed / 0 failed; fmt andclippy -D warningsclean.exec_runs_an_exact_argv_without_shell_interpretation: literal$HOME/*/|/space arguments, stdin piped and closed, exit codes with header, missing program, typed failures (invalid_program,invalid_env, path).exec_calls_classify_as_the_equivalent_command_line: prefix grant covers,autoallows, quoting of metacharacter args,sudovia exec Forbidden.Compatibility
tool_dispatchunaffected — it never spawns). Tool declaration hash changed (asserted).Docs
docs/design/tools.md§ Built-In Tools, § Shell Execution (exec); ledger T7 row + receipt.