mirror of
https://github.com/mblanke/GooseStrike.git
synced 2026-03-01 14:00:21 -05:00
Add roadmap API and mock dashboard
This commit is contained in:
28
app/agents/cve_agent.py
Normal file
28
app/agents/cve_agent.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""CVE triage agent."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
from .base_agent import AgentResult, BaseAgent
|
||||
|
||||
|
||||
class CVEAgent(BaseAgent):
|
||||
name = "cve"
|
||||
|
||||
def build_prompt(self, context: Dict[str, Any]) -> str:
|
||||
cves = context.get("cves", [])
|
||||
lines = ["You are prioritizing CVEs for a legal assessment."]
|
||||
for cve in cves:
|
||||
lines.append(
|
||||
f"{cve.get('cve_id')}: severity={cve.get('severity')} score={cve.get('score')} desc={cve.get('description','')[:120]}"
|
||||
)
|
||||
lines.append("Provide prioritized actions and validation steps. No exploit code.")
|
||||
return "\n".join(lines)
|
||||
|
||||
def parse(self, raw: str) -> Dict[str, Any]:
|
||||
recommendations = [line.strip() for line in raw.split('\n') if line.strip()]
|
||||
return {"cve_actions": recommendations}
|
||||
|
||||
|
||||
def run(context: Dict[str, Any]) -> AgentResult:
|
||||
return CVEAgent().run(context)
|
||||
Reference in New Issue
Block a user