Add configurable permission restrictions to GitHub Action #13
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
At Figma, we noticed that the
/security-review
command in.claude/commands/security-review.md
specifiesallowed-tools
to restrict permissions, but this wasn't actually being enforced when the GitHub Action runs Claude Code via the CLI. This PR adds support for configurable permission restrictions to ensure Claude Code operates with minimal required permissions during security scans.Motivation
Changes
New
allowed-tools
input parameter inaction.yml
Permission enforcement in
github_action_audit.py
--allowedTools
flag to the Claude CLI (single comma-separated string)Read
,Glob
,Grep
,LS
,Task
, and limited git commands (git diff
,git status
,git log
,git show
,git remote show
)Tests for the new functionality
Documentation updates
Test Plan
Notes
This is a backward-compatible change - existing workflows will continue to work with the secure defaults applied automatically.