Merge PR #388: fix --force bypassing dangerous verdict in should_allow_install

Authored by Farukest. Fixes #387.

Removes 'and not force' from the dangerous verdict check so --force
can never install skills with critical security findings (reverse shells,
data exfiltration, etc). The docstring already documented this behavior
but the code didn't enforce it.
This commit is contained in:
teknium1
2026-03-04 19:19:57 -08:00
3 changed files with 113 additions and 1 deletions

View File

@@ -650,7 +650,7 @@ def should_allow_install(result: ScanResult, force: bool = False) -> Tuple[bool,
Returns:
(allowed, reason) tuple
"""
if result.verdict == "dangerous" and not force:
if result.verdict == "dangerous":
return False, f"Scan verdict is DANGEROUS ({len(result.findings)} findings). Blocked."
policy = INSTALL_POLICY.get(result.trust_level, INSTALL_POLICY["community"])