This feature is only available on the Enterprise tier. Contact sales to learn more.
What Are Audit Logs?
Audit logs capture a complete trail of activities within your organization:- Resource lifecycle: Creation, modification, and deletion of environments, projects, and runners
- Configuration changes: Updates to organization settings, policies, and integrations
- Security events: Token management, SSO configuration, and secret operations
- Access control: Group and role modifications
- Workflow activities: Task executions, service deployments, and automation runs
Audit Log Entry Structure
Each entry contains:- Actor: Who performed the action (user, service account, runner, or system)
- Subject: What resource was affected and its type
- Action: The specific operation performed (e.g., “Environment created”, “changed status, phase”)
- Timestamp: When the action occurred
- Organization: Which organization the action belongs to
Access Requirements
Organization Admin role required. Only users with the Organization Admin role can view and query audit logs. Regular organization members cannot access audit logs, even for resources they own. This restriction ensures sensitive operational data remains available only to authorized administrators.What Gets Logged
Ona automatically generates audit log entries for all create, update, and delete operations on these resource types:-
Infrastructure
- Environments, Runners, Projects, Environment Classes
-
Execution & Automation
- Tasks, Task Executions, Services, Workflows, Workflow Executions, Workflow Execution Actions, Agents, Agent Executions
-
Security & Access
- Users, Service Accounts, Personal Access Tokens, Host Authentication Tokens, Secrets (project, user, and organization-level), SSO Configuration, Groups
-
Organization
- Organization Policies, Domain Verification, Custom Domains, Billing
-
Integrations & Development
- Integrations, Integration Definitions, Runner SCM/LLM Integrations, Organization LLM Integrations, Prebuilds, Snapshots, Prompts, User Preferences
-
Other
- Environment Usage Records, Project Environment Classes
PRINCIPAL_USER- Human usersPRINCIPAL_SERVICE_ACCOUNT- Service accountsPRINCIPAL_RUNNER- Runner infrastructurePRINCIPAL_ENVIRONMENT- Environment processesPRINCIPAL_RUNNER_MANAGER- Runner management systemsPRINCIPAL_AGENT_EXECUTION- AI agent executionsPRINCIPAL_ACCOUNT- Account-level operations
Querying Audit Logs
Using the CLI
Thegitpod CLI (pre-installed on all Ona environments) provides the simplest way to query audit logs.
Basic usage:
Using the API
For programmatic access and SIEM integration, use the REST API. Authentication:Real-Time Event Monitoring
For real-time notifications instead of historical queries, use the WatchEvents API. This streaming endpoint pushes events as they occur—ideal for dashboards, automation triggers, and live monitoring.Key Differences
| Feature | ListAuditLogs API | WatchEvents API |
|---|---|---|
| Purpose | Historical analysis | Real-time monitoring |
| Access | Organization Admins only | Users with read access to resources |
| Data | Full audit trail with actor info | Resource changes only |
| Format | Paginated queries | Streaming events |
| Use Case | Compliance, security review | Dashboards, automation |
Using WatchEvents with Python
Install the official SDK:The
GITPOD_API_KEY environment variable should contain your Personal Access Token. You only receive events for resources you have read access to.Event Operations
RESOURCE_OPERATION_CREATE- Resource createdRESOURCE_OPERATION_UPDATE- Resource modifiedRESOURCE_OPERATION_UPDATE_STATUS- Status changed onlyRESOURCE_OPERATION_DELETE- Resource deleted
Using Other Languages
For languages without an official SDK, use gRPC/Connect-compatible clients: Endpoint:POST https://app.gitpod.io/api/gitpod.v1.EventService/WatchEvents
Headers:
Content-Type: application/jsonAccept: application/jsonlAuthorization: Bearer YOUR_API_KEY
Common Use Cases
Security Monitoring
Compliance Reporting
Troubleshooting
Resource Lifecycle Tracking
Best Practices
Regular Monitoring- Export audit logs periodically to external storage for long-term retention
- Integrate with your SIEM for centralized security monitoring
- Establish baseline patterns and investigate anomalies
- Grant Organization Admin role only to users who need audit log access
- Use dedicated service accounts for automated log collection
- Rotate Personal Access Tokens regularly
- Prioritize monitoring security-sensitive resource types
- Combine multiple filter criteria to narrow results
- Export to JSON/YAML for integration with analysis tools
Limitations
- Retention: Audit logs are retained according to your organization’s data retention policy
- No time filtering: Cannot filter by date/time range. Logs return in reverse chronological order (most recent first).
Workaround: Export to JSON and filter with
jq using the createdAt field:- Rate limits: API requests subject to standard rate limiting
- Filter limits: Maximum 25 values per filter type per request
- Pagination: Maximum 100 entries per page