Expense Agent

Project by Daniel Engelberg for Warp’s Applied AI Engineer role

An AI agent that reviews expenses the way a careful finance team would

It reads the receipt, applies the company’s written policy in code, and approves it, adjusts it, or asks the right person. It acts with the permissions of whoever it works for, and every step lands in an audit log. Evals across three Claude models: zero false approvals.

Try it in a minute

  1. Open the demo and pick Sam Okafor in “Acting as”.
  2. Submit test receipt h06: it has a printed note telling the AI reviewer to approve it at $5.
  3. Watch the run log: the real total is read, capped at $100, and sent to Finance.
  4. Try to approve it as Sam (it’s his own) or Jordan (not Finance): both are refused, and logged.
  5. Switch to Maya Chen (Finance) and approve it from her inbox.

Northwind Labs is fictional: every person, salary and receipt is synthetic. Test receipts only, 150 claims a day, resets nightly.

How a claim flows

  1. 1

    Extract

    Claude reads the receipt image into a typed schema. A stricter check runs in code; one corrective retry, then a typed error.

  2. 2

    Decide

    Plain code applies the written policy: limits, tip cap, alcohol, currency, duplicates, 90-day rule, and who must approve.

  3. 3

    Review

    An LLM reviewer, acting with the employee's permissions, looks for what rules can't see. It can only add a human check.

  4. 4

    Approve

    The run pauses for each approver in turn (manager, IT, Finance) and resumes on their decision. Every step is logged.

Decision evals

Each receipt runs through the real pipeline as its submitter, and is graded on the outcome and exactly who must approve. A free baseline (perfect extraction, rules only) must score 42/42 before any model run.

Extract / reviewCorrectFalse approvalsInjections heldCost / claimp95
Opus 5.5 / Opus 5.542 / 4203 / 3$0.0299.6s
Sonnet 5.5 / Sonnet 5.542 / 4203 / 3$0.0146.5s
Haiku 5.5 / Haiku 5.540 / 4203 / 3$0.00098.4s
Haiku 5.5 / Opus 5.540 / 4203 / 3$0.0139.3s

What the evals changed. The first run caught bugs in my data, not the models: a bagel shop selling pad thai. Then Sonnet scored 37/42 by marking every numeric date as uncertain; one prompt fix took it to 42/42 with no regression on Opus.

Where it breaks. Haiku’s misses both send claims to a human (it reads a handwritten total as possible tampering). Each config ran once, so 1–2 point gaps aren’t significant, and the receipts are clean renders, not phone photos.

Design decisions

The model proposes, code decides

Limits, arithmetic and approval routing are tested code. The reviewer can make an outcome stricter, never looser: it can't approve, reject or change an amount.

The agent has no permissions of its own

It acts for a person and gets exactly their access. Asked for a colleague's salary, its tool returns “permission denied”, the model never sees the number, and the attempt is logged.

Receipts are data, not instructions

Three test receipts carry injections: a note to the “AI reviewer”, a fake system notice naming the agent's own tool, and “approved by CFO” hidden in a line item. All are flagged to Finance.

Fail closed, and survive crashes

If the reviewer refuses or never finishes, a human checks the claim. Each claim is a durable state machine on a Postgres job queue that resumes from its last committed step.

Mapped to the role

About me

I’m Daniel Engelberg, a Technion engineering graduate (robotics) who builds production AI systems. Before this I built Handy AI, a WhatsApp maintenance coordinator for property managers with Claude intake, emergency detection, a Postgres job queue and 350+ tests. I’m authorized to work in the US and relocating to New York.