From 492d2d78ee1f7dd5b58581c639b49752db9a2fab Mon Sep 17 00:00:00 2001 From: RESILIENCE Agentic Solutions Date: Thu, 20 Aug 2026 17:17:53 -0600 Subject: [PATCH] fix: teach claude_args --allowedTools in the signed prompt (#1704) allowed_tools was removed in v1.0. The tag-mode prompt still named it as the way to enable Bash under commit signing. Co-authored-by: RESILIENCE Agentic Solutions <286555414+WeAreResilience@users.noreply.github.com> Co-authored-by: Cursor --- src/create-prompt/index.ts | 2 +- test/create-prompt.test.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/create-prompt/index.ts b/src/create-prompt/index.ts index 9d9fa08b..833161d8 100644 --- a/src/create-prompt/index.ts +++ b/src/create-prompt/index.ts @@ -856,7 +856,7 @@ What You CANNOT Do: - Submit formal GitHub PR reviews - Approve pull requests (for security reasons) - Post multiple comments (you only update your initial comment) -- Execute commands outside the repository context${useCommitSigning ? "\n- Run arbitrary Bash commands (unless explicitly allowed via allowed_tools configuration)" : ""} +- Execute commands outside the repository context${useCommitSigning ? "\n- Run arbitrary Bash commands (unless explicitly allowed via claude_args with --allowedTools)" : ""} - Perform branch operations (cannot merge branches, rebase, or perform other git operations beyond creating and pushing commits) - Modify files in the .github/workflows directory (GitHub App permissions do not allow workflow modifications) diff --git a/test/create-prompt.test.ts b/test/create-prompt.test.ts index 8ff51067..e91f5cfb 100644 --- a/test/create-prompt.test.ts +++ b/test/create-prompt.test.ts @@ -824,6 +824,35 @@ describe("generatePrompt", () => { // Should not have git command instructions expect(prompt).not.toContain("Use git commands via the Bash tool"); + + // Bash is off unless the user passes --allowedTools through claude_args. + // allowed_tools was removed in v1.0 and must not appear as live guidance. + expect(prompt).toContain( + "Run arbitrary Bash commands (unless explicitly allowed via claude_args with --allowedTools)", + ); + expect(prompt).not.toContain("allowed_tools configuration"); + }); + + test("does not mention allowed_tools when commit signing is off", async () => { + const envVars: PreparedContext = { + repository: "owner/repo", + claudeCommentId: "12345", + triggerPhrase: "@claude", + eventData: { + eventName: "issue_comment", + commentId: "67890", + isPR: true, + prNumber: "123", + commentBody: "@claude fix the bug", + }, + }; + + const prompt = await generatePrompt(envVars, mockGitHubData, false, "tag"); + + expect(prompt).not.toContain("allowed_tools"); + expect(prompt).not.toContain( + "Run arbitrary Bash commands (unless explicitly allowed", + ); }); describe("simplified prompt (USE_SIMPLE_PROMPT)", () => {