Agents need credentials of their own
Vantra lets companies deploy agents that do real work across their tools: triaging support tickets, updating CRM records, reconciling invoices. Each agent calls a mix of internal APIs, third-party services and model providers on its owner's behalf.
At first every workspace had one API key, shared by all of its agents. One busy agent could exhaust the quota for the whole workspace, and nobody could tell from the logs which agent had made which call.
The weekend that set the requirements
An agent built to retry failed ticket updates hit a malformed record and retried it, again and again, for two days. It made 2.3 million calls before anyone noticed. The model bill came to $41,000, and Vantra paid it rather than pass it to the customer.
The lesson was that a limit inside the agent is a suggestion. An agent that is wrong about the world is also wrong about how much it has spent. The cap had to live outside the agent, at the gateway, attached to a credential the agent cannot change.
A key and a cap for every agent
Now every agent gets its own Halyard key the moment it is deployed, created through the API and scoped to the tools its owner granted. Each key carries a request limit and a spend cap. When an agent reaches either one, Halyard returns a 429 with a machine-readable reason, the Vantra runtime pauses the agent and the owner gets a notification with the last hundred calls attached.
Keys expire automatically when an agent is deleted, which matters at Vantra's scale: 6,000 keys are created on a typical day, and 180,000 are live at any time. Verification adds 3.1 ms at the 99th percentile, which is lost in the noise next to a model call.
Agents don't get tired and they don't get embarrassed. The cap has to sit outside the agent, at the gateway, or it isn't really a cap.
Metered pricing in three weeks
Because every call is already counted per key, Vantra could roll agent usage up to the workspace and bill on it. The team launched a usage-based plan three weeks after the migration, using Halyard's usage export as the source for invoices.
No looping agent has reached a customer's bill since. The caps have tripped a few hundred times, and each one is a paused agent and a notification instead of an incident.