Former CFO keeping the books on AI agents and vibe-coded apps. Dated costs, fix logs, security checks.
Security vendors are starting to ship hosted MCP servers, so AI agents can work directly inside their consoles. The well-built ones sign AI clients in with OAuth 2.1, give an agent only the access its admin's role already has, and require synchronous in-chat approval before an action runs. The MCP specification's Authorization and Elicitation sections describe both building blocks.
That's the right foundation. Here's the control we'd add on top of any MSP-facing server: keep license, trial and billing tools off the AI's tool list entirely.
From the finance side, a license allocation is a purchase order. Ending a trial is a revenue event. Put either in reach of a model that reads tickets and emails (any of which can carry a prompt injection) and one well-placed sentence becomes 200 seats on next month's invoice. Approvals help, but they get rubber-stamped at 4:55 on a Friday. Removing the tool removes the problem.
The part that's still your problem
The AI was never the main leak. The leak is the gap between two systems that are supposed to agree and drift apart every month:
- Your security vendor's console: what each tenant has allocated and is actually using (firewall, MFA and endpoint seats).
- Your PSA (ConnectWise, Autotask, HaloPSA): what each tenant is on an agreement to pay for.
They drift for boring reasons. A tech onboards six laptops and nobody touches the agreement. A client offboards and the PSA keeps invoicing. Seats get allocated "for growth" and sit idle. A new product goes live with no SKU in the price book.
We wrote a small reconciler for exactly this gap. It sorts every discrepancy into one of seven buckets:
- Unbilled: more seats in use than you bill. Margin walking out the door.
- Orphan tenant: seats in the vendor console, no agreement in the PSA at all.
- Overbilled: billing for seats that are neither allocated nor in use. The scary one: a credit memo plus a client asking what else is wrong.
- Ghost billing: the PSA bills a tenant/SKU with no seats behind it (offboarded? mapping error?).
- Over-allocated: more seats in use than allocated. That's a vendor true-up, not a billing error.
- Idle seats: allocated but unused, costing you every month.
- Unmapped product: a vendor product with no SKU in your price book.
The trap we fell into ourselves: our first version flagged "billing for seats in use above the allocation" as overbilling. It isn't. If the client is using 61 seats and you bill 61, your billing is right. The gap belongs to the vendor side (#5), and it goes to a different person. Overbilling only means billing above both what's allocated and what's in use. A test now pins that case.
Here's an excerpt (6 of the 10 exceptions) from a run on the example's fictional sample data. The tenants, product names and prices are all made up:
UNBILLED acme-dental EDR-Endpoint 44 active, 40 billed [unbilled $36.00/mo] ORPHAN_TENANT evergreen-cpa EDR-Endpoint 12 active / 12 allocated, nothing billed (no PSA agreement for this tenant) [unpriced: no PSA line to price from] OVERBILLED blue-harbor-law EDR-Endpoint 25 billed, 22 allocated, 22 active (credit/refund exposure) [credit exposure $27.00/mo] GHOST_BILLING foxglove-studio SEC-EDR billing 15 × SEC-EDR with no matching vendor seats (offboarded? mapping error?) OVER_ALLOCATED delta-logistics MFA-Auth 61 active, 60 allocated (vendor overage / true-up exposure) IDLE_SEATS cedar-clinic EDR-Endpoint 30 allocated, 18 active [idle cost $66.00/mo] unbilled revenue $36.00/mo · overbilling exposure $27.00/mo · idle-seat cost $70.50/mo · 10 exception(s) Read it like a controller: the lines that can't be priced yet (the orphan tenant, the ghost billing) are usually the biggest numbers. A report that only totals what it can price understates the problem.
The pattern we'd sign off on
- Read-only exports in. A dedicated job identity with read scopes only, and no license or trial tools. Pull tenants and seat counts nightly, under the vendor's rate limit. At 100 requests a minute (a reasonable budget to assume for an interactive agent), a 50-tenant MSP needs roughly 200 calls, a couple of minutes, if seat counts come back per product. Per-device detail costs more, but it's still an overnight job.
- Deterministic math in the middle. A plain script diffs vendor seats against PSA lines in integer cents. Same inputs, same answer, every time. No model decides a number.
- Humans make the changes. Billing fixes agreements. Ops trues up or right-sizes in the vendor console, where license changes belong.
- The LLM writes the summary, not the ledger. If you want AI in the loop, give it the finished exception report and let it draft the client email. It never does the math and never touches a license.
One question worth asking your vendor: can a read-only API or MCP client see license allocation per tenant at all? If not, that column comes from a license export instead. The script takes CSVs, so it doesn't care where the numbers come from.
The reconciler is open source: a single zero-dependency Node script (no network, no LLM, money in integer cents) with tests and the fictional sample data above. See examples/msp-seat-reconcile on GitHub. It's the companion to Shelf Watch #3: What good looks like on a hosted enterprise MCP server, our blueprint for multi-tenant MCP servers.
How are you reconciling vendor seats against your PSA today: a monthly spreadsheet, a PSA integration, or not at all?
Not sponsored. The sample data is fictional.