Direct answer
Claude Code privacy is not one setting. Consumer users can allow data to be used for training, while commercial API, Team, Enterprise and Government data are not used for training by default. Non-opted-in consumer data has 30-day retention, and standard commercial retention is also 30 days. Consumer data retained after a training opt-in may be kept de-identified for up to five years. Zero Data Retention exists for qualified Enterprise accounts and eligible products, with exceptions. Identify the account type and settings before deciding whether the policy fits your code.
Why the policy split matters
A developer can read a headline about retention and reach the wrong conclusion. “Thirty days” does not mean every account has identical terms. “No training by default” does not describe every consumer setting. “Zero Data Retention” does not mean every product or account qualifies.
The account type is the first branch in the decision. A personal subscription, a commercial API account and an Enterprise agreement can have different defaults. The second branch is the user’s choice: consumer training is optional, while commercial training requires explicit feedback or another opt-in. The third branch is product scope, especially for Zero Data Retention.
This matters because source code, prompts and tool output can contain more than the line a developer meant to share. A repository may include credentials, customer records, internal URLs or architectural details. A privacy review should start with the data, then map it to the account and product terms. The Claude Code settings-file secret exposure article covers one way sensitive material can escape the intended boundary.
Consumer versus commercial terms
Official: Consumer users can allow data to be used for training. Commercial API, Team, Enterprise and Government data are not used for training by default. Training for commercial data requires explicit feedback or another opt-in.
| Question | Consumer account | Commercial account |
|---|---|---|
| Can data be used for training? | Yes, if the user opts in | Not by default |
| What changes the default? | Training choice | Explicit feedback or another opt-in |
| Standard retention in the fact pack | 30 days for non-opted-in consumer data | 30 days standard commercial retention |
| Longer consumer retention | De-identified data may be kept up to five years after a training opt-in | Not the consumer training rule |
| Zero Data Retention | Not the standard consumer promise | Available for qualified Enterprise accounts and eligible products, with exceptions |
The table is a policy map, not a substitute for the account’s actual settings. A user who cannot identify the account type should pause before sending sensitive work. A Team or Enterprise buyer should keep the agreement and product scope with the procurement record.
The Claude Code zero-data-retention limits article goes deeper on qualification and contract scope. This article focuses on the everyday distinction between training choices and retention periods.
Training defaults without the blanket claims
It is inaccurate to say that all Claude data is used for training by default. It is equally inaccurate to say that no consumer data can ever be used for training. The published position is more specific.
Consumer training is optional. A user who does not opt in falls under the non-opted-in consumer retention rule. A user who opts in accepts a different data lifecycle, including the possibility that retained data is de-identified and kept for up to five years.
Commercial data follows a different default. Commercial API, Team, Enterprise and Government data are not used for training by default. Explicit feedback or another opt-in can change that position. The important word is “default,” because it describes the starting policy rather than every possible configuration.
| Setting or account | Training position | Review action |
|---|---|---|
| Consumer without training opt-in | Consumer training is optional and not enabled by choice | Confirm the current setting |
| Consumer with training opt-in | Data may be used for training | Reassess before sending sensitive code |
| Commercial API, Team, Enterprise or Government | No training by default | Check for explicit feedback or another opt-in |
| Account with unclear ownership | Unknown until the account type is identified | Ask the account owner before use |
A useful privacy checklist records the setting, the date it was checked and the person who confirmed it. Settings can change, and a procurement document can become stale. The privacy and retention rules should be reviewed when the account type or data sensitivity changes.
Retention periods are not one number
Official: Non-opted-in consumer data has 30-day retention. Standard commercial retention is 30 days. Data retained after a consumer training opt-in may be kept de-identified for up to five years.
The policy also contains exception periods. Flagged inputs or outputs may be retained up to two years, safety scores up to seven years and feedback transcripts five years. Those periods apply to the relevant records, not to every prompt in every account.
| Data category | Published period | Boundary |
|---|---|---|
| Non-opted-in consumer data | 30 days | Consumer account without training opt-in |
| Standard commercial data | 30 days | Standard commercial retention |
| Consumer data after training opt-in | De-identified, up to five years | Retention following the opt-in |
| Flagged inputs or outputs | Up to two years | Relevant flagged material |
| Safety scores | Up to seven years | Safety records, not ordinary prompt text |
| Feedback transcripts | Five years | Feedback records |
The practical reading is to ask which category applies to the data you are sending. A single “we delete everything after 30 days” statement erases the consumer training choice and the exception records. A single “we keep everything for years” statement erases the standard 30-day rule.
The Claude Code harness security boundaries article explains why tool access and host permissions matter alongside provider retention. A privacy policy cannot compensate for a local settings file that exposes a secret.
Zero Data Retention has a scope
Official: Zero Data Retention is available for qualified Enterprise accounts and eligible products, with exceptions. The policy does not make ZDR universal, and it does not deny that ZDR exists.
That distinction matters in procurement. A buyer should ask whether the specific account qualifies, which products are covered and what exceptions remain in the agreement. A product name alone is not enough. The Claude Code zero-data-retention limits article provides a deeper evaluation worksheet.
| ZDR question | Evidence to request |
|---|---|
| Does the account qualify? | Written confirmation from the provider |
| Which products are covered? | Product list in the agreement or policy |
| Which exceptions apply? | Contract terms and policy exceptions |
| Who can change the setting? | Named account or procurement owner |
| How is scope reviewed? | Review date and change process |
A standard account should be described as standard retention, not zero retention. A qualified Enterprise account should be described with its actual scope, not as a universal guarantee that no record can ever exist.
Safety exceptions and legal requests
The exception periods are part of the policy, not a footnote to ignore. Flagged inputs or outputs, safety scores and feedback transcripts can have longer retention than standard data. A privacy review should ask whether the project can accept those categories and who reviews flagged material.
Official: Anthropic says it discloses user data only through valid legal process, evaluates requests and ordinarily notifies users unless legally prohibited. The AI government-request policies article explains the evidence boundary around public contracts and retention allegations.
No credible source in the research set proves a secret government deal requiring Anthropic to retain every prompt. Do not replace the documented legal-process policy with that allegation. Equally, do not claim that legal requests are impossible. The honest position is that valid process, provider review and notice rules exist.
| Privacy layer | Question to ask |
|---|---|
| Training | Is training off by default for this account type? |
| Standard retention | Which 30-day rule applies? |
| Exceptions | Which flagged, safety or feedback records can last longer? |
| ZDR | Does the account and product qualify? |
| Legal process | What notice and challenge policy applies? |
| Upstream providers | Who else receives the request and under which terms? |
Upstream providers and gateway routes
A gateway can add another provider relationship to the request path. Before sending sensitive work through one, ask which upstream providers receive the request, what terms apply and whether the gateway’s own policy changes the data lifecycle. A gateway policy is not automatically the upstream provider’s policy.
This is a due-diligence question, not a claim that every gateway handles data the same way. Record the answer in writing. If the provider will not identify the route or the applicable terms, treat that as an unresolved risk rather than assuming the primary model’s policy covers every hop.
The coding-agent compatibility guide explains why the agent format matters. The OpenAI versus Anthropic API format guide explains the protocol boundary. Neither format choice answers the retention question by itself.
Privacy checklist for a coding project
Use the checklist before a new repository, client engagement or account type enters the workflow. The goal is to match the data to the policy, not to produce a generic assurance that the service is “private.”
| Check | Evidence | Stop condition |
|---|---|---|
| Identify account type | Consumer, Team, Enterprise, API or Government record | Account type is unclear |
| Confirm training setting | Current setting and date checked | Sensitive data with an unknown opt-in |
| Identify retention category | Standard, consumer training or exception record | Policy does not cover the data |
| Confirm ZDR scope if required | Written qualification and product list | ZDR is required but not confirmed |
| Review exceptions | Flagged, safety and feedback terms | Exceptions are unacceptable |
| Review upstream route | Provider and subprocessor terms | Route or terms are undisclosed |
| Protect local files | Settings and secret scan | Credentials appear in repository files |
The Claude Code settings-file secret exposure article is a useful companion. Provider retention policy does not prevent a developer from committing a literal secret to a public repository.
Map a real repository to the policy
A generic privacy review misses the data that makes a repository sensitive. Walk through the project before enabling a new agent route. Identify credentials, customer records, internal URLs, deployment details and proprietary logic. Then decide which material may leave the developer’s machine.
Use a sanitized task for the first test. Remove secrets and unrelated files. If the task needs sensitive context, record who approved the route and which policy category covers it. A successful request is not proof that the data handling is acceptable.
The Claude Code proof-of-work packet article explains how to verify output. Privacy review needs a similar receipt: what data was sent, which route handled it, what policy applied and who accepted the risk. Without that record, a later audit becomes guesswork.
| Repository item | Review question | Default action |
|---|---|---|
| Credentials | Could a secret appear in a prompt or command? | Remove it before the request |
| Customer data | Does the client permit this provider and route? | Use sanitized data until approved |
| Internal architecture | Is the detail confidential? | Limit context to the task |
| Deployment configuration | Could it expose access paths? | Redact sensitive values |
| Proprietary code | Does the contract restrict external processing? | Obtain written approval |
| Logs and traces | Do they contain tokens or personal data? | Inspect and redact first |
The Claude Code harness security boundaries article adds tool authority to this review. A model provider’s retention policy does not control every file the agent can read or every command it can run.
Questions for procurement
Procurement should ask for documents, not reassurance. Request the account type, training terms, retention schedule, ZDR scope if applicable, exception categories and upstream provider terms. Ask who can change the settings and how changes are communicated.
If the answer is a sales summary, ask for the underlying policy or agreement. If the answer varies by product, request a product list. If the answer depends on account qualification, request written confirmation for the account being purchased.
| Procurement question | Evidence to keep |
|---|---|
| Which account type is being purchased? | Order form or agreement |
| Is training off by default? | Current policy and setting record |
| What is the standard retention period? | Retention schedule |
| Which exception records last longer? | Exception terms |
| Does ZDR apply to this account and product? | Written scope confirmation |
| Which upstream providers can receive requests? | Subprocessor or routing terms |
| How are deletion requests handled? | Documented process |
The Claude Code regional restrictions for teams article shows why entity and location records belong in the same procurement file. Privacy, eligibility and client approval are separate checks, but they often share an owner.
Keep a privacy review record
A short review record makes the decision repeatable. Store it with the project, not only in a chat. Include the date, account type, data categories, training setting, retention category, ZDR scope, upstream route and approver.
Review the record when the project gains a new client, the account type changes or the agent route changes. A policy that was acceptable for a disposable test may not be acceptable for production customer data.
| Record field | Example of acceptable evidence |
|---|---|
| Account type | Named plan or agreement |
| Training setting | Screenshot or written confirmation with date |
| Retention category | Standard, consumer training or exception terms |
| ZDR scope | Qualified account and eligible product list |
| Upstream route | Provider names and applicable terms |
| Approver | Named security, legal or client owner |
| Next review | Event or date that triggers another check |
The Claude Code context-portable migration guide explains how to preserve project knowledge during a tool change. Preserve the privacy record with that knowledge. Otherwise the team may keep the prompts and lose the reason they were approved.
When to choose a different route
A policy mismatch is a valid reason to test another route. If the project requires ZDR and the account does not qualify, do not describe standard retention as close enough. If the client prohibits an upstream provider, a working request does not make the route acceptable.
A different route should be evaluated with the same questions. Ask about training, retention, exceptions, upstream providers and deletion. Then test the agent format and model availability. The multi-model OpenAI-agent setup describes the active architecture, and the 46 free AI model IDs for OpenAI agents can support a small non-sensitive comparison.
The Claude Code third-party harness rules matter during a move. Do not use a client or gateway that misrepresents identity or routes traffic against subscription limits. A privacy improvement is not worth creating a terms problem.
Training choice and client work
Client work adds another approval layer. A developer’s personal training setting does not override a client contract. If the client requires no training, confirm that the account and route meet that requirement before sending project material.
Keep the approval with the engagement record. If the account owner changes the setting later, the review should be repeated. The Claude Code exit-plan checklist can include a privacy trigger: stop using the route when the approved account type, setting or upstream provider changes.
Read the policy as a data lifecycle
A retention number describes only one stage. Follow the data from submission to processing, logging, exception handling and deletion. Ask where the prompt lives, whether the response is stored, which metadata remains and what happens after a deletion request.
This lifecycle view prevents two common mistakes. The first is treating “not used for training” as “not retained.” The second is treating “30-day retention” as “every related record disappears after 30 days.” Training, standard retention and exception records are different categories.
Write the lifecycle in plain language for the project. If a stage is unknown, mark it unknown and ask the provider. Do not replace a missing answer with a reassuring assumption. The Claude Code privacy and retention rules provide the next layer of detail for standard retention and qualified ZDR.
Recheck the settings when the account changes
A privacy review should follow the account, not only the project. A move from a personal account to a Team account, a new Enterprise agreement or a change in the person who owns billing can alter the applicable terms. Record the new account type and confirm the settings again.
Do not assume that a familiar interface means identical policy. The product surface may stay the same while the underlying agreement changes. Keep the receipt, policy link and review date together so the team can explain which terms applied to a request.
A quick privacy decision tree
Start with the account type. If it is consumer, check the training choice. If it is commercial, confirm the no-training default and look for any explicit feedback or opt-in. Next, identify the retention category: standard 30 days, consumer training retention or an exception record.
If the project requires zero retention, stop and confirm qualified Enterprise ZDR scope. If the route includes a gateway, add the upstream provider review. Finish by recording the evidence and approver. A decision that cannot name its account type and route is not ready for sensitive data.
The win, the loss and the practical implication
The win is that the policy has distinguishable branches. Consumer training is optional, commercial training is off by default, standard retention is 30 days and qualified Enterprise ZDR exists. A careful buyer can map a project to the right branch.
The loss is complexity. The same product family can involve different account types, settings, product scope and exception records. The public fact pack does not provide an independent audit of every implementation, and it does not identify the exact ZDR scope for every account.
The practical implication is to keep evidence. Record the account type, training setting, retention category and ZDR scope before sending sensitive work. The Claude Code lock-in and exit costs article explains why policy dependence belongs in the exit-cost worksheet. The Claude Code single points of failure article adds provider concentration risk.
Data gaps and future updates
The policies are first-party statements, not an independent audit of every account configuration. The fact pack does not provide a complete product-by-product ZDR eligibility matrix or a measured account of how often exception records are created. Those gaps should remain visible.
This article should be updated if Anthropic changes the training defaults, retention periods, ZDR scope or legal-request policy. A future update should preserve the consumer/commercial split. Collapsing the policies into one retention number would make the article less accurate, not simpler.
Practical response: test the live OpenAI-agent lane
One AI API Key is not a Claude Code replacement interface. Its active route is an OpenAI-format agent such as OpenCode, Cline or Cursor using https://api.oneaiapikey.com/v1, one gateway key and the 46 live free model IDs. Verify the free model list before sending a test task.
The documented Claude Code route uses https://api.oneaiapikey.com without a trailing /v1 and the Anthropic Messages format. All four Claude IDs were unavailable on 2026-11-27: claude-sonnet-5-5, claude-sonnet-5, claude-opus-5-5 and claude-haiku-4-5. Free IDs are OpenAI-format only and do not work in Claude Code. The coding-agent compatibility guide and OpenAI versus Anthropic format guide explain the boundary.
First-party policy claim: The gateway’s privacy and retention policy says it does not train on prompts, files or outputs and does not sell them. Prompt and response bodies are not written to usage logs by default. Troubleshooting captures can last up to 30 days, opt-in prompt logs seven days, usage metadata up to 12 months and security logs up to 90 days. Account data is deleted or anonymised within 30 days after a deletion request. Upstream providers receive requests under their own terms. These are provider policy statements, not an independent audit.
For a non-sensitive pilot, use the endpoint quickstart, check the current model catalogue, review prepaid pricing and create an account through the sign-up page. Use the LLM cost calculator for paid work and check gateway status before relying on the route.
FAQ
Is all Claude Code data used for training by default?
No. Training on consumer accounts is optional, and commercial API, Team, Enterprise and Government data are not used for training by default. Explicit feedback or another opt-in can change the commercial position.
Is standard Claude Code retention zero days?
No. Non-opted-in consumer data has 30-day retention, and standard commercial retention is 30 days. Zero Data Retention is a separate qualified Enterprise option with scope and exceptions.
Can consumer training change retention?
Yes. Data retained after a consumer training opt-in may be kept de-identified for up to five years.
Does Zero Data Retention cover every account and product?
No. It is available for qualified Enterprise accounts and eligible products, with exceptions. Confirm the actual scope in writing.
What should a team record before sending sensitive code?
Record the account type, training setting, retention category, ZDR scope if required, exception terms and upstream provider route. Keep the evidence with the project review.