Automate Invoice Intake Without Sending Anything to the Cloud
Invoice processing is the textbook case for a local agent: repetitive, rule-heavy, arithmetic-critical, and full of data you would rather not hand to a third party.
Supplier invoices are the most common thing people want to automate and the most common thing they should not hand to a cloud service. They contain your suppliers, your prices, your margins and your payment terms, and they arrive as PDFs that need reading rather than parsing.
This walkthrough builds the smallest honest version: read from a folder, extract fields, verify the arithmetic in a deterministic engine rather than a model, and escalate anything that does not add up. It is deliberately not a system that pays invoices.
The shape
The skill
One SKILL.md, with the rules that matter written as instructions the model cannot talk itself out of. The three constraints at the bottom are the difference between something you can defend to an auditor and something you cannot.
Run one through
Start with dryRun: true. It routes the message and performs the calculation without calling a model at all, which is exactly what you want while you are still checking that the maths is right.
What to keep a person for
- Anything that does not reconcile. No exceptions, no tolerance band that quietly swallows small errors.
- New suppliers. First invoice from anyone is a review, always. This is also the control that catches invoice fraud.
- Payment itself. Extraction and checking can be automated; authorising money leaving the company should not be.
- Anything the model flagged as ambiguous. A skill that never returns "review" is not being honest with you.
If you have not run the agent yet, start with the quickstart. Before you point it at real invoices, read how to secure it — this is the tutorial where it starts touching documents that matter.
Key takeaways
- Invoices are a strong local-agent case: repetitive, rule-heavy, arithmetic-critical, commercially sensitive.
- The model reads the document; a deterministic engine does every calculation. Never blur that line.
- Amounts are integers of the smallest currency unit, end to end. Floats belong nowhere near money.
- "Review" must be a first-class outcome, and new suppliers should always land in it.
- Automate extraction and checking. Do not automate paying.
Frequently asked questions
Can it read PDFs, not just text?
The built-in fs.read tool reads UTF-8 text. For PDFs you add an extraction step in front of it — locally, with something like a local OCR or PDF text layer extractor — so the document still never leaves the machine.
How accurate is the extraction?
Accurate enough to be useful and never accurate enough to trust unattended, which is why the design routes anything doubtful to a person. Measure it on your own invoices before you decide the volume you are comfortable with.
Can this post entries into our accounting system?
Technically yes, through an allow-listed HTTP call. Whether it should is a different question — most teams start with the agent producing a reviewed batch that a person imports, and only automate the write once the review queue has been boring for a few months.
Want one of these built for your own workflow?
OpenClerq is open source and yours to run. If you would rather not build the module yourself, tell us what the work actually looks like and we will scope one — or tell you honestly that an off-the-shelf tool does it better.
Describe the workflow
A couple of sentences is enough to get a straight answer.
- Fixed-scope quote — no obligation
- Reply within 1 business day
About the author
Paxa Media
Written by the Paxa Media delivery team — the same developers, marketers and strategists who build these systems for clients. We are a technology company based in Rijeka, Croatia, and we publish the real numbers we quote rather than "it depends".
Why you can trust this
- Builds and operates the systems described here — websites, web and mobile apps, automation and integrations
- Delivered by an in-team staff in Rijeka, Croatia; no outsourced or resold work
- Price ranges published here are the ranges we actually quote
Keep reading
All tutorials →Write Your First OpenClerq Skill: One Markdown File
A skill is a Markdown file with frontmatter. Here is the smallest one that does something useful, and how to check the routing actually works.
CRM & systemsBusiness Process Automation: From Spreadsheet Chaos to a System
Every growing business hits the point where spreadsheets and manual steps start dropping the ball. Automation is how you turn that chaos into a reliable system.
AI & automationHow to Secure a Local AI Agent: Token, Loopback, File Roots, Allow-Lists
"It runs locally" is not a security model. Four controls decide what an agent on your machine can actually reach — and all four have sensible defaults you should still check.