Skip to content

Comments

HNT-1732: Claude Code reviews PRs#367

Open
mmiermans wants to merge 5 commits intomainfrom
hnt-1732-claude-github-reviewer
Open

HNT-1732: Claude Code reviews PRs#367
mmiermans wants to merge 5 commits intomainfrom
hnt-1732-claude-github-reviewer

Conversation

@mmiermans
Copy link
Contributor

@mmiermans mmiermans commented Feb 19, 2026

Goal

HNT-1732 Claude Code automatically reviews PRs, and re-reviews as new commits are pushed. This does not replace the need to review all generated code before it is committed, and having a second engineer review it as well.

Deployment steps

References

JIRA ticket: HNT-1732

Docs:

@mmiermans mmiermans requested a review from a team as a code owner February 19, 2026 02:16
Copy link
Contributor

@jpetto jpetto left a comment

Choose a reason for hiding this comment

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

a couple questions

permissions:
contents: read
pull-requests: write
id-token: write
Copy link
Contributor

Choose a reason for hiding this comment

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

why does claude need id-token: write? what is it accessing?

Copy link
Contributor Author

@mmiermans mmiermans Feb 20, 2026

Choose a reason for hiding this comment

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

id-token: write lets the workflow request a JWT that proves "I am this workflow, in this repo." The action sends this JWT to Anthropic, which validates it and returns a GitHub App installation token for the Claude App installed in our org. The returned token has the full permissions of the installed Claude App: read/write access to contents, issues, and pull requests.

This is the authentication method that official Claude Code examples use. The alternative is passing the workflow's built-in github.token that is scoped by the permissions block. This requires no App and no id-token: write, but comments post as github-actions[bot] and sticky matching breaks. anthropics/claude-code-action#960.

anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: "/review"
# Pre-loads full PR context (description, diff, comments) into the prompt. Also shows a progress tracker.
track_progress: true
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't see this option listed in the docs you linked, but i did find a github issue noting that this option is a security risk, as it appears to give claude full write access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's listed in https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md. I put this link in code for future reference.

After doing more investigation, I found an include_comments_by_actor parameter that prevents Claude from reading untrusted comments, which secures against prompt injection. Without the ability to affect the main branch, I believe Claude having write access is not an issue. I've documented this at the top of the file.

# 3. Production deployments are protected:
# - [x] main branch protection requires PR approval
# - [x] Claude can't merge or approve PRs; allowedTools does not include `gh pr merge` or `gh pr review`
# - [x] Claude's commits can't be merged; main require signed commits, and use_commit_signing is disabled
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It feels unlikely to me that Claude would push to the dev branch, and the impact is probably limited, but we could prevent this from happening by requiring verified commits on dev.

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.

2 participants