feat: add allow_workflow_modifications input#1283
Open
isc wants to merge 1 commit intoanthropics:mainfrom
Open
feat: add allow_workflow_modifications input#1283isc wants to merge 1 commit intoanthropics:mainfrom
isc wants to merge 1 commit intoanthropics:mainfrom
Conversation
Add an optional boolean input that, when set to true, removes the prompt-level restriction preventing Claude from modifying files in .github/workflows/. This enables organizations using custom GitHub App tokens with workflows:write permission to let Claude fix CI workflow issues autonomously. The restriction was previously unconditional in the system prompt, even though no tool-level block exists. This change makes it configurable while keeping the default behavior unchanged. Closes anthropics#1282
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
Add an optional
allow_workflow_modificationsinput (defaults tofalse) that removes the prompt-level restriction preventing Claude from modifying.github/workflows/files.Problem
The system prompt in
generateDefaultPrompt()unconditionally tells Claude:This makes sense for Anthropic's hosted GitHub App, but organizations using custom GitHub App tokens with
workflows:writehave no way to lift this restriction. The prompt contradicts the actual token permissions, causing Claude to refuse operations it could successfully perform.See #1282 for full context.
Changes
action.ymlallow_workflow_modificationsinput + pass as env varsrc/github/context.tsBaseContext.inputssrc/create-prompt/index.tsincludeFixLinkspattern)test/**allowWorkflowModifications: falseto all test fixturesBehavior
false): No change — Claude still sees the "CANNOT modify workflows" instructiontrue: The restriction line is omitted from the prompt, allowing Claude to modify workflow files if the token permits itTesting
bun run typecheck)workflows:writepermissionCloses #1282