AI Coding Tool Security: What If Customer Data Gets Mixed Into Claude Code or Copilot?

· DataMint · 9 min read

An imagined scene. The night before a release, the settlement batch stops on one particular customer's records. The developer opens Claude Code in the terminal, types "look at this log and find the cause," and points it at a log file pulled from the production server. The agent reads the log, opens the related source, and queries the test DB to reproduce the problem. Twenty minutes later the cause is found.

In those twenty minutes, source code is not the only thing that went to the AI service. The customer names and mobile numbers printed in the log, the account numbers in the query results and the connection details in the config file may have gone out in the same requests. This is the first place to look in AI coding tool security.

The short answer: handle source code through accounts and contracts, and mask customer data and secrets before they go out. Block the tools outright and developers simply move to personal laptops and personal accounts. Based on the official documentation for Claude Code and GitHub Copilot, this post sets out what goes out, how far the settings inside the tools take you, and what you can add on the company network.

AI coding tools send more than the one line you typed

A chat window sends only what you paste. A coding agent is different. To produce an answer it opens files and runs commands on its own, and it puts the results into the next request to show them to the model. When the model has "read" a log, the content of the log has gone to a server outside the company.

Anthropic's Claude Code data usage documentation says this: Claude Code runs on the PC but sends data over the network to talk to the model, and this includes all user prompts and model outputs. According to the same document, it keeps conversation transcripts in plain text in the user's folder on the PC, for 30 days by default, so that sessions can be resumed. If a dump was read in a session, its content also stays on the developer's PC for a month.

So the developer typed one line, but the logs, source and config files the agent read, and the output of the commands it ran, travel with it. That can include a customer name, a mobile number and a connection password.

What to worry about before source code: logs, DB dumps, test fixtures, API keys

For a company, source code going to an external AI is a matter of contract and policy. Contract an enterprise plan, confirm the terms say it is not used for training, and much of it is settled. Customer data is different. Sending information that customers entrusted to you to an external service brings, under Korea's Personal Information Protection Act (PIPA), the questions of outsourcing, provision and overseas transfer one after another. The article-by-article account is in Legal problems when an employee enters customer personal data into ChatGPT.

What easily goes out to AI during development
WhatWhere it is mixed inWhy it is a problem
Production logsLogs pulled for incident analysis, stack tracesNames, phone numbers and account numbers are printed in the request values
DB dumps and query resultsTables copied for reproduction, the output of SELECTs the agent ranThe customer ledger is in there, row by row
Test fixturesTest data made by copying production dataReal customer information under the name of test data
Secrets.env, config files, connection strings hard-coded in the codeOne key gives access to production systems
Internal namesProject code names, client company namesBusiness information that is not yet public
# A log pulled for incident analysis (sample values)
2026-11-16 23:41:07 ERROR SettleJob - settlement failed cust=홍길동 tel=010-1234-5678 acct=123456-01-234567

# application-prod.yml
datasource.url: jdbc:postgresql://10.0.0.12:5432/settle
datasource.password: <production password>

Developers do not put lines like these in on purpose. They come along with the words "find the cause." If the test data is a copy of production, the same thing happens just by opening a fixture file. The root fix in that case is not to build test data from production data, which we cover in Why you should not test with production data.

Claude Code and Copilot: the plan decides use for training

The Claude Code documentation states that on consumer plans (Free, Pro, Max, Ultra), if the user allows it, data from Claude Code use is also used to train new models. The retention period is 5 years if allowed and 30 days if not. Under commercial terms such as Team, Enterprise and the API, code and prompts sent through Claude Code are not used for training unless the customer separately chooses to provide them, and the standard retention period is 30 days.

GitHub stated in its announcement of March 25, 2026 that from April 24 it would use the interaction data (inputs, outputs, code snippets and associated context) of Copilot Free, Pro and Pro+ users for model training. It can be turned off in settings, and Copilot Business and Enterprise are not affected by this change.

Use for training by plan (per official documentation, checked November 17, 2026)
Tool and planUse for trainingWhat the company should check
Claude Code consumer plansUsed if the user allows itDo developers open company repositories with a personal account?
Claude Code commercial terms (Team, Enterprise, API)Not used unless separately chosenIs login limited to company accounts?
Copilot Free, Pro, Pro+Used from April 24, 2026, can be turned offIs it used with a personally paid account?
Copilot Business, EnterpriseNot affected by this changeIs it used only with organization accounts?

What counts is not the contract but the account actually logged in. Even if the company has contracted an enterprise plan, when a developer opens a company repository with a personal account, that request follows the terms of the consumer plan. And "not used for training" is not "not sent." The request is still processed outside the company and retained for the set period. Retention periods by service are collected in Where is what you type into AI stored?

Exclusion settings inside the tools: how far do they go?

Both tools have settings that keep the AI from reading certain files. Use them. But also know the limits the official documentation itself states.

Claude Code: Read deny rules in permissions

The permissions documentation advises using deny rules such as Read(./.env) and Read(./secrets/**) so that the file tools cannot read those paths. Rules that an administrator deploys through managed settings cannot be overridden by user settings or command-line options.

{
  "permissions": {
    "deny": ["Read(./.env)", "Read(./secrets/**)"]
  }
}

The same document carries a warning. These rules apply to Claude's file tools and to commands Claude Code recognizes, such as cat and head, but they do not apply to commands that search a whole directory without naming a file, or to Python or Node scripts that open files directly.

GitHub Copilot: content exclusion

Content exclusion is configured by repository administrators and organization owners on Copilot Business and Enterprise. Excluded files get no code completion and are not used in Copilot's answers. The documentation states that this is not a security boundary of the file system, so it cannot guarantee that all access is blocked, that information the IDE passes on indirectly (such as type information) may be used, and that it does not apply to symbolic links.

In short, exclusion settings are a way to shorten the list of files the agent will open. A developer pasting a log directly, or customer information mixed into the results of a query the agent ran, is not something these settings handle.

What happens when you block AI coding tools

The easiest decision is to block. You block the AI service addresses at the firewall and send out a notice. After that, this is what is commonly heard on the floor. "It doesn't work on the company PC, so I ran it on my laptop at home."

  • Use moves to personal devices and personal accounts. In the table above, that is the side with the widest terms for use in training.
  • The move itself is data leaving the company. The moment source and logs are sent to a personal device, they are outside the company's control.
  • No record is left. Even after an incident, the company cannot know what went out.

A ban does not remove the use. It moves it to where the company cannot see it. The comparison of blocking and allowing is in Should your company block ChatGPT or allow it? The conclusion for coding tools is similar. Letting people use them, while keeping only the values that must not leave from leaving, is what lasts.

AI coding tools: block, open, or mask? What is actually left under each
Block everythingAllow as isMask and send
Developers' AI useMoves to personal devices and personal accountsOn the company PC as beforeOn the company PC as before
Customer information and keysGo out as is from wherever the use movedGo out as isGo out replaced with placeholders such as [Name_1]
What the company knowsNothingNothingWhen, which AI, which types and how many
Confidential and bulk data leavingBlocked on company PCsNot stoppedBlocked by policy

Mask and send: keep the code context, replace only the customer information

What debugging needs is not "which customer" but "which values came in, in what order." Whether the name is a real one or [Name_1] makes almost no difference to root cause analysis.

# The log the AI receives
2026-11-16 23:41:07 ERROR SettleJob - settlement failed cust=[Name_1] tel=[Phone_1] acct=[Account_1]

The same value is replaced with the same placeholder, so the pattern "it fails only on the same customer's records" stays visible. When the AI uses [Name_1] in its answer, it is shown as the original value again on the developer's screen. How asterisks, pseudonyms and placeholders differ is covered in Pseudonymizing before putting data into AI.

One thing should be clear. What is masked is values. The logic of the source code itself is not hidden. Whether code may leave the company is decided by contract and policy, and for a service where it is not allowed, the right answer is to block the connection.

Guarding Claude Code, Codex CLI, Copilot and Gemini CLI with the DataMint Cover gateway

DataMint Cover, which we build, guards AI use on company PCs in two parts. The browser extension finds and masks personal data before sending, in the input boxes of 27 AI services used in Chrome and Edge. Coding tools in the terminal and the IDE are outside the browser, where the extension cannot see, and that is the job of the Cover gateway. It is placed on the company network (including closed, air-gapped networks), finds personal data in the requests coding tools send to AI, masks it and then sends the request on.

The targets confirmed for content inspection are Claude (desktop app, claude.ai, Claude Code, API), the OpenAI API (Codex CLI and others), GitHub Copilot, and the Gemini API and Gemini CLI. For the other AI services on the list, connections can be recorded or blocked.

In this setup, the web screens of ChatGPT, Claude and Gemini in the browser are guarded by the Cover browser extension inside the employee's PC. The terminal, the IDE and desktop apps (Claude Code, Codex CLI, GitHub Copilot, Gemini CLI and the Claude desktop app) are guarded by the Cover gateway on the company network. Policy and records are viewed in the same admin dashboard.

When this happens, with this feature, this is what changes
WhenCover featureWhat changes
Claude Code is given a production log to readThe gateway replaces the names, phone numbers and account numbers in the request with placeholders such as [Name_1] and sends itRoot cause analysis works as before and the customer information does not leave the company. Placeholders in the answer are shown as the original values on the developer's screen
A .env or config file gets mixed into the conversationCredentials such as API keys and connection strings are also among the items detectedMasked or blocked according to policy, so the key does not go out as is
An unreleased project code name is in the requestA request containing a confidential keyword set by the company is blocked, with no option to mask, and a notice is shownThe developer knows right away why it was blocked, and the record does not keep which word it was
Query results for hundreds of customers are about to go out at onceA bulk threshold that blocks when a lot of personal data goes out at one timeBulk leakage stops at the level of the request
Claude Code is given a PDF application form to readInspection of attached files (text, Word, Excel, PowerPoint, HWPX, PDF, HWP)Personal data inside files is also masked or blocked
An audit asks "what did developers send to AI?"Admin dashboard: when, which AI service, which types and how many, how they were handledYou can answer without the original input

In the admin console, policy is chosen from record only, mask and send, or block, by personal data type, AI service and user group. For example, the development team can send names and phone numbers masked, while resident registration numbers (RRN, Korea's national ID number) and card numbers are blocked for every team. A policy change that weakens protection takes effect only when another administrator approves it, and the person who made the change cannot approve it.

The operating principles are fixed as well. The gateway does not block work AI because of an error on our side. Conversely, for services where security must come first, you can set per service that requests which could not be inspected are not sent. The original values that were masked are held only in the gateway's memory and are not left on disk, on a server or in logs, and only types and counts go to the management server.

The Cover preview window. Under a heading saying 9 items of personal data were found, there is a checked list with a sample name, phone number 010-1234-5678, email address, resident registration number and address, and an always-allow button. The result preview shows the text with placeholders for the name, phone number, email, resident registration number, address, account number and card number
When a developer uses AI in the browser, the extension shows the items found and the masked result before sending. (The data on screen is for demonstration. The product is shown in Korean.)

What is not covered

Personal phones, personal PCs and AI used at home, outside the company network, are not covered. Coding tools not listed above are not subject to content inspection, so it is worth taking that into account when deciding which tools to allow. Account policy and the exclusion settings inside the tools still have to be done, separately from Cover.

Summary: an AI coding tool security checklist for development teams

  • Open company repositories only with company accounts (Claude commercial terms, Copilot Business or Enterprise).
  • Exclude .env and secrets folders with Claude Code permission rules and Copilot content exclusion, but do not rely on that alone.
  • Build test fixtures and reproduction data from something other than copies of production.
  • Mask customer information and keys before they go out, and block confidential keywords and bulk leakage.
  • Record what was about to go out, and how many items, without the original text.

There is one thing to try tomorrow. Open one of the incident analysis logs in your team's shared folder and see whether customer names or phone numbers are printed in it. If they are, that log is in a state where it can go out along with the words "find the cause."

Other routes by which personal data leaks through generative AI are in Generative AI data leak cases, and what a company needs to take care of legally is in Korea's AI Basic Act and employee AI use.

Frequently asked questions

With an enterprise plan, is it OK to put customer data in?

Even under terms that exclude training, the request is processed on a server outside the company and retained for the set period. It amounts to entrusting customer information to an outside party, so the requirements for outsourcing and overseas transfer have to be examined. Check how they apply in your case with your legal and privacy teams. The simplest route is not to send customer information that debugging does not need.

If .env is in the exclusion settings, is API key leakage solved?

No. The official documentation for both tools says that exclusion settings cannot block all access. Keep keys in a secrets store outside the repository, and if you suspect one has gone out, rotate the key first rather than deleting the conversation.

Does the Cover gateway also inspect other coding tools, such as Cursor?

The coding tools whose content is inspected today are Claude Code, OpenAI API tools such as Codex CLI, GitHub Copilot and Gemini CLI. Other tools are not inspected. If the company uses this scope as the basis when deciding which tools to allow, actual use and what the company can see will line up.

  • #AI coding tool security
  • #Claude Code security
  • #GitHub Copilot security
  • #source code leak
  • #API key leak
  • #AI policy for developers
  • #AI security solution

Looking to protect data without blocking AI at work?

Tell us which AI services and PCs you use, and we will arrange a demo and a pilot.

More posts