Pairs with: AI Gateway → OpenAI provider. Direct OpenAI API traffic flows through the gateway data plane; OpenAI Enterprise Compliance API exports are a separate bulk feed routed through this ingestion source.
openai_compliance pulls compliance JSONL drops from an S3 bucket OpenAI writes to (Enterprise Compliance API). Today the source can be created and the AWS credentials/S3 config are persisted, but the puller worker hasn't shipped, events do not flow yet.
The configuration contract below lets admins pre-stage IAM trust policies and bucket access; the matching adapter is on the roadmap.
Currently implemented
- CRUD: the source can be created via the admin composer at
/governance/ingestion-sourcesand viaapi.ingestionSources.create. It appears inlangwatch ingest listwith statusawaiting_first_event. - Receiver: none. There is no
/api/v1/ingest/openai-compliance/:idendpoint and the OTLP, webhook receivers rejectopenai_compliancesources with400 wrong_endpoint. - Puller: none.
- Normaliser: none.
- Status flip: the source stays
awaiting_first_eventindefinitely until the puller ships.
What the admin configures upstream
The composer collects:
| Field | Required | Stored | Used by |
|---|---|---|---|
| S3 bucket name | yes | IngestionSource.payloadConfig.bucket | (future puller) |
| S3 key prefix | no | payloadConfig.prefix (default compliance/) | (future puller) |
| Cross-account role ARN | yes | payloadConfig.roleArn | (future puller) |
| Polling cadence (seconds) | no | payloadConfig.pollEverySec (default 60) | (future puller) |
In OpenAI's Enterprise Compliance setup:
- Open a ticket with OpenAI to enable Enterprise Compliance for your tenant. They'll want the S3 bucket name above + the AWS account that owns it.
- OpenAI starts writing compliance JSONL files under
s3://<bucket>/<prefix>/. Files are gzipped, one JSON object per line, hourly cadence.
In your AWS account:
- Create an IAM role with a trust policy allowing LangWatch's account (provided during onboarding) to assume it.
- Attach an inline policy granting
s3:ListBucket+s3:GetObjecton the bucket, prefix above. - Paste the role ARN into the LangWatch composer.
There is no LangWatch-side URL or bearer secret to paste back into OpenAI. The future puller will assume the role you grant and read S3 directly.
What event shape we accept today
None, no events flow until the puller ships.
What is still envelope-only, follow-up work
- S3 puller worker. A cron job that assumes the configured
roleArn, lists objects unders3://<bucket>/<prefix>/newer than the last watermark, fetches them, gunzips, and walks line-by-line. - JSONL → governance event mapping. OpenAI Enterprise Compliance JSONL has a documented schema (event type, user ID, model, prompt + completion tokens, content classification flags). Mapping into Actor, Action, Target, cost, token fields is pending and will live in an
openai-compliance.tsnormaliser. - Cost reconciliation. OpenAI's compliance feed includes per-event token counts but not USD cost. The cost-enrichment pipeline already handles this for
recorded_spans + log_recordsonce the puller lands, no extra work needed on the receiver side. - Watermark + dedup. S3 keys are timestamped; the worker tracks high-water key in
IngestionSource.payloadConfig.watermarkto avoid replays.
When the puller ships, this page is updated with the real event shape, the CLI verification flow, and the per-source detail behaviour.