---
title: OpenAI Compliance
description: >-
  Collect compliance logs from ChatGPT Enterprise and Edu workspaces through the
  OpenAI Compliance Logs Platform.
breadcrumbs: Docs > Integrations > OpenAI Compliance
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# OpenAI Compliance
Integration version1.2.0
{% callout %}
# Important note for users on the following Datadog sites: us2.ddog-gov.com

{% alert level="info" %}
To find out if this integration is available in your organization, see your [Datadog Integrations](https://app.datadoghq.com/integrations) page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email [support@ddog-gov.com](mailto:support@ddog-gov.com).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

ChatGPT Enterprise and Edu workspaces can use the OpenAI Compliance Logs Platform to access compliance logs for their workspace. This integration connects a ChatGPT workspace to Datadog with an Admin key and collects the log types you enable on the tile:

- **Audit logs**: Workspace administration and configuration activity.
- **Auth logs**: User sign-in and authentication activity.
- **Application auth logs**: Connector linking and unlinking activity.
- **Codex security logs**: Findings from Codex code scanning. This log type produces data only for workspaces that run Codex code scanning.
- **Application logs**: Requests and responses for apps used in ChatGPT, such as MCP connectors.
- **Codex logs**: Codex activity, including prompts, model responses, and tool and MCP calls.
- **Conversation messages**: User and assistant messages in ChatGPT conversations, including message content.

## Setup{% #setup %}

### Prerequisites{% #prerequisites %}

- A ChatGPT Enterprise or Edu workspace
- The **Owner** or **Admin** role in that workspace, to create an Admin key

### Configuration{% #configuration %}

#### Create an Admin key{% #create-an-admin-key %}

1. Sign in to the OpenAI [Admin Console](https://admin.openai.com/).

1. Select your tenant if needed, then select your ChatGPT workspace.

1. Open **Credentials** > **Admin keys** and select **Create new admin key**. Enter a descriptive name.

1. Choose an expiration. When the key expires, collection stops until you update the account in Datadog with a new key.

1. Grant the read permission for each log type you plan to collect:

| Log type              | Scope                                                                   |
| --------------------- | ----------------------------------------------------------------------- |
| Audit logs            | `chatgpt.enterprise.compliance_logs_platform.audit_log.read`            |
| Auth logs             | `chatgpt.enterprise.compliance_logs_platform.auth_log.read`             |
| Application auth logs | `chatgpt.enterprise.compliance_logs_platform.app_auth_log.read`         |
| Codex security logs   | `chatgpt.enterprise.compliance_logs_platform.codex_security_log.read`   |
| Application logs      | `chatgpt.enterprise.compliance_logs_platform.app_log.read`              |
| Codex logs            | `chatgpt.enterprise.compliance_logs_platform.codex_log.read`            |
| Conversation messages | `chatgpt.enterprise.compliance_logs_platform.conversation_message.read` |

1. Select **Submit**, then copy the key. You cannot view it again.

#### Find your workspace ID{% #find-your-workspace-id %}

In the ChatGPT [workspace settings](https://chatgpt.com/admin/settings), copy the **Workspace ID** from the **Workspace details** section. This is a UUID such as `11111111-aaaa-bbbb-cccc-dddddddddddd`. Use the workspace ID, not the organization ID.

#### Allowlist Datadog IP addresses{% #allowlist-datadog-ip-addresses %}

This integration reads from the Compliance Logs Platform through OpenAI's Compliance API. The Compliance API has its own IP allowlist, separate from the workspace allowlist. If the Compliance API allowlist has any entries, add the Datadog IP ranges to it:

1. In ChatGPT, go to **Workspace Settings** > **Identity & access** > **Access Restrictions**.
1. Add the **Webhooks** IP ranges from [Datadog IP ranges](https://docs.datadoghq.com/api/latest/ip-ranges.md) to the **Compliance API** allowlist.

Changes can take up to 15 minutes to apply.

#### Connect the workspace to Datadog{% #connect-the-workspace-to-datadog %}

1. In Datadog, open the **OpenAI Compliance** integration tile.

1. Select **Install**, open **Configure**, and select **Add Account**. Fill in the following details:

   - **Account name**: Enter an account name that identifies the ChatGPT workspace.
   - **Admin API Key**: Enter the key you created in the Create an Admin key section.
   - **Workspace ID**: Enter the ID from the Find your workspace ID section.

1. Enable the log types you want to collect. Each option is disabled by default and requires the matching scope on the key.

1. Save the account.

### Validation{% #validation %}

In the [Log Explorer](https://app.datadoghq.com/logs?query=source%3Aopenai-compliance), search for `source:openai-compliance`. Logs appear after the first collection completes. Application auth logs, application logs, Codex logs, and Codex security logs appear only when the corresponding activity occurs in your workspace, so an empty result for those log types is expected.

## Uninstallation{% #uninstallation %}

1. Open the **OpenAI Compliance** integration tile and select **Configure**.
1. Delete each configured account to stop future collection for that account.
1. Uninstall the integration from Datadog.
1. If the Admin key was created exclusively for this integration, revoke it in [Admin Console](https://admin.openai.com/) under **Credentials** > **Admin keys**.

Uninstalling the integration does not delete data already collected in Datadog.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

OpenAI Compliance does not include any metrics.

### Logs{% #logs %}

OpenAI Compliance collects the log types that you enable on the tile and assigns them the source `openai-compliance`. Datadog cannot ingest logs older than 18 hours, so historical logs are not imported.

Calls that this integration makes to the Compliance Logs Platform are recorded in your workspace's audit logs as `LIST_WORKSPACE_LOG_FILES` and `DOWNLOAD_WORKSPACE_LOG_FILE` actions.

### Events{% #events %}

OpenAI Compliance does not include any events.

### Service Checks{% #service-checks %}

OpenAI Compliance does not include any service checks.

## Support{% #support %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
