Security Logging And Monitoring

Why Agent Logging Matters

Every action your AI agent takes should be logged. Unlike traditional software, AI agents make autonomous decisions — and you need a complete audit trail to understand what happened, why, and whether it was appropriate.

What OpenClaw Logs

OpenClaw captures structured logs for every agent interaction:

Log Configuration

{
  "logging": {
    "level": "info",
    "format": "json",
    "output": ["file", "stdout"],
    "logPath": "./logs/openclaw.log",
    "maxFileSize": "100MB",
    "retentionDays": 90,
    "redactSecrets": true,
    "includeDecisionChain": true
  }
}

Setting Up Monitoring Alerts

Configure real-time alerts for critical security events:

Log Analysis Commands

# View recent security events
openclaw logs --filter security --since 1h

# Export full audit trail
openclaw logs export --format json --output audit.json

# Search for specific actions
openclaw logs search "file_delete" --since 7d
Prompt Guardian
Protect your AI agent from prompt injection and malicious commands.
Explore Prompt Guardian →