What Leaves The Building: Data Handling In An AI Workflow
Every agent call sends data somewhere else. Map the hops, minimise at the boundary, and treat your own traces and eval sets as copies of customer data.
The first security review of an AI project usually asks the wrong questions. Which model? Is the vendor certified? Is the connection encrypted? All reasonable, none of them decisive. The question that matters six months later is narrower and harder: which fields from which internal systems are now sitting on someone else’s disk, and for how long.
Most teams cannot answer it. They know the vendor’s name. They do not know the data path.
That gap is operational before it is legal: you cannot approve a workflow you cannot describe. And the payload is rarely a tidy record — it is an assembled prompt, a retrieved document set, a tool result that returned more than anyone intended.
The path is longer than the diagram
A single agent call looks like one arrow: your application, then the model. In practice it is a chain.
A request arrives, your code assembles a prompt from a database row and two retrieved documents, the prompt goes to a vendor’s inference endpoint, the vendor logs it for abuse monitoring, your observability tool records prompt and response, and someone later copies an interesting failure into a spreadsheet or a regression set. A support ticket gets pasted into a chat window to debug it. The chat window retains it.
That is five or six copies before anyone has thought about retention. Every hop is another access control list, another deletion path, another place a customer’s data outlives the conversation it came from.
Drawing that chain takes an afternoon and is the most useful thing most teams do in their first month of AI operations. It also tends to produce one uncomfortable finding: the model vendor is usually not the loosest link. Your own tooling is.
Start with one task, not the whole company
Company-wide data inventories die in review. Do the live workflow only. Open the function that builds the payload and list every field that actually goes out, then ask of each whether the task fails without it. Two lists appear fast: fields doing work, and fields that arrived because they were attached to the record.
The invoice approval agent needs amounts, vendor names and purchase order numbers. It does not need the complaint thread, the customer’s home address and the account manager’s mobile number — but those arrived in the same object a naive fetch returned, so they got sent. Nobody chose to send them.
That is the normal shape of over-sharing: a convenience decision made once inside a helper function and never revisited.
Minimise at the boundary, not in the prompt
“Don’t include personal data in the prompt” is an instruction. Instructions are not controls. The model will follow it until the day a retrieved document contains something it should not repeat, and then it will repeat it faithfully.
The control is the code that builds the payload: an explicit allowlist of fields, constructed rather than filtered, with a review step when a new field is added. This is the outbound mirror of permission scoping — teams spend their effort on what the agent may read, and almost none on what it may send onward.
Redaction is the second net, not the first. Pattern matching catches card numbers and government identifiers cheaply; it does not catch names, addresses, medical details or a customer’s free-text complaint, because none of those have a shape. If the free text must go to the model it goes as-is, which makes it a task design decision, not a filter decision.
Better still, do not send the record: send the derived answer — the classification, the extracted total, the three fields the next step needs. Data that never leaves cannot leak.
Retention is a configuration, and configurations differ per endpoint
Most vendors offer settings that keep prompts out of training and shorten log retention. They are useful and usually per-endpoint: turning off logging on the chat path does not apply to a batch job, a file upload, an embedding call or a fine-tuning dataset. Abuse monitoring often retains content for a period regardless of what you opted into.
So the honest process is short: read the current terms for the endpoints you actually call, record what is retained and for how long, and re-read them when you enable something convenient. Terms change more often than bookmarked pages do.
Deletion is the other half. If a customer asks to be removed, you need to know whether their data also sits in a prompt log, a trace, an evaluation file, or a spreadsheet someone made in March. “We deleted the record” is not an answer if four copies remain.
Your traces are a copy nobody counts
Tracing is not optional in a deployed agent — it is how you find out why a task failed at 3am. But a trace stores the full prompt and response and ships them to another vendor, which makes your observability tool a data processor with the same obligations as the model vendor — and frequently the least scrutinised system in the stack.
Three things worth doing there: set a retention window measured in weeks rather than the default, redact at the tracer rather than trusting the payload to be clean by then, and put access control on the trace viewer. An internal dashboard with no authentication and complete prompt history is a data exposure with a friendly interface.
Evaluation sets are a database
The regression set makes changes safe to ship, and building it from real samples is the right instinct. It is also a permanent copy of customer data without the source system’s protections: it needs an owner, a retention rule and access control, plus a decision about committing fixtures. A test file in version control outlives every deletion request you will ever honour.
Where only the shape matters, synthetic replacements do the work; a consistent fake name tests exactly as well as a real one.
One page per workflow
The deliverable is not a policy. It is a page per live workflow with five lines:
- Data in — classes, not field names. Customer identifiers, financial records, free text.
- Where it goes — every hop, including your own tracing and any vendor subprocessor.
- Retention at each hop — actual period, or “unknown” written honestly.
- Who can read it — named roles, not “the team”.
- Deletion path — what you can delete, what you cannot, and what you would have to ask a vendor to delete.
Add a sixth line for what is explicitly blocked from leaving, and you have a document that answers “can we use this tool for this workflow” without scheduling a meeting.
None of this is exotic: it is the discipline you would apply to any system that copies records to a third party, applied where the payload is assembled at runtime and rarely reviewed by anyone. Teams that get it right find the answer is not “send less AI” but “send less data, and know where the rest went”. That mapping is where we start on our services page, before a workflow goes near a live customer record.
Want this running in your business?
Start with an automation audit — we map the highest-value workflows and show you what an agent can take on.
Book an Audit