mirror of
https://github.com/mblanke/GooseStrike.git
synced 2026-03-01 14:00:21 -05:00
Add integration test endpoints for n8n and Ollama
This commit is contained in:
28
app/agents/exploit_agent.py
Normal file
28
app/agents/exploit_agent.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Exploit correlation agent."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
from .base_agent import AgentResult, BaseAgent
|
||||
|
||||
|
||||
class ExploitAgent(BaseAgent):
|
||||
name = "exploit"
|
||||
|
||||
def build_prompt(self, context: Dict[str, Any]) -> str:
|
||||
exploits = context.get("exploits", [])
|
||||
lines = ["Summarize how existing public exploits might apply."]
|
||||
for exploit in exploits:
|
||||
lines.append(
|
||||
f"{exploit.get('source')} -> {exploit.get('title')} references {exploit.get('cve_id')}"
|
||||
)
|
||||
lines.append("Provide validation ideas and defensive considerations only.")
|
||||
return "\n".join(lines)
|
||||
|
||||
def parse(self, raw: str) -> Dict[str, Any]:
|
||||
notes = [line.strip() for line in raw.split('\n') if line.strip()]
|
||||
return {"exploit_notes": notes}
|
||||
|
||||
|
||||
def run(context: Dict[str, Any]) -> AgentResult:
|
||||
return ExploitAgent().run(context)
|
||||
Reference in New Issue
Block a user