Back to Checks
Claude organization Claude Code zero data retention setting matches the documented baseline
dataprivacy_claude_code_zero_data_retention_enabled
Service: dataprivacySeverity: medium
OfficialVerifiedPrivate
Categories:gen-aiencryption
Resource Type:ClaudeOrganizationSettings
The effective organization settings are evaluated for claude_enterprise_claude_code_zero_data_retention_enabled. Claude Code sessions carry source code and repository context, which is exactly the content most organizations want retained nowhere.
Risk
Claude Code sessions carry source code and repository context, which is exactly the content most organizations want retained nowhere.
Run this check with Prowler
Run in Prowler CloudInstall
pip install --extra-index-url https://__token__:${PROWLER_REGISTRY_DOWNLOAD_API_KEY}@registry.prowler.com/simple/ "prowler-provider-claude[runtime]"Run
prowler claude --checks dataprivacy_claude_code_zero_data_retention_enabledRecommendation
Arrange Claude Code zero data retention with Anthropic, or record the decision not to in the audit config.
Remediation
Other
1Arrange Claude Code zero data retention with Anthropic, or record the decision not to in the audit config.
Check Code
from prowler.lib.check.models import Check
from prowler_provider_claude.lib.report import CheckReportClaude
from prowler_provider_claude.services.dataprivacy.dataprivacy_client import (
dataprivacy_client,
)
class dataprivacy_claude_code_zero_data_retention_enabled(Check):
"""Zero data retention is in force for Claude Code.
Claude Code sessions carry source code and repository context, which is exactly the content most organizations want retained nowhere.
Policy-pinned: compared against ``claude_code_zdr_expected`` in the Prowler audit config
rather than assumed, so a capability the organization chose to enable is
only reported when it differs from the documented baseline.
"""
def execute(self) -> list[CheckReportClaude]:
expected = dataprivacy_client.audit_config.get("claude_code_zdr_expected", True)
findings = []
for settings in dataprivacy_client.settings:
row = settings.get(
"claude_enterprise_claude_code_zero_data_retention_enabled"
)
if row is None:
continue
org = settings.name.removesuffix(" effective settings")
state = "enabled" if row.value else "disabled"
report = CheckReportClaude(metadata=self.metadata(), resource=settings)
if row.value == expected:
report.status = "PASS"
report.status_extended = (
f"Organization {org} has zero data retention for Claude Code {state}, matching the documented "
f"baseline (claude_enterprise_claude_code_zero_data_retention_enabled is {str(row.value).lower()})."
)
else:
report.status = "FAIL"
report.status_extended = (
f"Organization {org} has zero data retention for Claude Code {state} but the documented baseline "
f"is {'enabled' if expected else 'disabled'} (claude_enterprise_claude_code_zero_data_retention_enabled is "
f"{str(row.value).lower()}). Either change the setting or update "
"claude_code_zdr_expected in the Prowler audit config to record the decision."
)
findings.append(report)
return findings