Skip to content

Why operational AI needs an approval boundary

Separate analysing information from taking consequential actions, bind every approval to a specific change, and make each decision traceable.

Published
Reading time
3 minutes
Written by
Cyber Vision engineering

A model that reads invoices and suggests account codes is useful. A model that reads invoices and releases payments is a liability, even if it is right most of the time. The difference is not the model. It is where the system draws the line between proposing and doing.

Start with the action, not the model#

Before choosing a model, list what the workflow is allowed to do. Reading a document, suggesting a value and changing a financial record are different levels of authority, and the architecture should make that explicit.

AuthorityExampleWho can complete it
ReadClassify an attachment, extract fieldsThe system
SuggestPropose an account code or a matching purchase orderThe system, shown to a person
ChangeUpdate a supplier record, post an invoiceA person with that permission
CommitRelease a payment, send to a customerA person, with a recorded approval

Most of the value sits in the first two rows. That is also where mistakes are cheap.

Keep the source attached#

An extracted field should point back to where it came from: the document, the page, ideally the region. Reviewers need the evidence next to the proposed value. A fluent explanation from the model is not a substitute for a source record.

proposal.ts
type Evidence = {
  documentId: string;
  page: number;
  excerpt: string;          // the text the value was read from
};
 
type ProposedChange = {
  id: string;
  recordId: string;
  field: "supplierId" | "accountCode" | "amount";
  current: string | null;
  proposed: string;
  confidence: number;       // model score, used for routing, not for trust
  evidence: Evidence[];
};

Approve a specific change#

Approval should authorise one concrete change to one record, not a vague instruction to continue. Store who approved it, what they saw and which version they saw. If the document or the proposal changes afterwards, the approval no longer applies.

approve.ts
type Approval = {
  changeId: string;
  approvedBy: string;
  approvedAt: Date;
  proposalHash: string;     // hash of the exact proposal the reviewer saw
};
 
function canExecute(change: ProposedChange, approval: Approval | null) {
  return approval !== null && approval.proposalHash === hashProposal(change);
}

Design for interruption#

External APIs fail, tokens expire and messages arrive twice. Give the workflow explicit states so a failure leaves it somewhere recoverable:

  1. 01Proposed
  2. 02Approved
  3. 03Executing
  4. 04Completed
Approval binds to a version. Anything that changes the proposal sends it back to review.

Execution should be idempotent where the target system allows it, and retries should be visible. Silently repeating a consequential action is how a payment gets sent twice.

Measure the workflow, not just the model#

Evaluate extraction against a representative set of real documents, and keep that set as new formats appear. Then track what happens in production:

  • the corrections reviewers make, by field;
  • suggestions rejected outright;
  • items that stall in a state for longer than expected;
  • execution failures by category.

Start with one narrow process whose results the team can inspect, and expand the system's authority only when the numbers justify it.

  1. Infrastructure · 3 min read

    Changing a PostgreSQL schema without taking the application down

    Expand, migrate, contract: how to add columns, indexes and constraints to a live table without long locks or a maintenance window.

  2. Software Architecture · 3 min read

    Idempotency keys in PostgreSQL: a pattern that survives retries

    Clients retry, webhooks repeat and networks time out. A small table and one unique constraint make a write safe to repeat.

  3. Commerce Engineering · 3 min read

    A storefront is only the beginning of commerce operations

    Orders become operational work. Design the connection to inventory and fulfilment around that reality, not around the checkout.