Skip to content

fix: use --permission-mode bypassPermissions instead of --dangerously-skip-permissions#4

Merged
melanie531 merged 1 commit intoaws-samples:mainfrom
melanie531:fix/permission-mode-bypass
Mar 19, 2026
Merged

fix: use --permission-mode bypassPermissions instead of --dangerously-skip-permissions#4
melanie531 merged 1 commit intoaws-samples:mainfrom
melanie531:fix/permission-mode-bypass

Conversation

@melanie531
Copy link
Contributor

Problem

CodeBuild (and many CI/CD systems) runs as root. Claude Code v2.1.79 refuses --dangerously-skip-permissions for root users:

--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons

This causes ALL Claude Code invocations to silently produce empty output (0 tokens, 0 tool calls), resulting in artificially low eval scores.

Fix

Replace --dangerously-skip-permissions with --permission-mode bypassPermissions in both _build_cmd_with_skill() and _build_cmd_without_skill(). This achieves the same permission bypass but is allowed for root users.

Testing

  • 652 tests pass
  • Verified locally that --permission-mode bypassPermissions works with Claude Code

…-skip-permissions

CodeBuild runs as root. Claude Code v2.1.79 refuses to use
--dangerously-skip-permissions with root/sudo privileges:
'--dangerously-skip-permissions cannot be used with root/sudo privileges
for security reasons'

This caused ALL Claude Code invocations to silently fail with empty
output, resulting in 0 tokens, 0 tool calls, and artificially low
scores in any CI/CD environment running as root.

Fix: Replace --dangerously-skip-permissions with
--permission-mode bypassPermissions, which achieves the same effect
but is allowed for root users.
@melanie531 melanie531 merged commit ea09cc1 into aws-samples:main Mar 19, 2026
2 checks passed
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.

1 participant