fix(security): block agent-created skills when scan verdict requires confirmation - #4348
Closed
dlkakbs wants to merge 1 commit into
Closed
fix(security): block agent-created skills when scan verdict requires confirmation#4348dlkakbs wants to merge 1 commit into
dlkakbs wants to merge 1 commit into
Conversation
…confirmation The `should_allow_install()` policy table declares `ask` (None) for agent-created skills with a `dangerous` verdict, meaning the user must confirm before installation. The previous implementation silently logged a warning and allowed the skill through, making the `ask` gate a no-op. A prompt-injected agent reading a malicious web page could exploit this to write a persistent skill with critical security findings (e.g. secret exfiltration via curl) and have it installed without any user confirmation. Now when `allowed is None`, `_security_scan_skill` returns the scan report as an error string — the same treatment as `allowed is False` — so the skill create/edit path surfaces the findings to the user and halts. Adds three tests covering ask-blocked, still-blocked, and safe-passes cases.
Contributor
|
Thanks for the careful security analysis and the well-structured PR, @dlkakbs! This is an automated hermes-sweeper review. The bug you identified —
The security concern you raised is valid and was taken seriously — it directly informed the design of the opt-in gate. Closing as implemented on main. |
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.
What does this PR do?
The
should_allow_install()policy table inskills_guard.pydeclaresask(returnsNone) for agent-created skills with adangerousverdict, meaning the user must confirm before installation proceeds:The previous implementation in
_security_scan_skill()silently logged a warning and returnedNone(allowed) whenshould_allow_installreturnedNone, making theaskgate a complete no-op:Security Impact
A prompt-injected agent (e.g. reading a malicious web page via
web_extractorbrowser_navigate) could exploit this to write a persistent skill containing critical-severity patterns — secret exfiltration viacurl, reading~/.hermes/auth.json, etc. — and have it installed without any user confirmation. The skill would then execute in subsequent agent sessions.Fix
When
allowed is None,_security_scan_skillnow returns the scan report as an error string, identical to theallowed is Falsepath. The skill create/edit path already surfaces any non-None return as a failure to the caller, so no other changes are needed.Tests
Three new tests in
TestSecurityScanAskPolicy:test_ask_verdict_is_blocked—allowed=Nonemust return an error string, notNonetest_blocked_verdict_still_blocked—allowed=Falsepath unaffectedtest_safe_verdict_passes—allowed=Truestill returnsNone(no error)Related
Type of Change
Checklist