Immune System
The immune system is Cruvero's automated runtime safety monitor. It detects repeated tool anomalies, records reusable failure signatures, and can quarantine tools that exhibit degraded quality or dangerous behavior. Operators resolve anomalies through the vaccinate CLI or approval signals.
Source: internal/agent/immune*.go, cmd/vaccinate/main.go
Overview
The immune subsystem detects repeated tool anomalies, records reusable signatures, and can quarantine unsafe tools.
Core goals:
- stop repeated failure patterns early
- preserve learnings as procedural memory
- provide operator controls for quarantine and remediation
Anomaly Detection
An anomaly signature is built from normalized tool failure context and stored with counters.
Behavior:
- records signature hash and hit count
- increments totals on repeated matches
- supports per-tool thresholds and global thresholds
Config:
CRUVERO_IMMUNE_ENABLEDCRUVERO_IMMUNE_QUARANTINE_THRESHOLDCRUVERO_IMMUNE_TOOL_THRESHOLDSCRUVERO_IMMUNE_TOOL_NO_AUTO
Auto-Quarantine
When thresholds are exceeded, the affected tool can be quarantined.
Behavior:
- quarantined tool execution is blocked by activity guardrails
- optional TTL expiration can auto-release quarantine
- blocked execution emits telemetry and audit events
Config:
CRUVERO_IMMUNE_QUARANTINE_TTLCRUVERO_IMMUNE_CLEANUP_ENABLEDCRUVERO_IMMUNE_CLEANUP_INTERVALCRUVERO_IMMUNE_RETENTION_DAYS
Vaccination Workflow
Vaccination captures a known-good fix and makes it reusable.
CLI:
cmd/vaccinate --signature-hash <hash> --procedure "..." --resolved-by <actor>
Expected outcomes:
- anomaly marked resolved
- procedural memory updated with remediation guidance
- future runs can leverage remediation instructions earlier
Tool Release Workflow
Operators can inspect and release quarantined tools.
CLI:
- list unresolved anomalies:
cmd/vaccinate --list - list quarantined tools:
cmd/vaccinate --quarantine - release tool:
cmd/vaccinate --release <tool> --reason "..."
CLI Reference
cmd/vaccinate flags:
--signature-hash--procedure--resolved-by--list--quarantine--release--reason--tenant
Observability
Alert/snapshot controls:
CRUVERO_IMMUNE_ALERT_ENABLEDCRUVERO_IMMUNE_ALERT_INTERVALCRUVERO_IMMUNE_ALERT_ANOMALY_DELTACRUVERO_IMMUNE_ALERT_QUARANTINE_DELTACRUVERO_IMMUNE_ALERT_BLOCKED_DELTACRUVERO_IMMUNE_SNAPSHOT_ENABLEDCRUVERO_IMMUNE_SNAPSHOT_DIRCRUVERO_IMMUNE_SNAPSHOT_BATCH