Add Claude Code deny rules for agent safety#695
Merged
Conversation
mokagio
added a commit
that referenced
this pull request
Feb 24, 2026
--- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 4.6 <noreply@anthropic.com>
AliSoftware
approved these changes
Feb 24, 2026
| "deny": [ | ||
| "Bash(gem push*)", | ||
| "Bash(gem signin*)", | ||
| "Bash(git tag*)", |
Contributor
There was a problem hiding this comment.
This prevents git tag list though 🤔
Contributor
Author
Deny destructive and production-impacting commands: gem publishing, tag creation (triggers CI publish), force push, remote branch deletion, hard reset, and the interactive release task. Plain `git push` stays allowed for PR workflows. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 4.6 <noreply@anthropic.com>
5efd61e to
91d4e45
Compare
Collaborator
Generated by 🚫 Danger |
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
.claude/settings.jsonwith deny rules that block destructive and production-impacting commands from agent execution.git clean, and the interactive release task.git pushstays allowed to support PR workflows.Context
When an AI agent works in this repo, the deny list acts as a guardrail against accidental production impact — even if the agent is given broad permissions otherwise.
See also: the agent isolation recommendations document for further improvements.
Test plan
gem push,git tag)Posted by Claude Code (Opus 4.6) on behalf of @mokagio with approval.