Skip to content

Conversation

@abhipatel12
Copy link
Collaborator

Fix forward for codebase investigator needing to be allowed via user confirmation.

@abhipatel12 abhipatel12 requested a review from a team as a code owner December 12, 2025 19:22
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @abhipatel12, 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 introduces a temporary fix by adjusting a policy configuration to explicitly allow SubagentInvocation. This change addresses the immediate need for the codebase investigator to operate without requiring user confirmation, serving as an interim solution until the broader subagent delegation feature is fully merged.

Highlights

  • Policy Update: The read-only.toml policy has been updated to change the allowed tool from codebase_investigator to SubagentInvocation.
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.

@github-actions
Copy link

Size Change: -2 B (0%)

Total Size: 21.6 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 21.6 MB -2 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

Copy link
Contributor

@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 updates a policy rule in read-only.toml to allow SubagentInvocation as a temporary fix for running the codebase_investigator subagent. This change, however, introduces two significant security concerns. First, the codebase_investigator agent is susceptible to a high-severity prompt injection vulnerability, which could allow an attacker to exfiltrate sensitive data by overriding its intended function. Second, the updated policy rule is overly broad, granting automatic execution permission to any tool named SubagentInvocation, not just the read-only codebase_investigator, thereby risking misuse by more powerful subagents. It is recommended to address the prompt injection by sanitizing the agent's input and to refine the policy rule, potentially using an argsPattern, to restrict permissions specifically to the codebase_investigator.


[[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.

@abhipatel12 abhipatel12 added this pull request to the merge queue Dec 12, 2025
Merged via the queue into main with commit edbe548 Dec 12, 2025
20 checks passed
@abhipatel12 abhipatel12 deleted the fix/subagent-invocation-policy branch December 12, 2025 19:58
@abhipatel12
Copy link
Collaborator Author

/patch preview

@github-actions
Copy link

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: edbe5480ca4f76d749462e428dd609344c266fc9
  • Workflows Created: 1

🔗 Track Progress:

github-actions bot pushed a commit that referenced this pull request Dec 12, 2025
@github-actions
Copy link

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #15015
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions
Copy link

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.21.0-preview.4
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.21.0-preview.4-pr-15007

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@abhipatel12
Copy link
Collaborator Author

/patch stable

@github-actions
Copy link

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: stable
  • Commit: edbe5480ca4f76d749462e428dd609344c266fc9
  • Workflows Created: 1

🔗 Track Progress:

github-actions bot pushed a commit that referenced this pull request Dec 12, 2025
…rged to stable (#15007)

# Conflicts:
#	packages/core/src/policy/policies/read-only.toml
@github-actions
Copy link

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #15016
  2. Test your changes after resolving conflicts
  3. Once merged, the patch release will automatically trigger
  4. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions
Copy link

Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

abhipatel12 added a commit that referenced this pull request Dec 12, 2025
@github-actions
Copy link

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: stable → publishing to npm tag latest
  • Version: v0.20.1
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.20.1-pr-15007

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions
Copy link

Patch Release Complete!

📦 Release Details:

  • Version: 0.20.2
  • NPM Tag: latest
  • Channel: stable
  • Dry Run: false

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

thacio added a commit to thacio/auditaria that referenced this pull request Dec 13, 2025
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.

2 participants