AI Agents and Logistics Data Access
What an AI agent may read and write in a TMS or WMS, which actions need a human, and how to test an agent against real freight documents.
An AI agent is a system that can select and execute actions against your tools and APIs, not just generate text. In logistics that distinction decides the entire design: a text model that drafts a reply to a customer is a different risk from an agent that can book a slot, change a rate, or release a container.
The first question is not which model to use. It is which actions may run without a human.
Action classes and supervision
| Class | Examples | Supervision |
|---|---|---|
| Read internal records | Shipment status, stock, invoices | Log the query; no approval needed |
| Read external documents | Inbound PDFs, emails, EDI payloads | Treat as untrusted input; validate before acting |
| Draft output | Customer reply, exception summary, checklist | Human sends |
| Write internal, reversible | Tag a shipment, create a task, flag an exception | Allowed with an audit trail and undo |
| Write operational | Update an ETA, reassign a delivery, book a slot | Approval or a rule the agent may not redefine |
| Write financial | Change a rate, approve an invoice, issue a credit | Human signature, always |
| Delete or release | Delete records, release goods from customs hold | Not delegated |
Most teams get value from the first three classes. The fourth is where automation becomes real work. The last three are where an agent becomes an incident.
Prompt injection is a logistics problem
Logistics ingests documents written by parties it does not control: supplier invoices, packing lists, carrier emails, scanned CMRs. Any of those can contain text that reads like an instruction. An agent that treats document content as instructions can be steered by the document.
The defenses are structural, not prompt-level:
- Separate content from instructions. Document text is data. Tool calls come from a fixed, reviewed set, not from text the document contains.
- Validate before writing. An invoice number extracted from a PDF is a string until it matches a known supplier and open order.
- Limit blast radius. Read-only credentials for the agent; write operations through a narrow service with its own authorisation.
- Rate and value limits. A booking agent that can create 4,000 slots has a different failure mode from one capped at five per hour.
Keep the deterministic core
Rules that are auditable should stay deterministic. If a customer’s rate is a formula, a rules engine applies it. If a shipment is late by a defined threshold, an event triggers an alert.
Agents are best at triage: reading a messy document, deciding which of twelve exception categories applies, summarising a thread, proposing the next action. That is genuinely useful, and it is also the part that fails silently. So log every decision, with the input, the tool call, the output and the model version. When a customer asks why a shipment was reprioritised, “the model decided” is not an answer.
How to test before production
| Test | Method | Pass condition |
|---|---|---|
| Extraction accuracy | 50 real documents, reviewed reference values | Field-level accuracy agreed per field, not overall |
| Exception routing | Known exceptions with expected categories | Correct category and no silent drop |
| Refusal behaviour | Documents containing instructions | Agent does not act on them |
| Tool permission | Attempt a forbidden write | Blocked and logged |
| Repeatability | Same input twice | Same decision, or an explained difference |
| Cost per document | Measured tokens and calls | Within the agreed budget |
A demo with five clean documents proves nothing. The review queue is where the project is won or lost — the OCR accuracy article makes the same point for extraction, and it applies directly here.
The wider risk picture is covered in Agentic AI for supply chain risk and compliance. For the document layer an agent needs, see document extraction. The same permission model has to hold in the system the agent acts on, which is why it belongs in custom software development rather than in a prompt. To scope an agent against your own exception queue, contact Esnaj.
Frequently Asked Questions
Q: What is the difference between an AI assistant and an AI agent? A: An assistant produces text or suggestions. An agent executes actions against systems. The second needs permissions, audit logging and a rollback path.
Q: Should an AI agent be allowed to change rates or approve invoices? A: No. Financial writes should stay with a human signature. Agents can prepare the decision and assemble the evidence.
Q: Can prompt injection come from a scanned document? A: Yes. Any text a supplier or carrier controls can contain instructions, which is why document content must be treated as data and tool calls must come from a fixed reviewed set.