Pipeline Flow
null (no rules matched, no threat intel hit), the event is considered benign and skipped. Otherwise, the full pipeline executes.
DetectAgent
Source:packages/panguard-guard/src/agent/detect-agent.ts
Responsibilities
- ATR rule matching — runs the event against all loaded rules via the
RuleEngine - Threat intelligence lookup — checks source/destination IPs against 5 feed sources plus Threat Cloud blocklists (supports IPv4 and IPv6)
- Deduplication — skips identical detections within a 60-second window (max 500 entries in the dedup map)
- Event correlation — both legacy IP-based correlation (3+ events from same source IP in 5 minutes) and advanced pattern-based correlation via the
EventCorrelator(7 attack patterns)
Internal State
AnalyzeAgent
Source:packages/panguard-guard/src/agent/analyze-agent.ts
Evidence Sources and Weights
The AnalyzeAgent collects evidence from multiple sources and calculates a weighted confidence score (0—100):
Weight distribution adapts to available sources:
Feedback Loop
The AnalyzeAgent maintains a per-rule feedback history:- High false-positive rate — confidence reduced by up to 30%
- High true-positive rate — confidence increased by up to 10%
Contradiction Detection
If a high-severity rule fires but the baseline shows no deviation, confidence is reduced by 10 points. This prevents over-alerting on events that match a rule pattern but are normal for the specific environment.RespondAgent
Source:packages/panguard-guard/src/agent/respond-agent.ts
Confidence-Based Actions
Available Actions
Full details on safety rules and escalation are covered in Auto-Response.
ReportAgent
Source:packages/panguard-guard/src/agent/report-agent.ts
Responsibilities
- JSONL Logging — writes complete event records with log rotation (50 MB per file, 10 rotated files, 90-day retention)
- Baseline Updates — during learning mode, continuously updates the behavioral baseline with observed patterns
- Anonymization — IP addresses are /16-anonymized (last two octets zeroed) before Threat Cloud upload
- Summary Generation — produces daily (24h) and weekly (7d) summaries with top attack sources, action breakdown, and verdict distribution