AI Agents for Document Scanning Services: Batches and Chain of Custody
Learn how AI agents track scan batches, file naming and custody logs so a document scanning company can show where every box and file went.

An AI agent for a document scanning company keeps a running record of each scan batch, the file names assigned to its pages, and every handoff from pickup to return, so the customer can see where a box or file is at any time. The agent does not replace scanners or operators. It reads the events those systems already produce, applies the naming and custody rules the business has agreed to, and answers status questions from that record.
Key takeaways
- A batch is a named unit with an identifier recorded at intake and linked to the customer order and to every file it produces.
- File naming is a contract: a fixed pattern that encodes customer, batch, box and sequence, so anyone can locate a page without guessing.
- A custody log records each handoff with the actor, time, location, action and condition, and it is append-only.
- The agent answers status questions from the log and escalates gaps. It does not edit history, promise dates it cannot verify, or release files on its own.
- Start with one workflow, one naming pattern and one exception path before connecting more systems.
Why the batch is the unit customers actually ask about
Customers rarely ask about a single page. They ask where box 14 is, whether the invoices from one year passed quality control, or who signed for the boxes that went to a partner site. The question is almost always about a group, and the answer depends on how the business defined that group in the first place.
Most scanning operations use four batch types, even when they do not name them. An intake batch is what arrived from the customer on a given day. A scan batch is the set of boxes or sheets fed through equipment in one session. A quality batch is what a reviewer checked, and a return batch is what left the building. One intake batch can split into several scan batches, and several scan batches can merge into one return. Tracking breaks when these relationships are implied rather than recorded. The agent can only report what the business has chosen to link.
Before any automation, write the batch definitions down in plain language and agree on them with operations. Decide who can open and close a batch, what counts as a complete batch, and what happens to a box that arrives damaged or incomplete.
How should file names be designed?
A file name is the cheapest place to store structure, because it travels with the file into folders, exports and customer systems. A useful pattern encodes the customer code, the batch identifier, the box identifier and a sequence number. The exact format matters less than its rules. An illustrative pattern might look like CUSTOMER-BATCH-BOX-PAGE, where each part is fixed in length and uses only letters, digits and hyphens.
Write the rules down so that a person and an agent apply them the same way:
- Use fixed-length segments so that sorting and searching behave predictably.
- Avoid spaces, accents and characters that break exports or some document systems.
- Never reuse an identifier, even after a file is deleted or reissued.
- Do not rename a file to fix an error. Create a corrected version that references the original and records the reason.
- Keep the mapping from physical box to batch identifier in the intake record, not in someone's memory.
A name that follows these rules lets the agent answer a question like where page 40 of box 14 went without scanning a folder tree, and it lets a reviewer spot a file that does not fit the pattern.
What a custody log must record
A custody log is a sequence of events. Each event should answer a small set of questions: what happened, to which container or file, who or what did it, where, when, and under which instruction. Typical events include received, opened, scanned, flagged, reviewed, moved to staging, returned, held and destroyed. Each event needs an identifier of its own, a timestamp with a time zone, and a reference to the batch or box it touches.
The log should be append-only. If a staff member recorded the wrong location, the correction is a new event that points to the mistaken one and states what changed. Deleting or silently editing an entry removes the evidence that custody was checked. Observability practice describes the same principle for system telemetry: signals are useful when they carry consistent identifiers and timestamps that allow events to be connected after the fact. For a scanning business, the signals are the scanner export, the barcode reads at receiving, the reviewer's sign-off and the courier record.
Not every event needs to be captured automatically. Some are simple to log from equipment, such as a scan session starting and ending. Others, like a condition note that a page was water-stained, come from people. Decide which events are required for a return to be considered complete, and make the agent treat a missing required event as an open item, not as a silent success.
A custody log is only as strong as its weakest unlogged handoff.
Illustrative scenario: a box that stops in staging
Illustrative scenario, not a client case: a customer asks where one box of personnel records is, because a return was promised for the end of the week. The agent finds the intake event, the scan batch that processed the box, and the quality review that passed it. The last custody event shows the box moved to a staging shelf. No return event follows.
A well-designed agent does three things here. It tells the customer what the log shows, with the time and location of the last recorded event. It does not guess that the box is probably on the courier truck. It creates an exception item for the operations lead, with the box identifier, the last event and the missing return event, and it drafts a message for a human to approve before anything is sent. The answer is calm and specific because the record is specific.
The same pattern applies to the adjacent problems in document-heavy work. Teams that track document status across handoffs, such as the ones described in AI Agents for Import Export Companies: Documents and Status, face the same need for an event trail that is readable by both staff and customers.
Permissions and the risk of text inside documents
Decide what the agent may read, what it may write and what it may never touch. Least privilege is the working rule: the agent gets read access to the batch and custody records, write access only to draft messages and exception items, and no ability to delete entries, close batches on its own or confirm destruction of records. OWASP's authorization guidance points to the same habit of denying by default and granting narrow permissions that match a defined job.
Scanned documents add a particular risk. OCR output is text written by a third party, and it can contain sentences that look like instructions. A page might say to ignore prior rules or to mark a file as approved. OWASP's prompt injection guidance treats external content as untrusted data. For a scanning company, that means the agent reads document text to classify or search it, but never lets document content change its permissions, its naming rules or its custody events. Permission changes are human decisions and should be logged as such.
NIST's AI Risk Management Framework is a useful structure for deciding who owns each of these risks before the first live workflow runs: who maps the risk, who measures it, who manages it and who is accountable when something goes wrong.
How to tell whether the trail holds up
Measure the trail, not only the agent. Useful checks include the share of batches with all required events, the number of log entries without a matching container, the time it takes staff to answer a status question with and without the agent, and the number of exceptions that were resolved by a correction rather than a silent fix. Run these checks on past batches first, and compare the agent's answers with the manual record for the same boxes.
Set a review rhythm. Weekly spot checks in the first month and a monthly sample afterward are reasonable starting points. Each review should produce either a confirmed result or a specific change to naming rules, event types or permissions. Changes should be recorded like any other custody event, so the operation can explain why a rule changed.
Where to start
Be Human designs, implements and operates personalized AI infrastructure for companies, including agents that keep their identity, memory, channels, tools, permissions and operating context under human control. A first engagement defines one useful role, the memory and tools it needs, the approval boundaries and an observable success criterion, such as how many status questions the agent answers from the log without an exception. Managed operations can then cover monitoring, recurring evaluations, integration maintenance, permission review, incident response and controlled improvements to naming rules and event types. The work is remote and available in English and Portuguese.
If you want to find the first task worth handing to an agent in your own operation, take the free Be Human AI diagnostic.
Frequently asked questions
Does a scanning company need a new system to track batches and custody? Not necessarily. Many operations already produce scanner exports, barcode reads and courier records. The work is usually to define the batch and event rules, connect the sources that already exist, and make sure a missing required event is visible rather than hidden. A new system is only needed when the current sources cannot identify containers or record handoffs at all.
Should customers be able to ask an AI agent where their files are? They can, if the agent answers only from the custody log, states the time and location of the last recorded event, and sends exceptions to a person before anything is promised. The agent should never confirm delivery dates or release records on its own. Customer-facing messages should be drafted for approval until the business has measured how reliable the answers are.
How should personal data in scanned documents be handled by an agent? Treat scanned content as personal data where it identifies people, and limit the agent to the fields it needs for its job. In Brazil, the Lei Geral de Proteção de Dados applies, and the national data protection authority, ANPD, publishes guidance for organizations. Keep document content out of logs where it is not needed, restrict access by role, and review permissions on a schedule.
How long does it take to get the first workflow running? The timing depends on how many systems are involved and how clearly the batch definitions already exist. A sound first step is narrow: one customer flow, one naming pattern, one exception path and one success criterion. Widening the scope should wait until the first workflow produces records that staff trust.
Your next step
See where an AI agent fits in your company first.
Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.
Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.


