Skip to content

feat: add allow_workflow_modifications input#1283

Open
isc wants to merge 1 commit intoanthropics:mainfrom
isc:feat-allow-workflow-modifications
Open

feat: add allow_workflow_modifications input#1283
isc wants to merge 1 commit intoanthropics:mainfrom
isc:feat-allow-workflow-modifications

Conversation

@isc
Copy link
Copy Markdown

@isc isc commented May 4, 2026

Summary

Add an optional allow_workflow_modifications input (defaults to false) that removes the prompt-level restriction preventing Claude from modifying .github/workflows/ files.

Problem

The system prompt in generateDefaultPrompt() unconditionally tells Claude:

You CANNOT modify files in the .github/workflows directory

This makes sense for Anthropic's hosted GitHub App, but organizations using custom GitHub App tokens with workflows:write have 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

File Change
action.yml Add allow_workflow_modifications input + pass as env var
src/github/context.ts Parse the new input into BaseContext.inputs
src/create-prompt/index.ts Conditionally omit the workflow restriction line (follows the existing includeFixLinks pattern)
test/** Add allowWorkflowModifications: false to all test fixtures

Behavior

  • Default (false): No change — Claude still sees the "CANNOT modify workflows" instruction
  • true: The restriction line is omitted from the prompt, allowing Claude to modify workflow files if the token permits it

Testing

  • TypeScript typecheck passes (bun run typecheck)
  • All existing test fixtures updated
  • Validated end-to-end at Doctolib: Claude successfully modified a workflow file, committed, and pushed when given workflows:write permission

Closes #1282

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
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.

feat: make .github/workflows modification restriction configurable

1 participant