Skip to content

Commit 8cacd7f

Browse files
committed
fix: only auto-verify threats for skills, keep pending for npm/pypi
Opus-confirmed threats are now marked Verified only for skills registry scans. npm and pypi threats remain Pending after Opus verification, requiring human review before affecting risk level.
1 parent 7a68d91 commit 8cacd7f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

crates/worker/src/scanner/agentic.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
use crate::registry::ExtractedPackage;
55
use anyhow::{Context, Result};
6-
use common::{AgenticThreatSummary, ApiDoc, ThreatType, UsageDocs, VerificationStatus};
6+
use common::{AgenticThreatSummary, ApiDoc, Registry, ThreatType, UsageDocs, VerificationStatus};
77
use serde::Deserialize;
88
use std::path::Path;
99
use std::process::Stdio;
@@ -501,6 +501,7 @@ Rules:
501501
&self,
502502
extracted: &ExtractedPackage,
503503
threats: Vec<AgenticThreatSummary>,
504+
registry: Registry,
504505
) -> Result<Vec<AgenticThreatSummary>> {
505506
if threats.is_empty() {
506507
return Ok(vec![]);
@@ -658,8 +659,15 @@ If no threats verified: {{"threats": [], "summary": "No security concerns confir
658659
// Parse the JSON output
659660
let report: OpenCodeThreatReport = self.parse_json_output(&output)?;
660661

661-
// Convert to AgenticThreatSummary — threats confirmed by the verification
662-
// model are marked as Verified so they affect risk level calculation
662+
// Convert to AgenticThreatSummary
663+
// Skills: Opus confirmation is sufficient, mark as Verified
664+
// npm/PyPI: require human review, keep as Pending even after Opus confirms
665+
let post_verify_status = if registry == Registry::Skills {
666+
VerificationStatus::Verified
667+
} else {
668+
VerificationStatus::Pending
669+
};
670+
663671
let verified_threats: Vec<AgenticThreatSummary> = report
664672
.threats
665673
.into_iter()
@@ -668,7 +676,7 @@ If no threats verified: {{"threats": [], "summary": "No security concerns confir
668676
confidence: t.confidence.unwrap_or(0.8),
669677
location: t.location,
670678
snippet: t.snippet,
671-
verification_status: VerificationStatus::Verified,
679+
verification_status: post_verify_status,
672680
})
673681
.collect();
674682

crates/worker/src/scanner/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ impl PackageScanner {
587587
);
588588
match self
589589
.agentic_scanner
590-
.verify_threats(&extracted, agentic_threats.clone())
590+
.verify_threats(&extracted, agentic_threats.clone(), registry)
591591
.await
592592
{
593593
Ok(verified) => verified,

0 commit comments

Comments
 (0)