feat(tools): structured shell output envelope and per-path read sandbox#2528
Merged
feat(tools): structured shell output envelope and per-path read sandbox#2528
Conversation
This was
linked to
issues
Mar 31, 2026
Closed
Implements #2488 and #2489. #2488 — ShellOutputEnvelope { stdout, stderr, exit_code, truncated }: - Captures stdout and stderr as separate streams via tagged channel - Serializes envelope as JSON into ToolOutput for LLM and audit consumers - AuditEntry gains exit_code: Option<i32> and truncated: bool - log_audit propagates truncated from envelope to audit record #2489 — per-path read allow/deny sandbox in FileExecutor: - FileConfig { deny_read, allow_read } added to ToolsConfig - GlobSet matching with deny-then-allow evaluation order - Paths are canonicalized before matching to prevent symlink bypass - check_read_sandbox applied to both handle_read and grep_recursive - SEC-01: grep_recursive canonicalizes path before sandbox check Closes #2488, #2489
4774611 to
d5b7ab0
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.
Summary
ShellOutputEnvelope { stdout, stderr, exit_code, truncated }— separate stdout/stderr capture via tagged channel, JSON-serialized intoToolOutput,AuditEntryextended withexit_code/truncated(backward-compatible via#[serde(default)])FileConfig { deny_read, allow_read }glob lists inToolsConfig— deny-then-allow evaluation with canonicalized paths inFileExecutor::handle_read()andgrep_recursive()to prevent symlink bypassTest plan
cargo +nightly fmt --check— cleancargo clippy --all-targets --all-features --workspace -- -D warnings— cleancargo nextest run --workspace --all-features --exclude exarch-python --exclude exarch-node --lib --bins— 7179/7179 pass (+10 new tests)log_auditreceivesenvelope.truncatedFollow-up
#2525, #2526, #2527 — wizard, default config, docs