fix: deny bash/interactive_bash for Prometheus agent (#2273)#2414
Open
guazi04 wants to merge 1 commit intocode-yeongyu:devfrom
Open
fix: deny bash/interactive_bash for Prometheus agent (#2273)#2414guazi04 wants to merge 1 commit intocode-yeongyu:devfrom
guazi04 wants to merge 1 commit intocode-yeongyu:devfrom
Conversation
Prometheus's prometheus-md-only hook only blocks Write/Edit tools, but bash commands (cp, rm, python3 -c, etc.) can bypass file restrictions. This adds bash and interactive_bash to the deny list in tool-config-handler. - Added bash: deny and interactive_bash: deny to Prometheus tool permissions - Added 4 new tests covering the deny behavior
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Simple targeted change to deny bash tools for Prometheus with comprehensive tests ensuring no impact on other agents. Low risk and follows a proven pattern.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Closes #2273 — Prometheus agent can bypass file write restrictions via bash/interactive_bash tools.
Context
The
prometheus-md-onlyhook blocksWriteandEdittools, but Prometheus can still modify files via bash commands (cp,rm,python3 -c, etc.).Three approaches were considered:
Why Option C works
Prometheus needs bash for one thing: inspecting the codebase. But we already have purpose-built read-only tools:
cat,head,tailRead(with offset/limit)grep,rgGrepfind,lsGloblsp_goto_definition,lsp_find_references,lsp_symbolsOracle, Librarian, and Explore are all read-only agents that operate without bash — and they work well. Prometheus would follow the same proven pattern.
Changes
src/plugin-handlers/tool-config-handler.ts— Added bash and interactive_bash deny rules to Prometheus agent permissionssrc/plugin-handlers/tool-config-handler.test.ts— Added 4 new tests verifying the deny behavior for both toolsTesting
Summary by cubic
Deny
bashandinteractive_bashfor the Prometheus agent to stop command-based write/edit bypasses and keep the agent read-only. Closes #2273.bashandinteractive_bashto "deny" for Prometheus insrc/plugin-handlers/tool-config-handler.ts.Written for commit 403efd7. Summary will update on new commits.