DEV Community

Cover image for I lost close to $500 last week paying twice for the same invoice
Ibrahim Pima
Ibrahim Pima

Posted on

I lost close to $500 last week paying twice for the same invoice

yes thats real and a hypothetical look at the situation business owners go through every month when paying for work done

Vendor reminders can look exactly like new invoices. One rushed approval, one missed invoice number, and you could pay twice for the same service without realizing it.

That is where Stamp comes in.

Stamp is an AI invoice reconciliation agent built with TrueForge. It connects to Gmail, reads vendor invoice threads, and checks them against your payment records before suggesting what should happen next.

Your inbox should not decide what gets paid

Most invoice tools focus on extracting information. Stamp goes one step further by checking whether the invoice has already been paid.

It looks at the vendor, invoice number, amount, currency, and email thread. If a reminder matches an invoice already recorded in the ledger, Stamp flags it as a duplicate. If it is a genuinely new invoice, Stamp marks it for confirmation instead.

That means you can quickly see which invoices need action and which ones should not be paid again.

Stamp reads first and writes only with permission

Stamp does not quietly send emails on your behalf.

It can search Gmail and analyze invoice threads without creating a draft. After the reconciliation is complete, it displays the results in a table and proposes the next step. It might suggest a dispute message for a duplicate invoice or a payment confirmation request for a new one.

Before creating a Gmail draft, TrueForge pauses and asks for approval. You can allow the draft, review it in Gmail, or deny the action. If you deny it, nothing is created.

This human approval step is what makes Stamp useful for money-related workflows. The agent handles the repetitive work, but the final decision stays with you.

The numbers are checked with real Python code

Stamp does not ask an AI model to perform financial reconciliation in plain text. It extracts the invoice details and sends structured data to Python code running in an isolated Daytona sandbox.

The code compares the invoices with the ledger and returns clear statuses such as:

Status Meaning
duplicate_paid The invoice appears to have already been paid.
new_unpaid The invoice is new and may need confirmation.
amount_mismatch The invoice number matches, but the amount is different.

This makes the process easier to understand, test, and audit. Stamp is not just producing a confident answer. It is showing the result of an actual reconciliation process.

How TrueForge powers Stamp

TrueForge provides the agent runtime that connects all the pieces together. In Stamp, it is used to manage the model, Gmail MCP connection, Stamp skill, Daytona sandbox, subagents, Generative UI, and human approval workflow.

The setup is designed to be approachable. You can start TrueForge locally with the Quickstart guide, connect an OpenAI model, add the Daytona sandbox, connect the Gmail MCP server, import the Stamp skill, and load the agent specification.

If you want a managed version for team use, the TrueFoundry Agent Harness provides the hosted version of TrueForge with additional governance, observability, and enterprise hosting options.

How Qodo helps us fix bugs faster

Building an agent that handles invoices requires more than making the happy path work. Small bugs in extraction, duplicate detection, approval logic, or documentation can create confusing or risky behavior.

That is why an AI code review tool such as Qodo is useful during development. Qodo reviews pull requests, highlights important issues directly in the changed files, explains why they matter, and helps developers focus on the fixes that should happen first.

A practical workflow is simple:

  1. Open a pull request with the latest changes.
  2. Ask Qodo to review it by commenting /agentic_review, or configure automatic reviews for new and updated pull requests.
  3. Read the findings in the pull request summary and inline comments.
  4. Fix the valid issues, push a new commit, and request a follow-up review.
  5. Merge only after the important findings have been addressed or intentionally dismissed.

This helps us catch bugs faster while the code is still fresh. It also gives users more confidence that the agent has been reviewed beyond a single manual test.

Explore the project

Stamp is open for anyone who wants to see how a safer invoice agent can be built. You can explore the complete Stamp repository, review the implementation changes in Pull Request #1, and learn how TrueForge connects models, tools, skills, sandboxes, and approval gates.

If you manage invoices through Gmail, waiting until after the next duplicate payment is a costly way to discover this problem. Try the workflow, inspect the code, and see how TrueForge can help you build agents that do more than automate tasks. They can also know when to stop and ask for permission.

Useful links:

Top comments (0)