Skip to content

Comments

feat(plan+): add granular bash permissions for file discovery#123

Merged
marcusquinn merged 1 commit intomainfrom
feature/plan-plus-granular-bash
Jan 18, 2026
Merged

feat(plan+): add granular bash permissions for file discovery#123
marcusquinn merged 1 commit intomainfrom
feature/plan-plus-granular-bash

Conversation

@marcusquinn
Copy link
Owner

Summary

  • Enable bash tool for Plan+ with granular permissions for read-only file discovery
  • Set Plan+ as the default agent for OpenCode startup
  • Update documentation to reflect new capabilities

Changes

Granular Bash Permissions for Plan+

Plan+ can now run these read-only commands directly (no more asking for one-time access):

Command Purpose
git ls-files* List tracked files (fastest)
git status* Check repo state
git log* View commit history
git diff* View changes
git branch* List/check branches
git show* View commit details
fd * / fd -e * / fd -g * Find files
rg --files* List files matching pattern

All other bash commands remain denied - Plan+ cannot modify files via bash.

Default Agent

  • Set default_agent: "Plan+" in OpenCode config
  • Plan+ is now auto-selected on startup (first in Tab cycle)

Why

  1. Performance: git ls-files and fd are 10x faster than mcp_glob
  2. UX: No more asking users for one-time bash permission
  3. Safety: Granular permissions maintain Plan+'s read-only nature for code

Related

  • Closes t018 (phases 3 & 4)
  • t010 already complete (build-agent/build-mcp kept as subagents)

- Enable bash tool for Plan+ with granular permissions
- Allow read-only commands: git ls-files/status/log/diff/branch/show, fd, rg --files
- Deny all other bash commands to maintain safety
- Set Plan+ as default_agent for OpenCode startup
- Update plan-plus.md and AGENTS.md documentation

Closes #t018 (partial - phases 3 & 4)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3e6e5fa and 5d65728.

📒 Files selected for processing (3)
  • .agent/AGENTS.md
  • .agent/plan-plus.md
  • .agent/scripts/generate-opencode-agents.sh

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Plan+ agent by introducing granular Bash permissions for read-only file discovery, significantly improving performance and user experience by eliminating the need for repeated manual approvals. Additionally, it sets Plan+ as the default agent for OpenCode, streamlining the initial setup. These changes aim to make file exploration faster and more intuitive while maintaining the agent's read-only safety profile.

Highlights

  • Granular Bash Permissions for Plan+ Agent: The Plan+ agent can now execute specific read-only Bash commands (like 'git ls-files', 'fd', 'rg --files') for efficient file discovery without requiring explicit user approval for each command.
  • Plan+ Set as Default Agent: OpenCode will now automatically select Plan+ as the default agent upon startup, improving the initial user experience.
  • Documentation Updates: The agent documentation has been updated to reflect these new capabilities and guidelines for using the granular Bash permissions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sonarqubecloud
Copy link

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 272 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Jan 18 18:35:14 UTC 2026: Code review monitoring started
Sun Jan 18 18:35:14 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 272
Sun Jan 18 18:35:14 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sun Jan 18 18:35:16 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 272
  • VULNERABILITIES: 0

Generated on: Sun Jan 18 18:35:58 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 973db0c into main Jan 18, 2026
9 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a great enhancement by providing the Plan+ agent with granular bash permissions for read-only file discovery, which improves performance and user experience. Setting Plan+ as the default agent is also a sensible change. The implementation is well-done, particularly the security-conscious approach of an allow-list with a default-deny policy for bash commands. My review includes a few suggestions to improve documentation consistency and remove a small redundancy in the configuration script. Overall, these are excellent changes.

Comment on lines +138 to +141
**Plan+ has granular bash permissions**: Plan+ can run read-only file discovery commands directly:
- `git ls-files`, `git status`, `git log`, `git diff`, `git branch`, `git show`
- `fd -e`, `fd -g` (file finder)
- `rg --files` (ripgrep file listing)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of allowed commands is inconsistent with the implementation in generate-opencode-agents.sh. The implementation allows wildcards (e.g., git status*) and also includes fd *, fd -e *, and fd -g *. To avoid confusion, please update this documentation to accurately reflect the granted permissions. Including the * and the missing fd commands would be more accurate.

Suggested change
**Plan+ has granular bash permissions**: Plan+ can run read-only file discovery commands directly:
- `git ls-files`, `git status`, `git log`, `git diff`, `git branch`, `git show`
- `fd -e`, `fd -g` (file finder)
- `rg --files` (ripgrep file listing)
**Plan+ has granular bash permissions**: Plan+ can run read-only file discovery commands directly:
- `git ls-files*`, `git status*`, `git log*`, `git diff*`, `git branch*`, `git show*`
- `fd *`, `fd -e *`, `fd -g *` (file finder)
- `rg --files*` (ripgrep file listing)

Comment on lines +100 to +109
| Command | Use Case |
|---------|----------|
| `git ls-files 'pattern'` | List tracked files (fastest) |
| `fd -e ext` or `fd -g 'pattern'` | Find files (respects .gitignore) |
| `rg --files -g 'pattern'` | List files matching pattern |
| `git status` | Check repo state |
| `git log` | View commit history |
| `git diff` | View changes |
| `git branch` | List/check branches |
| `git show` | View commit details |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The table of commands is helpful, but it's slightly inconsistent with the actual permissions being granted in generate-opencode-agents.sh. The implementation allows wildcards (e.g., git status*) and additional fd commands, which are not fully reflected here. This might be confusing for agent developers. To improve clarity and accuracy, I suggest updating the 'Command' column to include the wildcards and all allowed commands.

Suggested change
| Command | Use Case |
|---------|----------|
| `git ls-files 'pattern'` | List tracked files (fastest) |
| `fd -e ext` or `fd -g 'pattern'` | Find files (respects .gitignore) |
| `rg --files -g 'pattern'` | List files matching pattern |
| `git status` | Check repo state |
| `git log` | View commit history |
| `git diff` | View changes |
| `git branch` | List/check branches |
| `git show` | View commit details |
| Command | Use Case |
|---------|----------|
| `git ls-files*` | List tracked files (fastest) |
| `fd *`, `fd -e *`, `fd -g *` | Find files (respects .gitignore) |
| `rg --files*` | List files matching pattern |
| `git status*` | Check repo state |
| `git log*` | View commit history |
| `git diff*` | View changes |
| `git branch*` | List/check branches |
| `git show*` | View commit details |

Comment on lines +295 to +296
"fd -e *": "allow",
"fd -g *": "allow",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The permission "fd *": "allow" on line 294 seems to make these two lines redundant. Assuming the matching logic checks if the command starts with the pattern (without the *), fd * would already cover commands like fd -e ... and fd -g .... To keep the configuration concise, you could remove these two lines.

@augmentcode
Copy link

augmentcode bot commented Jan 18, 2026

🤖 Augment PR Summary

Summary: This PR updates the Plan+ agent to support faster, read-only file discovery by allowing a small set of Bash commands, and makes Plan+ the default OpenCode agent on startup.

Changes:

  • Documented Plan+’s new granular Bash allowlist for file discovery (preferring git ls-files/fd/rg --files over mcp_glob).
  • Enabled the Bash tool for Plan+ in the OpenCode agent generator and added a command-pattern allowlist with a default deny.
  • Set default_agent to Plan+ in generated opencode.json so it’s auto-selected on startup.

Technical Notes: Plan+ remains restricted via path-based write/edit permissions (planning files only), while Bash access is intended to be constrained to specific read-only discovery commands.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

"write": True, "edit": True, "bash": False,
# Planning agent - read all, write only to planning files (via permissions)
# Bash enabled with granular permissions for read-only file discovery commands
"write": True, "edit": True, "bash": True,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-enabling bash for Plan+ is security-sensitive given Plan+’s “read-only” positioning; it’d be worth double-checking that OpenCode actually enforces the command-level permission.bash allowlist (and fails closed if the syntax is unsupported). This helps avoid a regression where bash: true effectively becomes unrestricted.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

"git diff*": "allow",
"git branch*": "allow",
"git show*": "allow",
"fd *": "allow",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing fd * may unintentionally permit flags like fd -x/--exec, which can run arbitrary commands and break the intended read-only guarantees. Similar risk can apply to other broadly-wildcarded allowlist entries if the underlying tool supports “execute” or “write output to file” options.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

| `git branch` | List/check branches |
| `git show` | View commit details |

**All other bash commands are denied** - Plan+ cannot modify files via bash.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement assumes the granular permission.bash allowlist is reliably enforced; note .agent/tools/opencode/opencode.md currently documents that bash: true can write/modify files. Consider aligning that doc (or clarifying here) so readers don’t get conflicting guidance.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@marcusquinn marcusquinn deleted the feature/plan-plus-granular-bash branch February 21, 2026 01:59
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