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
|
|
@ -43,7 +43,7 @@ INSTALL_POLICY = {
|
|||
"builtin": ("allow", "allow", "allow"),
|
||||
"trusted": ("allow", "allow", "block"),
|
||||
"community": ("allow", "block", "block"),
|
||||
"agent-created": ("allow", "allow", "block"),
|
||||
"agent-created": ("allow", "allow", "ask"),
|
||||
}
|
||||
|
||||
VERDICT_INDEX = {"safe": 0, "caution": 1, "dangerous": 2}
|
||||
|
|
@ -659,10 +659,17 @@ def should_allow_install(result: ScanResult, force: bool = False) -> Tuple[bool,
|
|||
|
||||
if force:
|
||||
return True, (
|
||||
f"Force-installed despite blocked {result.verdict} verdict "
|
||||
f"Force-installed despite {result.verdict} verdict "
|
||||
f"({len(result.findings)} findings)"
|
||||
)
|
||||
|
||||
if decision == "ask":
|
||||
# Return None to signal "needs user confirmation"
|
||||
return None, (
|
||||
f"Requires confirmation ({result.trust_level} source + {result.verdict} verdict, "
|
||||
f"{len(result.findings)} findings)"
|
||||
)
|
||||
|
||||
return False, (
|
||||
f"Blocked ({result.trust_level} source + {result.verdict} verdict, "
|
||||
f"{len(result.findings)} findings). Use --force to override."
|
||||
|
|
@ -694,7 +701,12 @@ def format_scan_report(result: ScanResult) -> str:
|
|||
lines.append("")
|
||||
|
||||
allowed, reason = should_allow_install(result)
|
||||
status = "ALLOWED" if allowed else "BLOCKED"
|
||||
if allowed is True:
|
||||
status = "ALLOWED"
|
||||
elif allowed is None:
|
||||
status = "NEEDS CONFIRMATION"
|
||||
else:
|
||||
status = "BLOCKED"
|
||||
lines.append(f"Decision: {status} — {reason}")
|
||||
|
||||
return "\n".join(lines)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue