Repository navigation
Harden Claude fix workflow security - #50
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the .github/workflows/claude-fix-stellar-xdr.yml GitHub Actions workflow by applying tighter default GITHUB_TOKEN permissions and bounding Claude’s execution to limit token spend, while keeping the existing trigger/actor/branch restrictions for Dependabot stellar-xdr updates.
Changes:
- Set workflow-level
permissions: {}to ensure new jobs inherit no token permissions by default. - Move required write permissions (
contents,pull-requests,issues) to the single job that needs them. - Add
claude_args: --max-turns 30to cap Claude tool-use cycles per invocation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mootz12
approved these changes
May 8, 2026
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.
What
Apply the best practices to the
claude-fix-stellar-xdrworkflow:contents: write/pull-requests: write/issues: writescope from workflow level to the single job that needs it; set top-levelpermissions: {}so any future job added to this file inherits nothing by default.--max-turns 30viaclaude_argsto bound token spend per invocation.The workflow's existing structural restrictions are kept:
workflow_runof theRustworkflow withconclusion == 'failure'.dependabot[bot].dependabot/cargo/stellar-xdr-prefix.The pull-request-target/
pr-headsubdir pattern andMEMBER/OWNERauthor-association gate (used by theclaude-review.ymlstyle) do not apply here: the trigger isworkflow_run, notpull_request_target, and the actor gate (dependabot only) plays the equivalent role.Why
Brings this workflow in line with the Claude-action security standards being applied across the stellar org (see
stellar/stellar-corePR #5258 and the claude-code-action security guide). The two specific gaps closed:--max-turns, a stuck-in-a-loop run could burn an unbounded number of tokens.permissions: {}at the workflow root, any future job added to this file would silently inherit the broad write scopes. Moving them to the job level limits the blast radius.