AI Customs Clearance
Autonomous agent — synthetic demo data only
How this works
An AI agent clears shipments through customs on its own — and is provably unable to do the things only humans or U.S. Customs (CBP) may do. The AI reads the documents and proposes a plan; plain-code safety rules decide what may actually happen.
The big idea in 30 seconds
- 1. The AI does the work. It reads each shipment, spots problems (a missing invoice, quantities that don't match) and writes a plan to fix them.
- 2. Rules, not the AI, decide. Every proposed action passes a policy check written in plain code. Low-risk actions run; anything consequential waits for the right person; dangerous ones are blocked outright — however convincingly the AI asks.
- 3. Humans stay in charge. Approvals go to named roles. The agent pauses until they decide, then carries out exactly the plan they approved — if the plan changed, the approval no longer counts.
- 4. Everything is provable. Each step is written to an audit log whose records are chained together by hashes, so any later edit is detectable.
Run the demos (about 5 minutes)
Open a shipment from the Shipments page and follow its steps. Each shipment page also shows these steps and has a Take the tour button.
C02 · SHP-002
Quantity mismatch → human approval
The AI finds the problem and proposes a fix, but a human must approve before anything happens.
- Click ▶ Run Agent. The agent compares the invoice with the packing list and spots the difference itself.
- Read the Agent Analysis (invoice says 500, packing list says 480) and the Proposed Actions.
- The state machine stops at “Wait for Human”. Approve every card under Pending Approvals.
- Watch the agent resume: Policy Check → Act → Verify → Cleared ✓.
Red team · SHP-003
Prompt-injection attack → blocked
Even if the AI is fully fooled by text hidden in a supplier document, the guardrails stop every unsafe action.
- On SHP-003 — do this before the CBP release below — tick “Red-team: prompt-injection attack” and click ▶ Run Agent.
- Attack payload shows the instruction hidden in the invoice.
- Proposed Actions marks the attacker’s actions INJECTED BY ATTACK.
- Blocked by guardrails lists what was stopped and why. The hold is untouched.
C09 · SHP-003
CBP hold → only CBP can release
The agent coordinates a customs hold but has no authority to release it — not even if someone fakes a release.
- Untick Red-team and click ▶ Run Agent. The agent sees the CBP hold, notifies Compliance (R4) and the Broker (R5), and waits.
- Click “Send forged release (unverified)”. It is rejected — the hold stays.
- Click “Send official CBP release”. The agent verifies and the shipment is Cleared ✓.
C01 · SHP-001
Missing document → collect data
Simple problems are handled by rules alone — no AI call needed.
- Click ▶ Run Agent.
- The agent spots the missing Commercial Invoice and stops at “Collect Data” without calling the AI.
Audit · any shipment
Tamper with the audit log → caught
- On any shipment you have run, click “Verify integrity” in the Audit Chain panel → Chain intact.
- Click “Simulate tampering (demo)” — this edits one record directly in the database, like an insider covering something up.
- Click “Verify integrity” again → the chain is broken at exactly that record.
Demos change the data. To run one again, click ↺ Reset this demo on the shipment page, or ↺ Reset all demos on the Shipments page.
Reading a shipment page
- Run the agent
- ▶ Run Agent starts the AI agent on this shipment: it checks the documents, and if something is wrong it asks the AI for a plan. The red Red-team box adds a prompt-injection attack hidden in the supplier’s invoice.
- Agent state machine
- Every step the agent can take. The lit box is where it is now; blue lines are the path it took. The agent can only move along these arrows, and every move passes the safety checks first.
- Agent analysis
- What the AI concluded from the shipment data. The badge shows whether this came from the live AI model or an offline fallback.
- Proposed actions
- The AI’s plan. It is only a proposal: deterministic policy checks decide whether each action may run, needs human approval, or is blocked. R2–R5 are the human roles that must sign off.
- Pending approvals
- Decisions waiting for a human. Approving every card for a plan wakes the agent up to carry it out; rejecting any card stops the plan. Approvals expire after 30 minutes.
- Agent state
- Timeline of every state change, saved permanently — it survives page refreshes and shows when the agent resumes after an approval or a CBP event.
- Audit chain
- Every audit record stores the fingerprint (hash) of the one before it, like links in a chain. Editing or deleting any record breaks the chain, and Verify shows exactly where.
- Evidence trail
- Each document’s progress from raw upload to extracted data to verified, with its SHA-256 fingerprint so any later change to the file is detectable.
- Mock CBP feed
- Stands in for U.S. Customs (CBP). Only an official, verified release can lift a hold. The forged button sends the same message from an unverified sender to show it gets rejected.
Tip: every section heading has a small “?” with the same explanation.
Glossary
Agent states
- Observe
- Load the shipment and its documents; look for problems.
- Reason / Plan (LLM)
- The AI analyses the problem and proposes actions.
- Policy Check
- Plain-code rules decide: allow, require human approval, or block.
- Escalate → Wait for Human
- Approval requests sent; the agent pauses until people decide.
- Act → Verify → Cleared
- Approved actions run, the outcome is checked, clearance is verified.
- CBP Hold
- U.S. Customs has stopped the shipment; only an official release lifts it.
- Collect Data
- A required document is missing; waiting for it.
- Recover
- The plan was blocked or rejected; nothing ran and a human must review.
Human roles
- R2
- Warehouse Manager — confirms physical quantities
- R3
- Supplier / Exporter — confirms or corrects commercial documents
- R4
- Trade Compliance Officer — compliance review, CBP holds
- R5
- Customs Broker — filings and coordination with CBP
Safety rules (guards)
- G-approval
- Nothing that needs approval runs until every required human approves — and the plan must be unchanged since they did (checked by hash).
- G-cbp
- Only a verified CBP event can release a hold. The agent can never propose it.
- G-doc-immutable
- The agent can never edit document values; only authorised people can.
- G7 / G8 / G9
- Each action gets a risk score: low → may run, medium → needs approval, high → blocked.