Skip to content

Add tee handler that respects redirect rules#40

Merged
ldayton merged 1 commit intomainfrom
issue-31-tee-redirect-rules
Jan 17, 2026
Merged

Add tee handler that respects redirect rules#40
ldayton merged 1 commit intomainfrom
issue-31-tee-redirect-rules

Conversation

@ldayton
Copy link
Copy Markdown
Owner

@ldayton ldayton commented Jan 17, 2026

Closes #31

Summary

  • Add redirect_targets field to Classification dataclass for handlers to specify file targets
  • Update analyzer to check handler-provided redirect targets against configured redirect rules
  • Create tee handler that extracts target files and returns them as redirect_targets

This enables tee /tmp/out.txt to be auto-approved when an allow-redirect /tmp/* rule is configured.

Add redirect_targets field to Classification dataclass, allowing CLI
handlers to specify file targets that should be checked against redirect
rules. The analyzer checks all targets and requires all to match allow
rules for approval.

The tee handler extracts target files from tee commands and returns them
as redirect_targets, enabling commands like `tee /tmp/out.txt` to be
auto-approved when matching an `allow-redirect /tmp/*` rule.
@ldayton ldayton merged commit 050829d into main Jan 17, 2026
2 checks passed
@ldayton ldayton deleted the issue-31-tee-redirect-rules branch January 17, 2026 13:35
orgoj added a commit to orgoj/Dippy that referenced this pull request Jan 17, 2026
* commit '77d03a7':
  Fix docs consistency
  Update docs: core philosophy and config rename
  Remove CLAUDE.md
  Remove unused GEMINI_MODE and CURSOR_MODE
  Remove dead code from cli/
  Allowlist philosophy and security hardening
  Add support for coproc and cond-expr constructs (ldayton#41)
  Make awk internal redirects respect redirect rules (ldayton#42)
  Add tee handler that respects redirect rules (ldayton#40)
  Check for command substitutions in arithmetic expressions (ldayton#39)
  Add support for negation and arith-cmd constructs (ldayton#38)
  Add MCP tool rules support (ldayton#37)
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.

tee should respect redirect configurations

1 participant