mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(skills_guard): agent-created dangerous skills ask instead of block
Changes the policy for agent-created skills with critical security findings from 'block' (silently rejected) to 'ask' (allowed with warning logged). The agent created the skill, so blocking it entirely is too aggressive — let it through but log the findings. - Policy: agent-created dangerous changed from block to ask - should_allow_install returns None for 'ask' (vs True/False) - format_scan_report shows 'NEEDS CONFIRMATION' for ask - skill_manager_tool.py caller handles None (allows with warning) - force=True still overrides as before Based on PR #2271 by redhelix (closed — 3200 lines of unrelated Mission Control code excluded).
This commit is contained in:
parent
887e8a8d84
commit
0b370f2dd9
3 changed files with 26 additions and 8 deletions
|
|
@ -59,9 +59,15 @@ def _security_scan_skill(skill_dir: Path) -> Optional[str]:
|
|||
try:
|
||||
result = scan_skill(skill_dir, source="agent-created")
|
||||
allowed, reason = should_allow_install(result)
|
||||
if not allowed:
|
||||
if allowed is False:
|
||||
report = format_scan_report(result)
|
||||
return f"Security scan blocked this skill ({reason}):\n{report}"
|
||||
if allowed is None:
|
||||
# "ask" — allow but include the warning so the user sees the findings
|
||||
report = format_scan_report(result)
|
||||
logger.warning("Agent-created skill has security findings: %s", reason)
|
||||
# Don't block — return None to allow, but log the warning
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.warning("Security scan failed for %s: %s", skill_dir, e, exc_info=True)
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue