Back to Checks
openai

OpenAI project data retention is restricted

project_data_retention_restricted
Service: projectSeverity: high
OfficialVerifiedPrivate
Categories:gen-ai
Resource Type:OpenAIProject

Each active project's data retention type is checked against allowed_data_retention_types. A project on organization_default inherits the organization's type; a project set to none opts out of the organization's retention controls.

Prowler logoProwlerprowler-provider-openai

Risk

A project set to none keeps standard retention even when the organization has zero data retention or modified abuse monitoring, so prompts and outputs sent through it are stored by OpenAI against the organization's privacy commitments.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler openai --checks project_data_retention_restricted

Recommendation

Set the project's data retention to organization_default or to an allowed type in the project's Data controls.

Remediation

CLI

curl -X POST https://api.openai.com/v1/organization/projects/<project_id>/data_retention -H "Authorization: Bearer $OPENAI_ADMIN_KEY" -H "Content-Type: application/json" -d '{"retention_type": "organization_default"}'

Check Code

from prowler.lib.check.models import Check

from prowler_provider_openai.check_report import finding
from prowler_provider_openai.services.organization.organization_client import (
    organization_client,
)
from prowler_provider_openai.services.project.project_client import project_client


class project_data_retention_restricted(Check):
    def execute(self):
        retention = project_client.data_retention
        if retention is None:
            return []
        allowed = project_client.audit_config.get("allowed_data_retention_types") or []
        org_kind = organization_client.data_retention_type
        findings = []
        for project in project_client.projects:
            kind = retention.get(project["id"])
            if kind == "none":
                passed = False
                text = f"Project {project['name']} sets data retention to none, opting out of the organization's retention controls."
            elif kind == "organization_default":
                if org_kind is None:
                    continue  # the organization's own type is unreadable
                passed = org_kind in allowed
                text = f"Project {project['name']} inherits the organization's {org_kind} data retention"
                text += "." if passed else f", not one of: {', '.join(allowed)}."
            elif kind:
                passed = kind in allowed
                text = f"Project {project['name']} uses {kind} data retention"
                text += "." if passed else f", not one of: {', '.join(allowed)}."
            else:
                continue
            findings.append(finding(self.metadata(), project, passed, text))
        return findings