← Q&A Library
Enterprise AI Security TB15

What Logs Should an AI System Keep So You Can Trace Who Asked What and What the AI Did?

The short answer

An AI system should record at least "who, when, where, what, and the result": who the user is, the time, which interface and version, what was asked or what the AI was told to do, which documents the AI read, which tools it called, whether a person approved, and whether it succeeded or failed. The OWASP Logging Cheat Sheet says each log entry must record when, where, who, and what; passwords, keys, tokens, and sensitive personal data should not be written into logs directly, but masked or de-identified. Article 12 of the Enforcement Rules of Taiwan's Personal Data Protection Act also lists "usage records, trail data and preservation of evidence" as one of the security measures that may be adopted.

1. Which fields to record

OWASP category What ordinary systems record What AI systems should add
When Event time and logging time An identifier for the conversation or task that links its steps together
Where Application name and version, host, service, page or entry point Which model and model version, and which version of the prompts and settings
Who User identity, source device or IP Whether a person acted or an AI Agent ran automatically, and on whose behalf
What Event type, severity, action, object, result, reason Which documents were retrieved (document IDs are enough), which tools were called with which parameters, who approved, and the AI's reply or action result

The left two columns summarize the event attributes in the OWASP Logging Cheat Sheet; the right column applies the same principle to AI systems.

2. What not to record

OWASP lists data that should usually not be recorded directly in logs but removed, masked, hashed, or encrypted instead, including session identifiers, access tokens, sensitive personal data (such as health data and government identifiers), passwords, database connection strings, encryption keys, bank account or payment card data, and commercially sensitive information. It also suggests de-identifying non-sensitive personal data such as names, phone numbers, and email addresses when identity is not required.

For AI systems: employees' questions and the AI's answers often contain personal or confidential data, so decide in advance whether to keep full text and for how long, and write it into the rules. Common choices are keeping only summaries or document IDs, or keeping full text with personal data masked and a shorter retention period.

3. Protect the logs themselves

OWASP warns that logs may contain personal and sensitive information, must be protected from tampering in transit and from unauthorized access, modification, and deletion once stored, and that you should be able to detect when logging stops or has been tampered with. In practice:

  1. Store logs outside the AI system, and do not give the AI Agent permission to delete them.
  2. Limit who can read logs, and log the reading itself.
  3. Set a retention period and delete logs when it ends.

4. What laws and frameworks say

  • Article 12 of the Enforcement Rules of Taiwan's Personal Data Protection Act: the technical and organizational measures taken to prevent personal data from being stolen, altered, damaged, lost, or leaked may include "usage records, trail data and preservation of evidence," in proportion to the protection purpose.
  • NIST AI Risk Management Framework 1.0: GOVERN 4.3 calls for practices that enable AI testing, identification of incidents, and information sharing; MANAGE 4.1 calls for post-deployment monitoring plans, including incident response and recovery. None of this works without logs.
Brand information | Think BIG

How Think BIG handles logs during deployment

Think BIG (Think BIG Make it Real CO., LTD.) is an enterprise AI Agent deployment provider headquartered in Taiwan. Starting from protecting company data, we build AI Agents inside the client's own environment (company hardware, or a cloud server under the company's account). There are two deployment options: with the on-premises version, models and documents are processed on company hardware; with the cloud-assisted version, employees' questions and the document passages the system retrieves are sent to the model provider for processing.

  1. Where logs live is listed first: where the application, model, knowledge-base index, source documents, logs, and backups each sit is listed item by item before building, with purpose, access roles, and retention noted.
  2. Permission changes are recorded: outbound sending, spending, and changes to production systems require approval by a designated person, and adding or adjusting permissions leaves a change record.
  3. Pre-delivery security review: before each system is delivered, its code and configuration go through a security review; if it does not pass, it is not delivered.

See On-premises AI and data sovereignty and Trust.

The actual scope of Think BIG's services follows what both parties confirm.

FAQ

Q1: What should an AI system log?
At least who, when, where, what, and the result. For AI systems, also record which model and version was used, which documents were retrieved, which tools were called, and who approved. This follows the when, where, who, and what principle in the OWASP Logging Cheat Sheet.
Q2: Should employees' full questions to the AI be stored?
Not necessarily. Questions and answers often contain personal or confidential data, so decide in advance whether to keep full text or only summaries and document IDs, and for how long, and write it into the rules. OWASP advises not writing sensitive personal data into logs directly but masking or de-identifying it.
Q3: How long should AI logs be kept?
There is no one-size-fits-all period. Set a retention period based on the applicable laws, contracts, and purpose, and delete logs when it ends. Article 12 of the Enforcement Rules of Taiwan's Personal Data Protection Act lists usage records and evidence preservation as a security measure, in proportion to the protection purpose.
Q4: Should actions an AI Agent takes automatically be logged too?
Yes. AI Agents call tools, change data, and send messages on their own. Every tool call, its parameters, on whose behalf it ran, who approved it, and the result should be recorded so it can be traced if something goes wrong.
Sources (checked 2026-10-24)
  1. OWASP Logging Cheat Sheet (event attributes, data to exclude, protecting logs): cheatsheetseries.owasp.org
  2. Enforcement Rules of the Personal Data Protection Act, Article 12, Laws & Regulations Database of Taiwan: law.moj.gov.tw
  3. NIST AI 100-1, Artificial Intelligence Risk Management Framework (AI RMF 1.0) (GOVERN 4.3, MANAGE 4.1): nvlpubs.nist.gov
  4. Think BIG, On-premises AI and data sovereignty (data-flow list including logs and backups): thinkbigtw.com

This article summarizes public official documents, laws, and security standards to help companies evaluate AI adoption. It is not legal advice. For Taiwan law, the latest text on the Laws & Regulations Database prevails; external documents, prices, and specifications follow their original sources. The actual scope of Think BIG’s services depends on what both parties confirm.

Q&A Library  ·  Think BIG Home (EN) Think BIG, Make it Real!  Think BIG Make it Real CO., LTD.