Overview
Moss provides comprehensive audit logging to help you meet compliance requirements and investigate security incidents. Every API request can be tracked, reviewed, and analyzed.What Gets Logged
Inbound Requests (SDK to Backend)
Outbound Requests (Backend to External Services)
Sensitive Data Redaction
All audit logs are automatically sanitized before storage:Redacted Fields
The following fields are automatically redacted:api_key,apiKeyauthorizationpasswordsecrettokenx-api-key
Redaction Example
Redaction is recursive - nested objects and arrays are also sanitized.
Per-Application Control
Audit logging can be enabled or disabled per application:Dashboard Configuration
Navigate to Settings > Developer Options > Audit Logging to enable or disable logging for your application.Considerations
Accessing Audit Logs
Dashboard Access
View audit logs in the Dashboard under Configure > Audit Log. Features:- Filter by date range
- Filter by user or session
- Filter by endpoint or status
- Export to CSV
API Access
Query audit logs programmatically using the Audit API:page and page_size, and can be narrowed with actor_id, action, target_type, outcome, start_date, and end_date.
Audit API Key
A separate API key is used for audit log access:- Isolated Access - Audit key is separate from SDK API key
- Read-Only - Cannot modify logs or other data
- Revocable - Can be revoked independently
Log Retention
Retention is configurable per plan. Contact us for the retention period that applies to your account, or to arrange a custom period based on your compliance requirements.Use Cases
Compliance Reporting
Generate reports for auditors:- Filter logs by date range
- Export to CSV
- Include in compliance documentation
Security Investigation
Investigate suspicious activity:- Identify the user or session
- Review all related requests
- Check for anomalous patterns
- Export evidence for incident response
Performance Analysis
Analyze API usage patterns:- Review request durations
- Identify slow endpoints
- Track LLM token usage
- Optimize based on data
Cost Analysis
Track LLM usage costs:- Review token counts per model
- Identify high-usage sessions
- Optimize prompts and context
Log Integrity
Immutability
Audit logs are immutable once created:- Logs cannot be modified after creation
- Logs cannot be deleted by application owners
- Deletion only through data retention policies
Timestamps
All timestamps are:- UTC normalized
- Server-side generated
- Cannot be client-specified
Best Practices
Enable for Production
Always enable audit logging for production applications to:- Meet compliance requirements
- Enable incident investigation
- Track usage patterns
Regular Review
Periodically review audit logs for:- Unusual access patterns
- Failed authentication attempts
- Unexpected API usage
Secure API Keys
Protect your Audit API key:- Store securely (not in code)
- Rotate periodically
- Monitor for unauthorized use
Next Steps
Compliance
GDPR, data deletion, and certifications
Authentication
Secure your SDK integration