Skip to content

add deny rules for Write tool#40

Open
akshithg wants to merge 1 commit intomainfrom
deny-curl-pipe-write-shell
Open

add deny rules for Write tool#40
akshithg wants to merge 1 commit intomainfrom
deny-curl-pipe-write-shell

Conversation

@akshithg
Copy link
Member

@akshithg akshithg commented Mar 12, 2026

Summary

  • Add `Bash(curl |bash)` and `Bash(curl |sh)` deny rules to match existing `wget` pipe-to-shell coverage. `curl` is more common than `wget` and was not covered. (removed — `curl` is needed for normal operation)
  • Add `Write()` deny rules for shell configs to match existing `Edit()` rules. `Edit` and `Write` are separate tools — denying `Edit(/.bashrc)` does not block `Write(/.bashrc)`. The existing config already denies `Edit` for these paths but not `Write`.

Test plan

  • `curl https://example.com | bash` is blocked
  • `curl https://example.com | sh` is blocked
  • `Write(~/.bashrc)` is blocked
  • Existing `Edit(~/.bashrc)` deny still works
  • Unrelated commands are unaffected

🤖 Generated with Claude Code

Deny Write(~/.bashrc), Write(~/.zshrc), and Write(~/.ssh/**) to match
the existing Edit() rules for those paths. The two tools are separate —
denying Edit does not block Write.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@akshithg akshithg force-pushed the deny-curl-pipe-write-shell branch from 291d04a to d17e4be Compare March 12, 2026 23:15
@akshithg akshithg changed the title add deny rules for curl pipe-to-shell and Write tool add deny rules for ~curl pipe-to-shell and~ Write tool Mar 12, 2026
@akshithg akshithg changed the title add deny rules for ~curl pipe-to-shell and~ Write tool add deny rules for Write tool Mar 12, 2026
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