Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/policy/policies/read-only.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ decision = "allow"
priority = 50

[[rule]]
toolName = "codebase_investigator"
toolName = "SubagentInvocation"
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This change broadens the policy from allowing a specific, read-only agent (codebase_investigator) to allowing any tool named SubagentInvocation. This means any current or future subagent invoked through this mechanism will be automatically allowed, regardless of its capabilities (e.g., file writing, shell execution). This poses a potential security risk by granting overly broad permissions.

While the PR title indicates this is a temporary fix, a safer approach would be to make this rule more specific. If the logic that creates the SubagentInvocation tool call can include the agent's name in the arguments (e.g., as agentName), you could use an argsPattern to restrict this permission. The rule would look something like this:

[[rule]]
toolName = "SubagentInvocation"
# This pattern matches if '"agentName":"codebase_investigator"' is in the arguments.
argsPattern = "agentName\\":\\"codebase_investigator"
decision = "allow"
priority = 50

This would ensure only the intended read-only agent is allowed, mitigating the risk of unintentionally permitting more powerful subagents.

decision = "allow"
priority = 50