Skip to content

feat(tools): structured shell output envelope and per-path read sandbox#2528

Merged
bug-ops merged 1 commit intomainfrom
enhancement-tools-structured
Mar 31, 2026
Merged

feat(tools): structured shell output envelope and per-path read sandbox#2528
bug-ops merged 1 commit intomainfrom
enhancement-tools-structured

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 31, 2026

Summary

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — clean
  • cargo nextest run --workspace --all-features --exclude exarch-python --exclude exarch-node --lib --bins — 7179/7179 pass (+10 new tests)
  • SEC-01 (symlink bypass in grep_recursive) — fixed, canonicalize before sandbox check
  • IC-02 (truncated not propagated to audit) — fixed, log_audit receives envelope.truncated

Follow-up

#2525, #2526, #2527 — wizard, default config, docs

@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate enhancement New feature or request size/XL Extra large PR (500+ lines) labels Mar 31, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 31, 2026 12:13
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
@bug-ops bug-ops force-pushed the enhancement-tools-structured branch from 4774611 to d5b7ab0 Compare March 31, 2026 12:16
@bug-ops bug-ops merged commit 468e9e1 into main Mar 31, 2026
27 checks passed
@bug-ops bug-ops deleted the enhancement-tools-structured branch March 31, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant