You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[8329] fix(SDK): Require Bash approval under Ask policy - #8332
Under Ask, Claude could run Bash without sending an approval request to the runner. The SDK now writes an explicit Bash ask rule into Claude's settings. Authored Bash allow rules cannot bypass Ask in either Claude settings or the runner plan.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
When the permission default is set to ask, Bash commands now prompt for approval instead of being allowed by authored Bash permissions.
Other authored permissions, such as read access, continue to apply as configured.
The ask behavior also applies when no authored permissions are provided.
When the permission default is ask, authored Bash allow rules are excluded from derived permissions, and Claude settings add Bash to the ask rules. Tests cover permission derivation and the rendered settings.
Changes: Bash Ask Permissions
Layer / File(s)
Summary
Permission rule derivation and wiring sdks/python/agenta/sdk/agents/permission_rules.py, sdks/python/agenta/sdk/agents/dtos.py, sdks/python/oss/tests/pytest/unit/agents/test_dtos_harness_configs.py
The rule helper recognizes Bash patterns and omits authored Bash allow rules when the default is ask. The harness template passes the selected default to the helper. Tests cover Pi and Claude configurations.
Claude settings rendering sdks/python/agenta/sdk/agents/adapters/claude_settings.py, sdks/python/oss/tests/pytest/unit/agents/adapters/test_claude_settings.py
When the default is ask, Claude settings add Bash to ask rules and exclude authored Bash allow rules. Tests cover the rendered rules and the unset-tool case.
Agenta-AI/agenta#8331: This PR addresses the same issue by adding a Bash ask rule to Claude settings.
Merge Risk: Minimal · up to a44d8
Under the Ask policy, Bash now requires approval and authored Bash allow rules no longer bypass it. The tests that were run cover the changed behavior. Confirm with a live Claude Code approval check before relying on it in production.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: Bash under the Ask policy now requires approval. It also follows the conventional commit style and references the issue number. The changeset adds a Bash ask rule to C…
Description check
The description states the problem, the fix (an explicit Bash ask rule in Claude settings, and authored Bash allow rules no longer bypass Ask), the tests run, and a QA follow-up. These match the raw s…
Linked Issues check
Issue #8329 requires that a Bash call under the Ask policy request approval, as a Write call does. The reviewed head implements this in two places. (1) In sdks/python/agenta/sdk/agents/adapters/claude…
Out of Scope Changes check
All reviewed changes address the Bash-under-Ask objective of #8329. The changes are in the Claude settings adapter, the shared permission-rule helper, the DTO wiring that passes permission_default, an…
Full details: Title check
Explanation
The title names the main change: Bash under the Ask policy now requires approval. It also follows the conventional commit style and references the issue number. The changeset adds a Bash ask rule to Claude settings and drops authored Bash allow rules under Ask, which matches the title.
Full details: Description check
Explanation
The description states the problem, the fix (an explicit Bash ask rule in Claude settings, and authored Bash allow rules no longer bypass Ask), the tests run, and a QA follow-up. These match the raw summary's changes to claude_settings.py, permission_rules.py, dtos.py, and the test files.
Full details: Linked Issues check
Explanation
Issue #8329 requires that a Bash call under the Ask policy request approval, as a Write call does. The reviewed head implements this in two places. (1) In sdks/python/agenta/sdk/agents/adapters/claude_settings.py, when permission_default is "ask", authored Bash allow rules are removed through is_bash_rule before the merge, so Claude settings do not allow Bash. The raw summary states that "Bash" is added to the merged ask rules. The visible portion of the file at head supports the removal logic, but the ask-rule addition lies past the read truncation. (2) In sdks/python/agenta/sdk/agents/permission_rules.py, wire_author_permission_rules(slice_, permission_default) omits authored Bash allow rules when permission_default is "ask". The file at head confirms this logic. dtos.py passes permission_default through, per the summary. Tests in test_claude_settings.py and test_dtos_harness_configs.py cover the Ask behavior, including an authored Bash allow rule. The issue's permissions-screen clause applies only when Bash is excluded from Ask on purpose. This PR keeps Bash under Ask, so that clause does not apply. The live Claude Code approval check is a non-coding QA follow-up and is excluded from this assessment. Limits: the text diff could not be read because changed blobs were missing, so the verdict relies on head file reads and the supplied summary.
Full details: Out of Scope Changes check
Explanation
All reviewed changes address the Bash-under-Ask objective of #8329. The changes are in the Claude settings adapter, the shared permission-rule helper, the DTO wiring that passes permission_default, and tests for these paths. The helper change adds is_bash_rule and an optional permission_default parameter with default "allow_reads", so behavior is unchanged for other defaults. The commit that added and then reverted a demo-settings documentation change nets to no change. No unrelated behavior change was identified. Limits: the full diff could not be read, so this rests on the supplied summary and the head file reads.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Under Ask, Claude could run Bash without sending an approval request to the runner. The SDK now writes an explicit Bash ask rule into Claude's settings. Authored Bash allow rules cannot bypass Ask in either Claude settings or the runner plan.
Fixes #8329.
Testing
Verified locally
uv run --no-sync pytest oss/tests/pytest/unit/agents/adapters/test_claude_settings.py oss/tests/pytest/unit/agents/test_dtos_harness_configs.py -q— 263 passed.git diff --checkpassed.Added or updated tests
QA follow-up
Demo
Checklist
Ruff lint still reports findings across these files; I did not include a broad lint cleanup in this fix.