Skip to content

Commit e8fe6e6

Browse files
stubborncoderclaude
andcommitted
Add Invoice Verification Agent blog post (CFO Living Examples, Part 2)
Unlisted for review: live at /blog/invoice-verification-agent/ but not linked from the landing page or part 1's "More writing" yet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent efe7c6c commit e8fe6e6

File tree

1 file changed

+306
-0
lines changed

1 file changed

+306
-0
lines changed
Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
1+
---
2+
import BaseLayout from '../../layouts/BaseLayout.astro';
3+
---
4+
5+
<BaseLayout
6+
title="Your AP Agent Knows Who's at Fault: ~/stubborncoder"
7+
description="What changes when an AI agent 3-way matches every invoice, separates vendor-caused problems from internal ones, and routes each to the right person."
8+
activeLink="writing"
9+
>
10+
11+
<section class="post-hero">
12+
<div class="post-hero-bg"></div>
13+
<div class="post-hero-overlay"></div>
14+
<div class="post-hero-content wrap">
15+
<a href="/#writing" class="post-back reveal">&#8592; Back to writing</a>
16+
17+
<div class="post-meta-top reveal">
18+
<span>April 2026</span>
19+
<span>&middot;</span>
20+
<span>8 min read</span>
21+
<span class="series-badge">CFO Living Examples</span>
22+
</div>
23+
24+
<h1 class="reveal">Your AP Agent Knows<br><span class="em">Who's at Fault</span></h1>
25+
26+
<p class="post-subtitle reveal">
27+
Most AP mistakes look like vendor problems. Half of them aren't. An agent that
28+
can tell the difference changes who gets the email, who gets the memo, and who
29+
pays for the error.
30+
</p>
31+
32+
<div class="post-tags-row reveal">
33+
<span class="post-tag post-tag--ember">AI Agents</span>
34+
<span class="post-tag post-tag--gold">AP Automation</span>
35+
<span class="post-tag">3-Way Matching</span>
36+
<span class="post-tag">CFO Office</span>
37+
<span class="post-tag">Autonomous</span>
38+
</div>
39+
</div>
40+
</section>
41+
42+
<main class="wrap">
43+
<article class="article">
44+
45+
<div class="series-intro reveal">
46+
<span class="series-label">CFO Living Examples, Part 2</span>
47+
<p>A series exploring how AI agents change the daily reality of finance teams. Not theory: working systems you can try.</p>
48+
</div>
49+
50+
<h2 class="reveal">The overnight problem</h2>
51+
52+
<p class="reveal">
53+
Between the time AP closes on Friday and reopens Monday, invoices stack up and
54+
quietly cost you money. A 2/10-Net-30 invoice that slips past day ten is real cash
55+
left on the table. A duplicate sneaks through because it came from a different
56+
email address. A 7% price variance gets rubber-stamped because the clerk was
57+
clearing a 200-invoice queue. A cost center blows past its quarterly budget and
58+
nobody notices until month-end.
59+
</p>
60+
61+
<p class="reveal">
62+
The Invoice Verification Agent closes that gap. It runs in <strong>continuous cycles</strong>:
63+
read invoices, 3-way match against POs and goods receipts, detect issues, assess
64+
materiality, draft the right response, and hand clean invoices to the payment
65+
queue. Every cycle. Every invoice.
66+
</p>
67+
68+
<h2 class="reveal">How it makes decisions</h2>
69+
70+
<p class="reveal">
71+
The agent works in three layers, in order.
72+
</p>
73+
74+
<div class="policy-grid reveal">
75+
<div class="policy-row">
76+
<span class="policy-days">Layer 1</span>
77+
<span class="policy-action">3-way match</span>
78+
<span class="policy-desc">Invoice line vs PO line vs goods receipt. 2% price tolerance, exact on quantity.</span>
79+
</div>
80+
<div class="policy-row">
81+
<span class="policy-days">Layer 2</span>
82+
<span class="policy-action policy-action--amber">Issue detection</span>
83+
<span class="policy-desc">Price mismatch, quantity mismatch, duplicate suspect, missing PO, missing receipt, budget threshold.</span>
84+
</div>
85+
<div class="policy-row">
86+
<span class="policy-days">Layer 3</span>
87+
<span class="policy-action policy-action--warn">Responsibility</span>
88+
<span class="policy-desc">Vendor, internal, mixed, or informational. Drives who gets contacted.</span>
89+
</div>
90+
</div>
91+
92+
<p class="reveal">
93+
Layer three is the one that matters. A price mismatch is <em>vendor-caused</em>, so
94+
we ask the vendor to fix it. A cost center blowing its budget is <em>internal-caused</em>,
95+
so we escalate to the CC owner and the vendor never hears about it. A missing PO
96+
is <em>mixed</em>: maybe procurement forgot to create it, maybe the vendor shipped
97+
without one. Different paths, different emails, different people.
98+
</p>
99+
100+
<blockquote class="reveal">
101+
<p>Most AP automation treats every exception the same way. Classifying who's actually responsible is the difference between "useful" and "doesn't embarrass you in front of vendors."</p>
102+
</blockquote>
103+
104+
<p class="reveal">
105+
Once the issue is classified, the reasoning layer picks one of five actions per
106+
invoice, with a materiality judgment and a plain-English rationale:
107+
<strong>approve</strong>, <strong>request_correction</strong> (vendor-facing),
108+
<strong>hold_pending_internal</strong> (internal only, vendor stays out of it),
109+
<strong>reject_to_vendor</strong>, or <strong>reject_internal</strong>. Safety
110+
overrides catch the obvious failure modes: it can never approve an invoice with
111+
blocking issues, and it can never reject to a vendor before a human has reviewed
112+
it internally.
113+
</p>
114+
115+
<h2 class="reveal">What it actually does for your team</h2>
116+
117+
<p class="reveal">
118+
This isn't a dashboard that flags exceptions and waits for someone to deal with
119+
them. The agent acts:
120+
</p>
121+
122+
<div class="takeaway reveal">
123+
<div class="takeaway-label">Autonomous actions</div>
124+
<ul>
125+
<li><strong>Runs a 3-way match</strong> on every invoice line. Green, yellow, red per line, inline in the UI.</li>
126+
<li><strong>Detects and reasons about issues</strong> with per-issue evidence: the detection logic, the data excerpt that triggered it, and the materiality call.</li>
127+
<li><strong>Drafts vendor correction emails</strong> that are concrete, not bracketed templates. PO numbers, line references, EUR amounts filled in.</li>
128+
<li><strong>Drafts internal memos</strong> for issues the vendor shouldn't hear about: budget overruns, duplicate-invoice investigations, procurement gaps.</li>
129+
<li><strong>Builds an approval routing tree</strong> per invoice. Tier 1 (cost center owner), Tier 2 (+ AP manager), Tier 3 (+ Finance director), rendered as a live diagram you can click through.</li>
130+
<li><strong>Clears clean invoices</strong> straight to "ready to pay" and hands them off to the payment agent, no human in the middle for the boring 80%.</li>
131+
<li><strong>Surfaces early-payment discount opportunities</strong> with the savings math and days remaining on the discount window.</li>
132+
<li><strong>Tracks cost avoided</strong>: the sum of overcharges the agent caught across price variance, quantity variance, and duplicate exposure, separate from discount opportunities.</li>
133+
</ul>
134+
</div>
135+
136+
<h2 class="reveal">The audit question</h2>
137+
138+
<p class="reveal">
139+
Every CFO asks the same thing: <em>"Can I trace what it did and why?"</em>
140+
</p>
141+
142+
<p class="reveal">
143+
Yes, and AP adds a twist the auditor will appreciate. Every issue carries its
144+
<strong>detection logic</strong> (for example, "price variance 7.14% exceeds 2%
145+
tolerance") and the <strong>evidence</strong>: the PO line, the goods receipt,
146+
the invoice row. Ask why vendor X was contacted on April 3rd and you get back
147+
the exact match result, the exact issue, the exact rationale, and the exact
148+
email that went out. Drill-down, not summary. That's what survives an audit.
149+
</p>
150+
151+
<h2 class="reveal">Why local inference</h2>
152+
153+
<p class="reveal">
154+
An AP cycle fires more model calls than a collections cycle: one assessment,
155+
potentially one vendor email, potentially one internal memo, one routing tree
156+
per invoice. Multiply by thousands of invoices a month and cloud API costs stop
157+
being a footnote. Running the model on local hardware keeps the economics sane
158+
and, as a bonus, keeps supplier-specific pricing inside the perimeter, which
159+
matters more for AP than AR.
160+
</p>
161+
162+
<p class="reveal">
163+
This is a design choice, not a religion. The same architecture runs against a
164+
top-tier cloud model if you'd rather pay for latency and quality and trade
165+
some data-residency flexibility. The agent consumes structured output, it
166+
doesn't care where the structure comes from.
167+
</p>
168+
169+
<h2 class="reveal">Beyond AP</h2>
170+
171+
<p class="reveal">
172+
The loop behind this agent, <em>detect, classify responsibility, decide, act, log</em>,
173+
is not specific to invoice verification. It maps onto any finance process where
174+
the hard part isn't spotting the exception, it's figuring out who owns it:
175+
</p>
176+
177+
<p class="reveal">
178+
<strong>Expense auditing.</strong> Master-data quality. Vendor onboarding
179+
compliance. Intercompany invoice matching. T&E policy enforcement. Same cycle,
180+
same architecture, different rules.
181+
</p>
182+
183+
<p class="reveal">
184+
Next in the series: the payment agent itself, which takes the "ready to pay"
185+
set this agent produces and handles scheduling, release, and reconciliation.
186+
AP verification decides <em>what</em> to pay. The payment agent decides
187+
<em>when</em>.
188+
</p>
189+
190+
<h2 class="reveal">See it work</h2>
191+
192+
<p class="reveal">
193+
The agent is running live with a demo dataset. You can watch it 3-way match real
194+
invoices, see which issues it classifies as vendor vs internal, read the emails
195+
and memos it drafts, and click through the approval routing diagrams.
196+
</p>
197+
198+
<div class="cta-box reveal">
199+
<a href="https://invoice-verification.stubborncoder.cloud/" target="_blank" class="cta-link">
200+
<span class="cta-dot"></span>
201+
Open the live demo at invoice-verification.stubborncoder.cloud &#8594;
202+
</a>
203+
</div>
204+
205+
<div class="article-footer reveal">
206+
<div class="article-footer-label">Connect</div>
207+
<div class="resource-links">
208+
<a href="https://linkedin.com/in/daviddiaztrapero" target="_blank" class="original-link">LinkedIn &#8594;</a>
209+
</div>
210+
</div>
211+
212+
</article>
213+
214+
<section class="more-posts">
215+
<div class="more-posts-title">More writing</div>
216+
<a href="/blog/ar-collections-agent" class="more-row">
217+
<span class="more-date">2026.04</span>
218+
<span class="more-title">Your AR Team Just Got an Agent That Never Sleeps</span>
219+
<span class="more-src">CFO Living Examples, Part 1</span>
220+
</a>
221+
<a href="/blog/multimodal-embeddings" class="more-row">
222+
<span class="more-date">2026.04</span>
223+
<span class="more-title">Multimodal Embeddings: One Model, One Vector Space</span>
224+
<span class="more-src">LinkedIn</span>
225+
</a>
226+
<a href="/blog/semantic-caching-hana" class="more-row">
227+
<span class="more-date">2026.03</span>
228+
<span class="more-title">Semantic Caching for SAP HANA Cloud</span>
229+
<span class="more-src">LinkedIn</span>
230+
</a>
231+
</section>
232+
</main>
233+
234+
</BaseLayout>
235+
236+
<style>
237+
.post-hero { position: relative; padding: 10rem 0 4rem; overflow: hidden; }
238+
.post-hero-bg { position: absolute; inset: 0; background: url('https://images.unsplash.com/photo-1450101499163-c8848c66ca85?w=1920&q=80') center/cover no-repeat; filter: blur(8px) saturate(0.3) brightness(0.25); transform: scale(1.05); transition: filter var(--ease); }
239+
:global([data-theme="light"]) .post-hero-bg { filter: blur(8px) saturate(0.35) brightness(1.1); }
240+
.post-hero-overlay { position: absolute; inset: 0; background: var(--hero-overlay); mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,1) 70%); -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,1) 70%); }
241+
.post-hero-content { position: relative; z-index: 2; max-width: 720px; }
242+
.post-back { font-size: 0.75rem; color: var(--text-lo); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 2rem; transition: color 0.2s; text-decoration: none; }
243+
.post-back:hover { color: var(--ember); }
244+
.post-meta-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; font-size: 0.72rem; color: var(--text-lo); flex-wrap: wrap; }
245+
.series-badge { padding: 2px 8px; border-radius: 3px; border: 1px solid var(--gold-dim); color: var(--gold); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--gold-dim); }
246+
.post-hero h1 { font-family: 'Libre Baskerville', serif; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 400; line-height: 1.25; color: var(--text-hi); letter-spacing: -0.02em; margin-bottom: 1.5rem; }
247+
.post-hero h1 .em { color: var(--ember); font-style: italic; }
248+
.post-subtitle { font-size: 1rem; color: var(--text); max-width: 560px; line-height: 1.8; }
249+
.post-tags-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
250+
.post-tag { font-size: 0.65rem; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-lo); }
251+
.post-tag--ember { color: var(--ember); border-color: var(--ember-border); background: var(--ember-glow); }
252+
.post-tag--gold { color: var(--gold); border-color: rgba(212,166,69,0.2); background: var(--gold-dim); }
253+
254+
.series-intro { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; margin-bottom: 2.5rem; }
255+
.series-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); font-weight: 600; display: block; margin-bottom: 0.5rem; }
256+
.series-intro p { font-family: 'Libre Baskerville', serif; font-size: 0.88rem; color: var(--text); line-height: 1.7; margin: 0; }
257+
258+
.article { max-width: 720px; padding: 4rem 0 6rem; }
259+
.article h2 { font-family: 'Libre Baskerville', serif; font-size: 1.4rem; font-weight: 400; color: var(--text-hi); margin-top: 3rem; margin-bottom: 1rem; padding-top: 2rem; border-top: 1px solid var(--border); }
260+
.article h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
261+
.article p { font-family: 'Libre Baskerville', serif; font-size: 0.95rem; line-height: 1.9; color: var(--text); margin-bottom: 1.25rem; }
262+
.article strong { color: var(--text-hi); font-weight: 600; }
263+
.article em { color: var(--ember); font-style: italic; }
264+
.article blockquote { border-left: 3px solid var(--blockquote-border); background: var(--blockquote-bg); padding: 1.25rem 1.5rem; margin: 2rem 0; border-radius: 0 8px 8px 0; }
265+
.article blockquote p { font-style: italic; color: var(--text-hi); margin-bottom: 0; font-size: 0.92rem; }
266+
267+
.policy-grid { margin: 2rem 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
268+
.policy-row { display: grid; grid-template-columns: 100px 140px 1fr; gap: 1.5rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); align-items: center; }
269+
.policy-row:last-child { border-bottom: none; }
270+
.policy-days { font-size: 0.82rem; color: var(--text-hi); font-weight: 500; }
271+
.policy-action { font-size: 0.75rem; color: var(--ash); font-weight: 500; }
272+
.policy-action--amber { color: var(--gold); }
273+
.policy-action--warn { color: var(--ember); }
274+
.policy-action--critical { color: #c0503e; font-weight: 600; }
275+
.policy-desc { font-size: 0.78rem; color: var(--text); }
276+
277+
.takeaway { background: var(--bg-card); border: 1px solid var(--ember-border); border-radius: 10px; padding: 2rem; margin: 2.5rem 0; }
278+
.takeaway-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ember); font-weight: 600; margin-bottom: 1rem; }
279+
.takeaway ul { list-style: none; padding: 0; }
280+
.takeaway li { font-family: 'Libre Baskerville', serif; font-size: 0.88rem; color: var(--text); padding: 0.5rem 0; padding-left: 1.2rem; position: relative; line-height: 1.7; }
281+
.takeaway li::before { content: '›'; position: absolute; left: 0; color: var(--ember); font-weight: 700; }
282+
283+
.cta-box { margin: 2.5rem 0; }
284+
.cta-link { display: inline-flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-hi); padding: 1rem 1.5rem; border: 1px solid var(--ember-border); border-radius: 10px; transition: all 0.25s; text-decoration: none; background: var(--ember-glow); }
285+
.cta-link:hover { background: var(--ember); color: white; border-color: var(--ember); }
286+
.cta-link:hover .cta-dot { background: white; box-shadow: 0 0 6px white; }
287+
.cta-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); flex-shrink: 0; animation: cta-pulse 2s infinite; }
288+
@keyframes cta-pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--ember); } 50% { opacity: 0.4; box-shadow: none; } }
289+
290+
.article-footer { border-top: 1px solid var(--border); padding-top: 2.5rem; margin-top: 3rem; }
291+
.article-footer-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-lo); margin-bottom: 1rem; }
292+
.resource-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
293+
.original-link { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-hi); padding: 0.65rem 1.1rem; border: 1px solid var(--border); border-radius: 8px; transition: all 0.2s; text-decoration: none; }
294+
.original-link:hover { border-color: var(--ember-border); color: var(--ember); }
295+
296+
.more-posts { padding: 4rem 0; border-top: 1px solid var(--border); }
297+
.more-posts-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-lo); margin-bottom: 1.5rem; }
298+
.more-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 1.5rem; align-items: baseline; padding: 1.25rem 0; border-top: 1px solid var(--border); cursor: pointer; transition: all 0.2s; text-decoration: none; }
299+
.more-row:hover { padding-left: 0.75rem; }
300+
.more-row:hover .more-title { color: var(--ember); }
301+
.more-date { font-size: 0.72rem; color: var(--text-lo); font-variant-numeric: tabular-nums; }
302+
.more-title { font-size: 0.85rem; color: var(--text-hi); transition: color 0.2s; }
303+
.more-src { font-size: 0.65rem; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.06em; }
304+
305+
@media (max-width: 768px) { .policy-row { grid-template-columns: 1fr; gap: 0.3rem; } .more-row { grid-template-columns: 1fr; gap: 0.3rem; } .post-hero { padding: 8rem 0 3rem; } .resource-links { flex-direction: column; } }
306+
</style>

0 commit comments

Comments
 (0)