-
Notifications
You must be signed in to change notification settings - Fork 5
feat(opencode): add path-based write permissions for Plan+ agent #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -119,8 +119,8 @@ AGENT_ORDER = ["Plan+", "Build+", "AI-DevOps"] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # These are MCP tools that specific agents need access to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AGENT_TOOLS = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Plan+": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Read-only agent - no write/edit/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "write": False, "edit": False, "bash": False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Planning agent - read all, write only to planning files (via permissions), no bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "write": True, "edit": True, "bash": False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since Plan+ now has 🤖 Was this useful? React with 👍 or 👎 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read": True, "glob": True, "grep": True, "webfetch": True, "task": False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "context7_*": True, "osgrep_*": True, "augment-context-engine_*": True, "repomix_*": True | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -278,7 +278,24 @@ def get_agent_config(display_name, filename, subagents=None): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Special permissions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if display_name == "Plan+": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config["permission"] = {"edit": "deny", "write": "deny", "bash": "deny"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Plan+ can read all files, but only write/edit planning files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Path-based permissions: deny by default, allow specific paths | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config["permission"] = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "bash": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "write": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "*": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "TODO.md": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "todo/*": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "todo/**": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "edit": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "*": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "TODO.md": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "todo/*": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "todo/**": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+281
to
+298
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve maintainability and reduce code duplication, you can define the path-based permissions for
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config["permission"] = {"external_directory": "allow"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line enables limited writing, but the later “Output Constraints” section still says “Acknowledge read-only limitation” / “Never attempt writes,” which seems contradictory and may cause Plan+ to avoid using the new planning-file write capability.
🤖 Was this useful? React with 👍 or 👎