When you build an app with AI, you run into moments where you need to prepare data again and again. You want to analyze customer inquiries. You want to come up with proposals based on sales data. You want to build an AI agent that can search your company's documents.
But is it really okay to hand real customer data or company documents to an AI as they are?
So far, I've looked into security when developing with AI, and how much an AI agent should be allowed to do. This time, I want to focus on the information we give to AI itself.
1. What kinds of information do we need to protect in the first place?
Take, for example, bringing AI into running an e-commerce business. Product names and publicly listed selling prices may not need to be kept secret. But what about customers' order details, purchase prices, and actual profit margins?
| Examples of information | Why to be careful |
|---|---|
| Customers' names, addresses, phone numbers, and email addresses | Can lead to identifying individuals and violating their privacy |
| Employees' salaries, health information, and performance reviews | May cause harm to the people concerned |
| Purchase prices, business partners, profit margins, and unannounced sales strategies | Competitors could learn business information |
| Unpublished source code, specifications, and contracts | Related to the secrets and intellectual property of your company and your business partners |
| API keys, passwords, and access tokens | Can lead to unauthorized access or misuse by third parties |
Personal information and trade secrets are not the same thing. Of course, some information falls under both.
According to the Ministry of Economy, Trade and Industry (METI), a trade secret protected under Japan's Unfair Competition Prevention Act has three requirements: it is kept secret (secrecy management), it is useful for business activities (utility), and it is not publicly known (non-public nature).
However, whether or not information qualifies as a trade secret under the law, there is also information whose disclosure to outside parties is restricted by non-disclosure agreements or internal rules. Just because it is data your company holds doesn't mean you can freely hand it to an outside AI, right?
2. Where does the data we enter into AI go?
Typing text into an AI chat window feels a bit like writing in an ordinary notepad. But with cloud-based AI, that information is normally sent to the service provider's systems and processed there.
Furthermore, when you build AI into your own app or agent, the number of places the information passes through grows.
| Where the data passes | What to check |
|---|---|
| Input to the AI and attached files | Whether that information is really needed, and whether sending it outside is permitted |
| The AI service side | Use for training, retention period, storage region, and who can access it |
| Your own app and server | Storage in databases, backups, and error logs |
| External tools and integrated services | What is sent to which service, and whether it is provided onward |
| The AI's answers and generated files | Who can view them, sharing links, and whether the destination of publication is appropriate |
For example, suppose you add file search and email sending to an app that only chats with AI. Now you also need to consider the possibility that the AI sends information it has read to another service.
It matters not only which AI you use, but also understanding where information comes in, where it is sent, and where it remains.
3. If it's "not used for AI training," are we safe?
This was something I was curious about myself.
Even with settings or contracts under which data is not used for AI training, that doesn't mean no data is stored at all. Data may be retained for purposes other than training, such as providing the service, monitoring for abuse, and managing conversation history.
For example, OpenAI's official documentation for its API explains that data sent to the API is not used to train models unless the user explicitly opts in. On the other hand, how logs for abuse monitoring and mechanisms that store application state are handled differs depending on the features used and the contract terms.
In other words, the following four are separate things to check.
- Whether the data you enter is used for AI training.
- Whether inputs and outputs are stored, and when they are deleted.
- Who at the service provider or its contractors can access them.
- Whether sending that data outside is itself permitted under your contracts and the law.
Even for AI from the same company, the conditions can differ between a consumer chat service, a business service, and an API. They can also change with the pricing plan and features, so I'd like to check the latest conditions of the service you actually use.
4. Has information actually leaked from an AI service?
On March 20, 2023, ChatGPT suffered an outage in which some users could potentially see the titles of other users' chat histories.
According to OpenAI's official announcement, it was caused by a bug in an open-source library. For some ChatGPT Plus users who were active during a certain time window, some payment-related information may also have been shown to other users. Complete credit card numbers were not displayed.
This was not a case where information entered by a user was used for AI training and then came out in an answer to someone else. It was a malfunction in the service's system itself.
It shows that when thinking about data management on AI services, it isn't enough to worry only about use for training.
Also, in 2025, Japan's Personal Information Protection Commission (PPC) published information about the use of the generative AI service DeepSeek. It pointed out things users should know, such as that the company's privacy policy states that data, including acquired personal information, is stored on servers in China.
This does not mean that a data leak by that service was established. It is an example showing that the place where information is managed, and even the rules that apply, differ depending on the AI you use.
5. What does Japan's Personal Information Protection Commission say?
On June 2, 2023, the Personal Information Protection Commission issued a caution about handling personal information when using generative AI services.
When a business enters personal information into AI, it needs to confirm that this is within the scope necessary for the specified purpose of use. Also, if personal data is entered without the person's consent and the AI service provider uses it for purposes other than generating answers, this may violate the Act on the Protection of Personal Information. Businesses are asked to thoroughly check how the provider handles the data, such as whether it is used for training.
This does not mean that processing personal information with AI is uniformly prohibited. What needs to be considered changes depending on the actual handling, such as the purpose of use, whether consent exists, whether it is entrustment or provision to a third party, and the rules on provision to other countries.
Be careful with data from which only personal names have been removed, too. Combining purchase history, affiliation, dates, and so on can still reveal a particular individual. Simply deleting names does not make it legally anonymized information.
6. During development, you can choose not to use real data
FrostLoop AI, the app I built when I took part in an AI hackathon, analyzed Amazon inventory data and proposed how to deal with long-term stock.
For verifying the prototype, instead of connecting to a production Seller Central, I used anonymized CSV files and synthetic data.
If you only want to confirm that AI can analyze stock quantity, storage period, and sales status, you don't need to prepare real customer names or order numbers from the start.
For example, even fictional data like the following can verify how the inventory analysis works.
| Item ID | Stock | Units sold in the past 30 days | Days in storage |
|---|---|---|---|
| ITEM-001 | 80 | 5 | 210 |
| ITEM-002 | 12 | 20 | 45 |
| ITEM-003 | 35 | 0 | 320 |
Of course, in actual operation you may need to use real data. But before that, you can sort out what needs to be handed over and how much.
The same goes when you use an AI coding tool for development. Don't carelessly leave business documents, customer data, or configuration files containing secrets in folders the AI can read. Even just separating test data, the development environment, and the production environment reduces the range that can be accessed by accident.
7. How can I avoid leaking users' information from an AI app I built?
Now let's consider the case where you are the one publishing an AI app.
For example, suppose you built an AI that searches company documents and answers questions. There are documents that user A can view and documents that only administrator B can view. Even if the AI can read both, it must not tell A the contents of the documents meant only for B.
In a mechanism called RAG (retrieval-augmented generation), the AI searches external documents, adds the information it finds to its input, and creates an answer. What matters here is that the app itself checks, before passing anything to the AI, whether the user has permission to read that document.
Merely instructing the AI "never reveal secrets" does not amount to sufficient access control. You also need to consider prompt injection, where commands hidden in external documents and the like make the AI act differently than intended.
OWASP also lists disclosure of sensitive information and prompt injection among the risks of generative AI applications.
As a developer, these are the points I'd like to check.
- Limit the data each logged-in user can view.
- Don't put API keys and the like in the AI's instructions or in public code; manage them on the server side.
- Don't carelessly record secret information in error logs or analytics tools.
- Restrict external transmission and data export to permitted purposes and destinations.
- Try inputs that request other users' data in a test environment.
- Delete user data that is no longer needed, in line with your retention policy.
Rather than only hoping the AI judges correctly, we need to build a mechanism where information doesn't get handed over even if the AI makes a mistake.
8. What if I accidentally hand secret information to an AI?
Even if you delete the chat history, you can't assume it has been erased from every place.
First, stop any further sending, and check what you sent, when, and to which service. If API keys or passwords were included, revoke and reissue them as needed, and investigate whether they were misused.
For a company, report to the person in charge internally, and check the provider's data management conditions and deletion procedures. For leaks of personal data and the like, depending on the case, a report to the Personal Information Protection Commission and notification to the individuals may be required. Obligations to notify business partners under non-disclosure agreements and the like may also apply.
Rather than hurriedly deleting all records, it is also important to safely keep the history and records needed for the investigation.
Summary
With AI, data analysis and document organization that humans used to spend hours on can be done in a short time.
That is exactly why we are tempted to hand everything to AI. But whether the purpose can't be achieved without that information, whether it is okay to pass it outside, and how it will be handled once it gets there are things I want to think about separately.
I myself am interested in making my own work more efficient by using AI agents. As the work we entrust to agents grows, the kinds of information they handle will grow too.
Not only what we have the AI do, but what we show the AI, and what we don't. This too is something developers themselves have to decide, isn't it?
References
- Personal Information Protection Commission: Caution on the Use of Generative AI Services (June 2, 2023) (Japanese)
- Personal Information Protection Commission: FAQ on Entering Personal Data into Generative AI (Japanese)
- Personal Information Protection Commission: Information on DeepSeek (Japanese)
- Personal Information Protection Commission: Responding to Leaks and Similar Incidents (Japanese)
- Ministry of Economy, Trade and Industry: Trade Secrets (Japanese)
- Ministry of Economy, Trade and Industry and Ministry of Internal Affairs and Communications: AI Guidelines for Business (Version 1.2) (Japanese)
- IPA: Security Tips for AI Users (Japanese)
- OpenAI: Data controls in the API (Your data)
- OpenAI: March 20 ChatGPT outage report
- OWASP: LLM02:2025 Sensitive Information Disclosure
- OWASP: LLM01:2025 Prompt Injection
This article is a general reflection based on publicly available materials as of November 21, 2026, and my own development experience. It does not guarantee the legal compliance or safety of any particular business or system. Please check the latest contracts and settings of the services you actually use, the relevant laws, and your internal rules.