Skip to content

[Claude] Harden allow/deny lists and clarify dev server behavior#3373

Merged
bgrgicak merged 10 commits intotrunkfrom
playground-claude-settings-update
Mar 16, 2026
Merged

[Claude] Harden allow/deny lists and clarify dev server behavior#3373
bgrgicak merged 10 commits intotrunkfrom
playground-claude-settings-update

Conversation

@bgrgicak
Copy link
Copy Markdown
Collaborator

Motivation for the change, related issues

Updates Claude Code settings to add read-only git commands to the allow list and expand the deny list with additional destructive/irreversible operations.

Claude Code was not pre-authorized to run basic git inspection commands (git diff, git status, git log), requiring manual approval for routine read-only
operations. Additionally, the deny list was incomplete — it didn't block force pushes, hard resets, rm -rf, sudo, or merging/closing PRs via the CLI.

Implementation details

Allow list additions

Added git diff, git status, and git log to the allow list so Claude can inspect repository state without prompting.

Deny list hardening

  • Broadened existing deny patterns to use * wildcards (e.g. *npm run release*) so they match regardless of command prefix
  • Added denies for git push --force/-f, git push * trunk, git reset --hard, git clean -f, rm -rf, sudo, gh pr merge, and gh pr close

AGENTS.md cleanup

  • Clarified that npm run dev auto-reloads on code changes (no restart needed)

Testing Instructions

  1. Review the settings changes

Copilot AI review requested due to automatic review settings March 11, 2026 11:39
@bgrgicak bgrgicak self-assigned this Mar 11, 2026
@bgrgicak bgrgicak requested review from a team and zaerl and removed request for a team March 11, 2026 11:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Claude Code configuration to allow routine read-only git inspection while hardening deny rules against destructive/irreversible CLI operations, plus a small docs clarification about dev server reload behavior.

Changes:

  • Allowlisted git diff, git status, and git log for non-destructive repo inspection.
  • Expanded deny patterns to cover additional destructive git/shell/GitHub CLI commands and broadened pattern matching with wildcards.
  • Clarified in AGENTS.md that npm run dev auto-reloads on code changes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
AGENTS.md Clarifies dev server behavior (auto-reload) in the developer command reference.
.claude/settings.json Expands allow/deny command patterns for Claude Code to enable read-only git commands and block destructive operations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bgrgicak and others added 3 commits March 11, 2026 13:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bgrgicak bgrgicak requested a review from Copilot March 11, 2026 12:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Adam Zieliński <adam@adamziel.com>
@bgrgicak bgrgicak requested review from a team and adamziel March 12, 2026 06:34
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 16, 2026

@bgrgicak I've opened a new pull request, #3398, to work on those changes. Once the pull request is ready, I'll request review from you.

The previous deny rule `Bash(*rm -rf *)` only blocked one specific form
of recursive force-delete, but `-rf` can be expressed equivalently as
`-fr`, `-r -f`, `-prv`, or via shell expansion — making the rule
trivially bypassable.

## Changes

- **`.claude/settings.json`**: Replaced `"Bash(*rm -rf *)"` with
`"Bash(*rm *)"` to deny any invocation of `rm`, regardless of flags or
argument ordering.

<!-- START COPILOT CODING AGENT TIPS -->
---

📍 Connect Copilot coding agent with [Jira](https://gh.io/cca-jira-docs),
[Azure Boards](https://gh.io/cca-azure-boards-docs) or
[Linear](https://gh.io/cca-linear-docs) to delegate work to Copilot in
one click without leaving your project management tool.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgrgicak <1199991+bgrgicak@users.noreply.github.com>
@bgrgicak bgrgicak merged commit 7178abe into trunk Mar 16, 2026
46 checks passed
@bgrgicak bgrgicak deleted the playground-claude-settings-update branch March 16, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants