Set per-customer send quotas with agent policies Nylas introduced per-customer send quotas for multi-tenant email agents using agent policies. The system allows setting different limits for free-tier and enterprise tenants by attaching policies to workspaces, which automatically apply to all agent accounts in that workspace. This approach moves quota enforcement to the platform, eliminating the need for per-account configuration and reducing drift. Most multi-tenant email-agent setups give every customer the same caps. Your free-tier user who signed up an hour ago and your enterprise account doing thousands of sends a day hit the exact same daily send limit, the exact same storage ceiling, the exact same retention window. That's fine right up until a free trial account starts hammering your infrastructure, or an enterprise customer files a ticket because their agent stopped sending at noon UTC and nobody can explain why. Free-tier and enterprise tenants shouldn't share the same caps. They have different risk profiles, different contractual obligations, and different billing. The trick is to make the quota a property of the tier, not a property of each individual account — so when you provision a new tenant you don't compute limits, you just drop them into the right bucket and the limits come along for free. With Nylas Agent Accounts that bucket is a workspace , and the caps live on a policy you attach to it. Set up one policy per tier, attach each to its tier's workspace, and every Agent Account in that workspace inherits the policy's send, storage, and retention limits automatically. No per-account configuration, no drift. I work on the Nylas CLI, so the terminal commands below are the exact ones I reach for when I'm wiring this up. As always, I'll show both the raw HTTP call and the CLI equivalent for every step, because half of you live in scripts and the other half live in your app code. An Agent Account is just a Nylas grant with a grant id — a managed mailbox that can send and receive on a domain you've registered. Everything grant-scoped works against it: Messages, Drafts, Threads, Folders, the lot. There's nothing new to learn on the data plane. A policy is a reusable bundle of limits and spam settings. One policy can govern many accounts. The limits we care about for tiering are: limit count daily email sent — how many messages an account can send per day. limit storage total — total stored bytes per account. limit inbox retention period — days a message stays in the inbox before deletion. limit spam retention period — days a message stays in spam before deletion must be shorter than the inbox window .A workspace carries exactly one policy id . Every grant in the workspace inherits that policy. So the architecture is a short chain: policy → workspace → grants. Change the policy, and every account in the workspace moves with it. Move an account to a different workspace, and it picks up the new tier's caps the moment the move lands. That's the whole idea. The rest of this post is plumbing. You could enforce quotas yourself — count sends in your own database, reject the request when a tenant goes over, run a nightly job to prune old mail. People do this. It works until it doesn't: 429 too many requests when an account is over. If you also count, you now have two sources of truth that disagree at the edges. limit storage total caps it server-side.Pushing the caps down to a policy means the enforcement happens where the resource lives. Your app code stays about what the agent does , not how much it's allowed to do . The part I like as an SRE is that the limit is declarative — it's a number on a policy, version it in your IaC, and the platform enforces it. The honest tradeoff: policies are application-scoped admin resources, so you're managing a small set of them out-of-band from your per-tenant flow. That's the point — you want a handful of tier policies, not one policy per customer. If you find yourself creating a policy per tenant, you've taken a wrong turn; the per-tenant unit is the account, and the account's caps come from its workspace. You'll need a Nylas API key and a registered domain to provision Agent Accounts against a custom domain, or a .nylas.email trial subdomain . New domains warm over roughly four weeks, so don't expect day-one volume. The examples use https://api.us.nylas.com as the base host and Authorization: Bearer