Self-Audit Daemon

The self-audit daemon runs continuous security and health checks in the background, producing JSON reports.

Overview

The daemon performs 12 checks at regular intervals:

CheckDescription
Memory usageMonitor RAM consumption
Disk spaceCheck available storage
API key rotationRemind about old keys
Session cleanupRemove stale sessions
Audit log rotationManage log file size
Config integrityValidate configuration
Token expiryCheck OAuth token freshness
MCP healthPing MCP servers
Process healthMonitor agent process
Network connectivityBasic connectivity check
Dependency versionsCheck for outdated packages
File permissionsVerify security-sensitive file permissions

Reports

Reports are saved as JSON in ~/.pocketclaw/audit/:

{
"timestamp": "2024-01-15T10:00:00Z",
"checks": [
{"name": "memory_usage", "status": "pass", "value": "245MB"},
{"name": "disk_space", "status": "pass", "value": "45GB free"},
{"name": "api_key_age", "status": "warn", "value": "90 days old"},
{"name": "session_count", "status": "pass", "value": "23 active"}
],
"summary": {
"passed": 10,
"warnings": 1,
"failures": 1
}
}

Activation

The self-audit daemon starts automatically with the web dashboard. It can also be triggered manually via the dashboard’s settings.