Skip to content
mentoor

Topic 4 of 5 · 4 min read

Code privacy and data-use terms

Goal: Read a coding tool's data-use terms and decide whether it may be used on a given repository under a company policy.

Before you point a coding tool at a repository, read four things in its terms: does it train on your code, how long does it keep it, who can see it, and where it runs. The answer depends on the plan you use, not only the vendor.

Check yourself · 1 of 3

What does zero data retention (ZDR) mean for a coding tool?

Choose one answer

Why it matters

Your source code, config and sometimes secrets are sent to a remote model on every request. If the plan allows training on prompts, your code may shape a future model. If a repository holds customer data or a client's code under contract, a wrong choice can breach that contract. Terms differ between free, individual, team and enterprise plans of the same product.

The four checks

  1. Training. Does the vendor use your prompts and code to train models? Many vendors state that commercial or team plans do not train on your data, while consumer plans may, unless you opt out. Anthropic's data-usage page, for instance, says it does not train on code or prompts sent to Claude Code under commercial terms. Read the exact plan you will use.
  2. Retention. How long are prompts and outputs stored, and for what purpose, such as abuse checks? Some plans offer zero data retention (ZDR), where nothing is stored after the response. ZDR is usually an enterprise option you must request.
  3. Access and sub-processors. Which humans or other companies can see the data? Cursor's security page, for example, describes a Privacy Mode and contractual limits on its model providers.
  4. Where it runs. Cloud API, your own cloud account (for example a model served through your cloud provider), or fully local. Open-weight models run on your own machine or servers with a tool such as Ollama, so code never leaves your network. They are usually weaker than the best hosted models.

Check the repository too

Classify the repo: public open source, internal, customer-confidential, regulated. Then match: public code can use almost anything; regulated code may need ZDR or local only. Also keep secrets out of the model's reach with ignore files and by never pasting keys.

Before and after

Weak: "The vendor says it is secure, so we use it on everything."

Better: "Team plan, training off, 30-day retention accepted by security for internal repos. The payments repo stays on a local model until ZDR is signed."

What goes wrong

  • A developer uses a personal free account for work code that the company plan would have protected.
  • Terms change and nobody rechecks them.
  • A tool reads a .env file and sends the keys in a prompt.

Treat the privacy review as a recurring check, with a named owner and a date.

Examples

A policy by repository class

# ai-coding-policy.yaml (example)
public-oss:
  allowed: [hosted-any-plan]
internal:
  allowed: [team-plan-training-off]
  retention: accepted-30-days
customer-confidential:
  allowed: [enterprise-zdr, self-hosted]
regulated-payments:
  allowed: [self-hosted-open-weight]
  note: no code leaves the company network

The policy is short on purpose. Each class names the allowed tools, so a developer can decide in seconds.

The personal account

A developer on a deadline signs up for a free individual plan and pastes a client module into it. The company's team plan has training off, but this plan did not. The code left the contract's boundary. The fix is a written rule: work code only through company accounts, and a license check in onboarding.

Key points

  • Check training, retention, access and where the model runs before using a tool on a repository.
  • Terms differ by plan: a free personal account and an enterprise account of one product can have different rules.
  • Zero data retention is usually an enterprise option you must request, not a default.
  • Open-weight and self-hosted models keep code inside your network but are usually weaker than top hosted models.
  • Match repository sensitivity to tool terms, keep secrets out of reach, and recheck terms on a schedule.

Common mistakes

  • Reading the vendor's marketing page instead of the terms for the exact plan in use.
  • Assuming every plan of one product has the same training and retention rules.
  • Treating a local model as risk-free and ignoring that its tools may still call remote services.
  • Letting agents read secret files because nobody added an ignore rule.

Check yourself · 2 of 3

A vendor's team plan says it does not train on your code. A developer uses the same vendor's free personal account for work code. What is the risk?

Choose one answer

Check yourself · 3 of 3

A repository is under a client contract that forbids sending code to third parties. Which option fits?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic