fix(audit): scan all agents including disabled ones

Security audit should scan ALL agents regardless of .agentignore
status — disabled agents may still contain threats.
This commit is contained in:
Willie
2026-04-09 14:49:24 +08:00
parent 353f0cb068
commit 40347477d5
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -508,7 +508,8 @@ func collectInstalledAgentPaths(agentsSourcePath string) ([]auditSkillRef, error
return nil, fmt.Errorf("failed to discover agents: %w", err)
}
var agentPaths []auditSkillRef
for _, d := range resource.ActiveAgents(discovered) {
// Audit scans ALL agents including disabled ones — security risks don't respect .agentignore.
for _, d := range discovered {
agentPaths = append(agentPaths, auditSkillRef{name: d.FlatName, path: d.AbsPath})
}
return agentPaths, nil
+1 -1
View File
@@ -76,7 +76,7 @@ func discoverAuditAgents(source string) ([]skillEntry, error) {
return nil, err
}
var agents []skillEntry
for _, d := range resource.ActiveAgents(discovered) {
for _, d := range discovered {
agents = append(agents, skillEntry{name: d.FlatName, path: d.AbsPath})
}
return agents, nil