@@ -693,6 +693,51 @@ nylas admin grants stats # Grant statistics
693693
694694---
695695
696+ ## Audit Logging
697+
698+ Track CLI command execution for compliance, debugging, and AI agent monitoring.
699+
700+ ``` bash
701+ # Setup
702+ nylas audit init # Interactive setup
703+ nylas audit init --enable # Quick setup with defaults
704+ nylas audit logs enable # Enable logging
705+ nylas audit logs disable # Disable logging
706+ nylas audit logs status # Check status
707+
708+ # View logs
709+ nylas audit logs show # Show last 20 entries
710+ nylas audit logs show --limit 50 # More entries
711+ nylas audit logs show --command email # Filter by command
712+ nylas audit logs show --invoker alice # Filter by username
713+ nylas audit logs show --source claude-code # Filter by source (AI agents, etc.)
714+ nylas audit logs show --status error # Filter by status
715+ nylas audit logs show --request-id req_abc123 # Find by Nylas request ID
716+
717+ # Statistics and export
718+ nylas audit logs summary # Summary for last 7 days
719+ nylas audit logs summary --days 30 # Summary for 30 days
720+ nylas audit export --output audit.json # Export to JSON
721+ nylas audit export --output audit.csv # Export to CSV
722+
723+ # Configuration
724+ nylas audit config show # Show configuration
725+ nylas audit config set retention_days 30 # Set retention
726+ nylas audit logs clear # Clear all logs
727+ ```
728+
729+ ** Invoker detection:** Automatically tracks who ran commands:
730+ - ` terminal ` - Interactive terminal session
731+ - ` claude-code ` - Anthropic's Claude Code
732+ - ` github-copilot ` - GitHub Copilot CLI
733+ - ` ssh ` - Remote SSH session
734+ - ` script ` - Non-interactive automation
735+ - Custom via ` NYLAS_INVOKER_SOURCE ` env var
736+
737+ ** Details:** ` docs/commands/audit.md `
738+
739+ ---
740+
696741## Utility Commands
697742
698743``` bash
@@ -735,6 +780,7 @@ All commands follow consistent pattern:
735780- Admin: ` docs/commands/admin.md `
736781- Workflows: ` docs/commands/workflows.md ` (OTP, automation)
737782- Timezone: ` docs/commands/timezone.md `
783+ - Audit: ` docs/commands/audit.md `
738784- AI: ` docs/commands/ai.md `
739785- MCP: ` docs/commands/mcp.md `
740786- TUI: ` docs/commands/tui.md `
0 commit comments