Summary
The gh-aw Claude engine unconditionally starts Claude Code with --permission-mode bypassPermissions (claude_engine.go:161). In this mode, Claude Code ignores the --allowed-tools flag entirely, making all tools advertised by the MCP gateway available to the agent regardless of the workflow's declared tool configuration. The --allowed-tools flag — documented as the primary tool-restriction control — therefore provides no security enforcement for the Claude engine. Separately, awmg-github v0.2.19 added get_teams and get_team_members to its tool set without a coordinated update to the gh-aw v0.68.3 compiler's tool-to-toolset mapping, but this synchronization gap is a secondary concern: even when the mapping is complete, bypassPermissions nullifies the allowlist anyway.
Affected Area
Claude engine tool-restriction boundary (pkg/workflow/claude_engine.go). The --allowed-tools flag is the stated security control for limiting which MCP tools an agent may call. bypassPermissions makes this control ineffective.
Reproduction Outline
- Compile a gh-aw workflow targeting the Claude engine with a restricted tool configuration (e.g.,
github-readonly profile that does not include get_teams or get_team_members).
- Run the compiled workflow; inspect
/tmp/gh-aw/agent-stdio.log for the Claude Code entrypoint command — confirm --allowed-tools is present and omits mcp__github__get_teams and mcp__github__get_team_members.
- Inspect the session-init JSON line in the same log; observe
"permissionMode": "bypassPermissions" and both excluded tools present in the "tools" array.
- Using the bearer token from
/tmp/gh-aw/mcp-config/mcp-servers.json (readable with Bash), send a direct tools/call for get_teams to the MCP gateway.
- Observe the response is a GitHub API error (not a gateway-level rejection) — the tool executed.
Observed Behavior
Claude Code is started with --permission-mode bypassPermissions and --allowed-tools <list>. The agent's session-init tool list contains all tools advertised by awmg-github v0.2.19 (22 tools), including get_team_members and get_teams which are absent from the allowlist. Direct tools/call for these tools succeeds (returns a GitHub API response, not a gateway rejection).
Expected Behavior
Either: (1) Claude Code respects --allowed-tools and tools absent from the allowlist are unavailable to the agent and rejected at call time; or (2) if bypassPermissions is intentional and --allowed-tools cannot be relied on as a security control in automated mode, this must be clearly documented and gateway-side per-session tool enforcement must serve as the effective control.
Security Relevance
The --allowed-tools flag is the documented mechanism by which workflow authors limit agent capabilities to only the tools declared in their workflow markdown. If this control is silently bypassed by bypassPermissions, agents can call any tool the gateway exposes — including tools from toolsets the workflow author never configured. This widens the effective attack surface beyond the workflow's stated permission model and could allow an agent (or prompt injection in agent input) to invoke sensitive tools the workflow owner did not intend to enable.
Additional Context
If bypassPermissions is by design (e.g., required for non-interactive operation), this assumption should be documented explicitly alongside the security model. The AGENTS.md instructions and gh-aw documentation currently list tool allowlists as a key security feature without acknowledging that the allowlist has no effect in bypassPermissions mode. Clear documentation of this trade-off would help workflow authors understand what controls are actually enforced.
Versions confirmed affected: gh-aw v0.68.3, awmg-github v0.2.19, Claude Code 2.1.98.
Original finding: https://github.com/githubnext/gh-aw-security/issues/1889
Generated by File Issue · ● 252.9K · ◷
Summary
The gh-aw Claude engine unconditionally starts Claude Code with
--permission-mode bypassPermissions(claude_engine.go:161). In this mode, Claude Code ignores the--allowed-toolsflag entirely, making all tools advertised by the MCP gateway available to the agent regardless of the workflow's declared tool configuration. The--allowed-toolsflag — documented as the primary tool-restriction control — therefore provides no security enforcement for the Claude engine. Separately,awmg-github v0.2.19addedget_teamsandget_team_membersto its tool set without a coordinated update to the gh-aw v0.68.3 compiler's tool-to-toolset mapping, but this synchronization gap is a secondary concern: even when the mapping is complete,bypassPermissionsnullifies the allowlist anyway.Affected Area
Claude engine tool-restriction boundary (
pkg/workflow/claude_engine.go). The--allowed-toolsflag is the stated security control for limiting which MCP tools an agent may call.bypassPermissionsmakes this control ineffective.Reproduction Outline
github-readonlyprofile that does not includeget_teamsorget_team_members)./tmp/gh-aw/agent-stdio.logfor the Claude Code entrypoint command — confirm--allowed-toolsis present and omitsmcp__github__get_teamsandmcp__github__get_team_members."permissionMode": "bypassPermissions"and both excluded tools present in the"tools"array./tmp/gh-aw/mcp-config/mcp-servers.json(readable with Bash), send a directtools/callforget_teamsto the MCP gateway.Observed Behavior
Claude Code is started with
--permission-mode bypassPermissionsand--allowed-tools <list>. The agent's session-init tool list contains all tools advertised byawmg-github v0.2.19(22 tools), includingget_team_membersandget_teamswhich are absent from the allowlist. Directtools/callfor these tools succeeds (returns a GitHub API response, not a gateway rejection).Expected Behavior
Either: (1) Claude Code respects
--allowed-toolsand tools absent from the allowlist are unavailable to the agent and rejected at call time; or (2) ifbypassPermissionsis intentional and--allowed-toolscannot be relied on as a security control in automated mode, this must be clearly documented and gateway-side per-session tool enforcement must serve as the effective control.Security Relevance
The
--allowed-toolsflag is the documented mechanism by which workflow authors limit agent capabilities to only the tools declared in their workflow markdown. If this control is silently bypassed bybypassPermissions, agents can call any tool the gateway exposes — including tools from toolsets the workflow author never configured. This widens the effective attack surface beyond the workflow's stated permission model and could allow an agent (or prompt injection in agent input) to invoke sensitive tools the workflow owner did not intend to enable.Additional Context
If
bypassPermissionsis by design (e.g., required for non-interactive operation), this assumption should be documented explicitly alongside the security model. TheAGENTS.mdinstructions and gh-aw documentation currently list tool allowlists as a key security feature without acknowledging that the allowlist has no effect inbypassPermissionsmode. Clear documentation of this trade-off would help workflow authors understand what controls are actually enforced.Versions confirmed affected: gh-aw
v0.68.3,awmg-github v0.2.19, Claude Code2.1.98.Original finding: https://github.com/githubnext/gh-aw-security/issues/1889