Operating Modes

Understand monitor, alert, enforce, and debug modes for runtime protection.

Docs / Operating Modes

Operating Modes

PandoCore uses a three-tier escalation model — Monitor → Alert → Enforce — controlling how it responds when anomalous behavior is detected. Choose the mode that matches your deployment stage and risk tolerance.

Mode Comparison

Mode Detection Evidence Alerts (Slack) Pod Termination Use Case
Monitor Initial deployment, tuning, evaluation
Alert Production visibility without enforcement
Enforce Full production protection
Debug Troubleshooting, development

Monitor Mode

Set via: PANDO_MODE=monitor

Monitor mode is the recommended starting point for all deployments. PandoCore detects anomalies and generates evidence but does not terminate pods.

ℹ️ Default Mode

Monitor mode is the default. You don't need to set any configuration to use it.

Behavior

When to Use

Example Output

{
  "level": "warn",
  "timestamp": "2026-03-16T14:30:00Z",
  "message": "drift_detected",
  "mode": "monitor",
  "drift_score": 0.67,
  "threshold_exceeded": "cumulative",
  "action": "logged_only"
}

Alert Mode

Set via: PANDO_MODE=alert

Alert mode adds real-time notifications to monitoring. When anomalous behavior is detected, PandoCore sends alerts to Slack (and other configured destinations) so your team is notified immediately — but pods are not terminated.

Requires Configuration

Alert mode requires a Slack incoming webhook URL. Set PANDO_SLACK_WEBHOOK_URL or configure slackWebhookURL in Helm values.

Behavior

When to Use

Example Alert

Slack alerts are color-coded by severity:

Enforce Mode

Set via: PANDO_MODE=enforce

Enforce mode provides active protection. When anomalous behavior is detected and exceeds configured thresholds, PandoCore generates evidence, sends alerts, and terminates the compromised pod.

⚠️ Production Use

Before enabling enforce mode, run in monitor mode for at least one week in staging to ensure thresholds are appropriately tuned for your workload.

Behavior

Response Sequence

  1. Detection: Drift exceeds configured threshold
  2. Evidence generation: Structured evidence record created
  3. Evidence externalization: Written to logs, K8s events, webhooks
  4. Alert dispatch: Slack notification sent (if configured)
  5. Network isolation: NetworkPolicy applied to restrict pod egress traffic
  6. Escalation: If anomalous behavior persists past configurable timer, escalate to termination
  7. Pod termination: Kubernetes API DELETE call
  8. Pod restart: Kubernetes scheduler creates new pod
  9. Fresh baseline: New sidecar establishes clean baseline

When to Use

Example Output

{
  "level": "error",
  "timestamp": "2026-03-16T14:30:00Z",
  "message": "enforcement_triggered",
  "mode": "enforce",
  "drift_score": 0.67,
  "threshold_exceeded": "cumulative",
  "action": "pod_terminated",
  "evidence_id": "abc123-def456"
}

Debug Mode

Set via: PANDO_MODE=debug

Debug mode provides verbose logging for troubleshooting and development. It outputs detailed information about every sample collected and all internal decisions.

⚠️ Log Volume

Debug mode generates significantly more log output. Use only for troubleshooting, not in production.

Behavior

When to Use

Switching Modes

You can change the operating mode at runtime without redeploying:

Switch to Monitor Mode

kubectl set env deployment/your-app -c pando-sidecar PANDO_MODE=monitor

Switch to Alert Mode

kubectl set env deployment/your-app -c pando-sidecar PANDO_MODE=alert

Switch to Enforce Mode

kubectl set env deployment/your-app -c pando-sidecar PANDO_MODE=enforce

Switch to Debug Mode

kubectl set env deployment/your-app -c pando-sidecar PANDO_MODE=debug
ℹ️ Rolling Update

Changing the mode triggers a rolling restart of the deployment. The new pods will start with the updated mode and establish fresh baselines.

Recommended Deployment Path

  1. Week 1-2: Monitor mode — Deploy to staging with PANDO_MODE=monitor. Observe detections, tune thresholds if needed.
  2. Week 3-4: Alert mode — Switch to PANDO_MODE=alert in production. Your team gets notified on detections without enforcement.
  3. Week 5+: Enforce mode — Enable PANDO_MODE=enforce for full active protection with alerts and pod termination.

Mode-Specific Metrics

PandoCore exposes the current mode via Prometheus metrics:

# Current operating mode (1 = active)
pando_mode_monitor{pod="your-pod"} 1
pando_mode_alert{pod="your-pod"} 0
pando_mode_enforce{pod="your-pod"} 0
pando_mode_debug{pod="your-pod"} 0

# Enforcement events (only in enforce mode)
pando_enforcements_total{pod="your-pod"} 3

HTTP Endpoints

PandoCore exposes several HTTP endpoints on port 9090 for health checks, monitoring, and operational control:

Endpoint Method Description
/healthz GET Health check — returns 200 if healthy, 503 if unhealthy
/readyz GET Readiness check — returns 200 when ready to serve
/metrics GET Prometheus metrics endpoint
/relearn POST Trigger re-learning phase to recalibrate thresholds
/approve-model-refresh POST Approve pending ML model refresh (if approval required)
/status GET JSON summary of sidecar state: version, mode, uptime, drift, detection counts

Re-Learning Triggers

You can trigger re-learning in two ways:

# HTTP endpoint (within pod network)
kubectl exec -it POD_NAME -c pando-sidecar -- \
  curl -X POST http://localhost:9090/relearn

# SIGUSR1 signal (Linux only)
kubectl exec -it POD_NAME -c pando-sidecar -- \
  kill -USR1 1

Re-learning is useful when:

Next Steps