Describe the bug
When using claude_args with --allowedTools that includes WebSearch and WebFetch, these tools are still disabled by default through the DISALLOWED_TOOLS environment variable.
The --allowedTools parameter in claude_args is not reflected in the mode's allowed tools list during prompt creation, causing the default disabling behavior to take precedence. This prevents Claude from using web search and fetch capabilities even when explicitly allowed.
To Reproduce
Steps to reproduce the behavior:
- Create a GitHub Actions workflow with
claude_args containing --allowedTools that includes WebFetch and WebSearch
- Trigger the action with a comment containing
@claude and request it to search the web or fetch a URL
- Check the execution logs
- See error: Tools are rejected because
DISALLOWED_TOOLS: WebSearch,WebFetch is set
Expected behavior
Since WebFetch and WebSearch are explicitly included in --allowedTools, they should be available for Claude to use during execution. The --allowedTools parameter should override the default disabling behavior for these tools.
Screenshots
Workflow yml file
- name: ***
uses: anthropics/claude-code-action@v1
with:
use_bedrock: "true"
track_progress: true
github_token: ${{ steps.app-token.outputs.token }}
claude_args: |
--model sonnet
--mcp-config .mcp.json
--allowedTools Task,Edit,Read,WebFetch,WebSearch,Glob,Grep,SlashCommand,mcp__github_comment__update_claude_comment,mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)
--disallowedTools ""
API Provider
[ ] Anthropic First-Party API (default)
[x] AWS Bedrock
[ ] GCP Vertex
Additional context
Root Cause Analysis
The issue occurs in src/create-prompt/index.ts in the createPrompt function:
-
Mode's getAllowedTools() returns empty array:
Both Tag mode (src/modes/tag/index.ts) and Agent mode (src/modes/agent/index.ts) implement getAllowedTools() to return an empty array:
getAllowedTools() {
return [];
}
-
buildDisallowedToolsString applies default disabling:
In src/create-prompt/index.ts, the buildDisallowedToolsString function:
export function buildDisallowedToolsString(
customDisallowedTools?: string[],
allowedTools?: string[],
): string {
// Tag mode: Disable WebSearch and WebFetch by default for security
let disallowedTools = ["WebSearch", "WebFetch"];
// If user has explicitly allowed some default disallowed tools, remove them
if (allowedTools && allowedTools.length > 0) {
disallowedTools = disallowedTools.filter(
(tool) => !allowedTools.includes(tool),
);
}
// ...
}
-
createPrompt uses mode.getAllowedTools():
const modeAllowedTools = mode.getAllowedTools(); // Returns []
const modeDisallowedTools = mode.getDisallowedTools();
const allDisallowedTools = buildDisallowedToolsString(
modeDisallowedTools,
modeAllowedTools, // Empty array, so WebSearch/WebFetch remain disabled
);
core.exportVariable("DISALLOWED_TOOLS", allDisallowedTools); // Sets "WebSearch,WebFetch"
-
parseAllowedTools is not connected to mode.getAllowedTools():
While Agent mode has parseAllowedTools() function in src/modes/agent/parse-tools.ts that can parse --allowedTools from claude_args, this parsed value is:
- Used only in
prepareMcpConfig()
- Not returned by
mode.getAllowedTools()
- Not available during the
buildDisallowedToolsString() call
Describe the bug
When using
claude_argswith--allowedToolsthat includesWebSearchandWebFetch, these tools are still disabled by default through theDISALLOWED_TOOLSenvironment variable.The
--allowedToolsparameter inclaude_argsis not reflected in the mode's allowed tools list during prompt creation, causing the default disabling behavior to take precedence. This prevents Claude from using web search and fetch capabilities even when explicitly allowed.To Reproduce
Steps to reproduce the behavior:
claude_argscontaining--allowedToolsthat includesWebFetchandWebSearch@claudeand request it to search the web or fetch a URLDISALLOWED_TOOLS: WebSearch,WebFetchis setExpected behavior
Since
WebFetchandWebSearchare explicitly included in--allowedTools, they should be available for Claude to use during execution. The--allowedToolsparameter should override the default disabling behavior for these tools.Screenshots
Workflow yml file
API Provider
[ ] Anthropic First-Party API (default)
[x] AWS Bedrock
[ ] GCP Vertex
Additional context
Root Cause Analysis
The issue occurs in
src/create-prompt/index.tsin thecreatePromptfunction:Mode's getAllowedTools() returns empty array:
Both Tag mode (
src/modes/tag/index.ts) and Agent mode (src/modes/agent/index.ts) implementgetAllowedTools()to return an empty array:buildDisallowedToolsString applies default disabling:
In
src/create-prompt/index.ts, thebuildDisallowedToolsStringfunction:createPrompt uses mode.getAllowedTools():
parseAllowedTools is not connected to mode.getAllowedTools():
While Agent mode has
parseAllowedTools()function insrc/modes/agent/parse-tools.tsthat can parse--allowedToolsfromclaude_args, this parsed value is:prepareMcpConfig()mode.getAllowedTools()buildDisallowedToolsString()call