Why a second app
Every instance we manage already ran infinary_agent, and that app is deliberately inert: no doctypes, no writes, nothing listening. It observes, and its (The small Infinary agent that runs next to ERPNext on each server. It runs updates, app installs and rollbacks, and only ever connects outward.) reports out.
Hosted agents needed the opposite. In late August we started running AI agents centrally, on our side, that reach into a customer’s ERPNext to read records and draft documents. Something on the customer’s side had to decide whether they could, record what they did, and be able to stop them. So at 00:23 on Monday, August 24, we started a second Frappe app, infinary_controls. Its README puts the reason in one line: “a console that cannot refuse anything is decoration.”
Pairing: the trust starts on their side
We never provision our own access to a customer’s ERP. The customer generates a single-use enrollment code in our portal and pastes it into their own ERP. infinary_controls then:
- creates a dedicated user for our agents,
- gives it one narrow role, read-only until someone deliberately widens it,
- creates that user’s API credentials, and a signing key pair for the site,
- sends the credentials to our hub once, outbound, over TLS,
- stores our hub’s public key, so it can check requests that claim to come from us.
Nothing on the customer’s side is opened to inbound traffic to make this work. The hub side, which landed on August 27, keeps it tight: the code is single-use and expires after 15 minutes, we store only a hash of it, and the hub refuses to spend a code over anything but HTTPS.
A secret isn’t an identity
The code that makes that decision is pure Python with no Frappe import, so it can be tested without a running site: 21 tests at the first commit. On August 27 the hosted runner learned to sign every request it sends to a customer’s ERP, and to refuse the connection rather than send an unsigned request if it can’t load the key. It was tested with 17 round trips against a verifier that applies the customer side’s exact rules.
The kill switch
“Revoke Infinary access” disables our agent user in the customer’s own ERP, immediately, without asking our hub for permission and without needing it to be reachable. Telling us afterwards is bookkeeping. The README again:
A kill switch that depends on the party being killed is not a kill switch.
The agent user’s credentials are also re-issued weekly, so a credential that leaked without anyone noticing still stops working.
The run mirror
Every agent run is mirrored into a record in the customer’s own ERP that people can’t edit, because “evidence somebody can edit is worth less, and an audit trail held only by the party being audited is worth less again”. The mirror carries the run’s spend with a flag saying whether it’s exact, so a lower bound is never displayed as a total (the reason is its own note).
Customers can also let specific document events start an agent, for example saving a Sales Invoice. A site with no rules pays one lookup per save, and the event is sent after the database commit, so it never slows down or blocks the customer’s own transaction.
What broke
- Drift we caused ourselves. The first README carried a warning: installing any app beyond the baseline made our control plane’s drift gate ask the owner to acknowledge “custom” software before every upgrade, software we had installed. The agent’s baseline was fixed four minutes after the first commit.
- Installed by hand, removed by the next update. On our own site we first installed infinary_controls by hand. An app that lives only in a container’s writable layer disappears at the next image swap, while the site’s database still expects it, and then every request fails with a 500. On August 27 we baked it into the (The server image every Infinary site runs: Frappe, ERPNext and our own apps, pinned to exact versions and tested together.) itself.
By August 30 the app had gone from v0.1.0 to v0.4.1, mostly because Aria’s ERP side moved into it, which is the Aria note. Everything here ran on one ERP in August: our own site.