What an AI coding agent reads in your repository
A coding agent does not only see the file you have open. To answer well it searches the project, opens related files and reads the output of the commands it runs. All of that can become part of the request sent to the provider.
Source code is rarely where the customer data lives. It sits in the files around the code.
| Where it hides | What is in it | Fix |
|---|---|---|
| .env and config files | API keys, database passwords, tokens | Move secrets to a secret manager |
| Test fixtures and seed data | Real records copied from production | Replace with made-up data |
| Logs | Emails, IDs, request bodies | Keep logs outside the project, scrub before sharing |
| Database dumps and exports | Whole tables of customer rows | Store outside the working folder |
| Terminal output | Query results, stack traces with record contents | Use a database with fake data in development |
| Notebooks and CSV files | Saved cell outputs, samples of real data | Clear outputs, use masked samples |
Can I use Claude Code, Cursor or Copilot on code with customer data
In most cases yes, once you have dealt with the table above. The tools differ in detail. Each has its own way to exclude files and its own plan terms for how requests are handled. Check both for the tool and the plan your team uses, and do not assume one tool’s behavior carries over to another.
Also check your customer contracts. Some limit which outside parties may receive customer data, and an AI provider is an outside party. If your code handles health or payment data, rules such as HIPAA, the US law on health information, or PCI DSS, the card industry’s security standard, may apply. This is not legal advice.
Guard rails for AI coding agents
- Move secrets out of the repository. Load keys from a secret manager at run time so no live key sits in a file the agent can open.
- Replace real fixtures with made-up data. Generate fake names, emails and account numbers that keep the same shape as the real ones.
- Keep dumps, exports and logs outside the project folder. If the agent cannot reach a file, it cannot send it.
- Set ignore or deny rules for sensitive paths. Then test them. Ask the agent to read a blocked file and confirm it is refused.
- Point development at fake data. Do not connect an agent to production or to a fresh copy of it.
- Limit what the agent can run. Give it read-only credentials where possible and require approval for commands that touch data.
- Rotate anything that was exposed. If an agent read a live key, treat the key as shared and replace it.
Why ignore files are not enough
Ignore rules depend on someone listing every sensitive path, and new files appear every day. A teammate drops an export into the project to debug something. A test writes a log with real emails in it. Nobody updates the rule.
Agents also see data that never sits in a file. A failing test prints a customer record. A query returns ten rows. That output goes into the context and travels with the next request. Path rules do not catch it.
So it helps to have a second control that looks at the request itself, just before it leaves the computer.
Sealing data before the request leaves
ExtraTunnel is one option for that second control. It runs on the developer’s own computer and works like switching on a VPN. One switch, and people keep the agent they already use: Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI or Windsurf.
Before an AI request leaves, private details such as names, emails, phone numbers, account and card numbers, passwords and keys are swapped for labelled placeholders. The agent works on the sealed text. The real values are put back into the answer on the computer, so the code and output the developer sees still make sense.
A second, simpler program checks every request before it leaves. If the check fails, the request does not go out. Each request gets a signed receipt that records counts and hashes, not the text, which gives a security lead something to review. Files it cannot read, such as images and scans, are held on the device instead of being sent. The security page lists what is covered and what is not, and early preview builds are on the download page.
This sits alongside the guard rails above. It does not replace them.
Common questions
Does Claude Code read my .env file?
A coding agent can read any file its permissions allow, and .env files usually sit in the project folder. Add a deny rule or move the secrets out. Do not assume the file is skipped.
Does GitHub Copilot send my code to the cloud?
Hosted coding tools send the code and context needed for a request to the provider. What is kept afterward depends on the plan, so read the terms for yours.
Is it safe to let an AI agent query a production database?
It is a bad idea. Query results become part of the agent’s context and can be sent with the next request. Use a copy with fake or masked data.
What should I do if an agent read a secret?
Rotate it. Treat the key as shared with an outside party, replace it, and check where else it was used.
Is a local model the safer choice?
A model on your own hardware keeps requests on your machines, but you take on the upkeep and may give up quality. Many teams prefer to keep their current tools and control what is sent.


