Skip to main content
The RespondAgent executes defensive actions based on the ThreatVerdict produced by the AnalyzeAgent. It implements strict safety rules, a graduated escalation ladder, and full rollback support.

Response Modules

Guard includes 3 active response modules plus notification and logging:

1. IP Blocker

Blocks malicious source IPs at the firewall level.
FieldDetails
Actionblock_ip
macOSpfctl (Packet Filter)
Linuxiptables
Windowsnetsh advfirewall
Default duration1 hour
Repeat offender duration24 hours
Auto-unblockYes, after configured duration

2. Process Killer

Terminates malicious processes.
FieldDetails
Actionkill_process
MethodSIGTERM first, then SIGKILL after 5-second timeout
Self-protectionCannot kill the Panguard Guard process itself
Cross-platformUses native OS process management APIs

3. File Quarantine

Isolates suspicious files by moving them to a quarantine directory.
FieldDetails
Actionisolate_file
MethodMoves file to quarantine directory with SHA-256 hash recorded
MetadataOriginal path, timestamp, verdict, and hash preserved
RecoveryFiles can be restored from quarantine via the action manifest

Confidence Thresholds

The RespondAgent uses confidence-based decision making:
Confidence RangeBehavior
>= autoRespond (default 90%)Execute action automatically, notify after
>= notifyAndWait (default 70%)Send confirmation request via Chat, wait for human approval
< notifyAndWaitLog the event and send an informational notification
In Learning Mode, all events are logged without active response regardless of confidence.

Safety Rules

The RespondAgent enforces hard safety limits that cannot be overridden:

Whitelisted IPs

These IPs are never blocked, even if they trigger detections:
127.0.0.1, ::1, localhost, 0.0.0.0
Additional IPs can be added via configuration.

Protected Processes

These processes are never killed:
sshd, systemd, init, launchd, node, panguard-guard,
kernel, kthreadd, dockerd, containerd

Protected Accounts

These accounts are never disabled:
root, Administrator, SYSTEM, LocalSystem, admin

Network Isolation Threshold

Network isolation (blocking all traffic from an IP) requires confidence >= 95. This prevents accidental lockouts from aggressive but uncertain detections.

Escalation Ladder

The RespondAgent implements progressive escalation:
ConditionAction
First violation from a sourceNormal thresholds apply
3+ violations from same targetAuto-respond threshold lowered by 10%
Repeat offender (previously blocked)Block duration increased to 24 hours
This means a persistent attacker faces increasingly aggressive responses while first-time anomalies are treated conservatively.

Action Persistence and Rollback

All executed actions are persisted to a JSONL manifest file:
/var/panguard-guard/action-manifest.jsonl
Each entry records:
FieldDescription
timestampWhen the action was executed
actionAction type (block_ip, kill_process, isolate_file)
targetIP address, PID, or file path
verdictFull ThreatVerdict that triggered the action
reversibleWhether the action can be rolled back
rollbackCmdCommand to undo the action

Rollback Examples

ActionRollback
block_ip 203.0.113.50Remove firewall rule after duration expires
isolate_file /tmp/payloadRestore file from quarantine to original path
kill_process 5678Not reversible (process already terminated)

Cross-Platform Command Execution

All OS commands are executed via execFile (never exec) to prevent shell injection:
PlatformIP Block CommandIP Unblock Command
macOSpfctl rule additionpfctl rule removal
Linuxiptables -A INPUT -s <ip> -j DROPiptables -D INPUT -s <ip> -j DROP
Windowsnetsh advfirewall firewall add rulenetsh advfirewall firewall delete rule
The RespondAgent never uses shell: true or string-based command construction. All parameters are passed as array arguments to execFile to prevent command injection vulnerabilities.