Audit logging is essential for production AI agent deployments. Without logs, you can't debug failures, prove compliance, or detect security issues. This guide walks through setting up effective audit logging.
What to log
Every agent action should be logged with:
- Timestamp: When the action occurred
- Agent identifier: Which agent took the action
- Action type: What kind of action (tool call, message, decision)
- Inputs: What was passed to the action
- Outputs: What the action returned
- Result: Success, failure, or partial
- Context: User who triggered, workflow context, etc.
For desktop agents, also log screenshots. For browser agents, log URLs visited.
Platform-specific configuration
Claude Computer Use
- Open Settings → Advanced → Audit Log
- Enable audit logging
- Choose log location (local file or external system)
- Configure log retention (recommend 90 days minimum)
- Enable screenshot logging for visual context
Lindy.ai
- Open Lindy settings → Audit
- Enable audit logging for all Lindies
- Configure log detail level (full recommended)
- Set up log export to external system if needed
Relevance AI
- Open project settings → Logging
- Enable detailed logging for all agents
- Configure log retention
- Set up alerts for error conditions
Using logs effectively
Debugging failures
When an agent fails, logs tell you what happened:
- Find the failed action in the log
- Examine inputs to verify they were correct
- Examine outputs to see what went wrong
- Trace backward to find root cause
Detecting security issues
Set up alerts for:
- Unusual action volumes (potential runaway agent)
- Actions outside normal patterns (potential compromise)
- Failed permission attempts (potential security issue)
- Off-hours activity (potential unauthorized use)
Compliance reporting
For regulated industries, logs support compliance requirements:
- Audit trails for who did what when
- Evidence of appropriate approvals
- Records of data access
Log retention
Retain logs based on your needs:
- Debugging: 30-90 days
- Compliance: 1-7 years depending on regulation
- Security: 1-3 years for forensic analysis
Use tiered storage — recent logs in hot storage, older logs in cold storage.
Common mistakes to avoid
- Not enabling logging initially — enable before first production deployment
- Logging too little — include inputs and outputs, not just timestamps
- Not reviewing logs regularly — set up alerts and weekly reviews
- Storing logs insecurely — logs contain sensitive data, protect them
Next steps
See our AI Agent Safety Guide for the complete safety framework, and our permissions configuration guide for related topics.
Explore more AI agent guides
Browse our complete library of reviews, comparisons, and how-to guides.
Browse all guides