Stop your agent emailing the wrong recipients Nylas introduces an outbound Rule feature for its Agent Accounts that acts as a server-side data-loss prevention layer, blocking emails to denied recipients even when application-level checks fail. The rule evaluates recipients at send time and rejects the message with a 403 status if a match is found, providing a defense-in-depth approach to prevent accidental email leaks. Here's the failure mode that keeps me up at night about autonomous email agents: not the agent that goes silent, but the one that sends. A model fat-fingers a recipient. It picks up qa@internal-staging.example from a config file it shouldn't have read. It replies-all to a forwarded thread that quietly carried a BCC to a competitor. Your send wrapper looks clean, your tests pass, and one afternoon the agent emails a customer's pricing to the wrong domain. By the time you see it in the logs, the message is on someone else's mail server and you can't recall it. Most teams handle this with an allowlist in application code — validate the recipients, reject the bad ones, then call send. That's the right first move and you should absolutely do it. But it has a gap: it only protects the send path you wrote. The moment a second code path calls the API directly, or a retry skips the wrapper, or a teammate ships a new endpoint that forgets the check, the guardrail isn't there. The address lives in your process, and processes have bugs. There's a lower layer that doesn't. An Agent Account on Nylas can evaluate an outbound Rule at send time — after your code hands the message off, but before Nylas hands it to the email provider. If the rule matches a denied recipient, the send is rejected with a 403 and no message leaves the building. This post is about that send-side block, used as data-loss prevention : a server-side backstop that catches the wrong recipient even when your application code doesn't. The cookbook recipe on restricting agent recipients https://developer.nylas.com/docs/cookbook/agents/restrict-agent-recipients/ makes the case for the application-layer allowlist, and it's a good case. Validate recipients in a guarded send wrapper, fail closed on unknown domains, run a dry-run gate. Do that. This post is not an argument against it. It's an argument for a second layer, because the two fail in different places: recipient. rule fields match against to still trips the block. That's exactly the DLP case you want: the recipient you didn't think to look at. in list — Nylas blocks the send anyway rather than letting it through. More on that contract below, because it changes the status code you get back.The honest framing: this is a guardrail Nylas enforces, and it complements your app-side checks — it doesn't replace them. Defense in depth. Your wrapper is the fail-closed allowlist you own; the outbound Rule is the server-side denylist that holds when the wrapper doesn't. Worth saying up front, because it's the reassuring part: an Agent Account is just a grant with a grant id . Everything you already know about Messages, Drafts, Threads, and POST /v3/grants/{grant id}/messages/send is unchanged. The agent still composes and sends exactly the same way. Rules and Lists sit one level up, on the control plane . They're application-scoped admin resources — no grant ID in the path, your API key identifies the application — and they apply to every Agent Account in a workspace. So there's nothing new to learn on the data plane. You're adding a checkpoint the send passes through, not rewriting how the send works. The pieces form a short chain. A List holds the denied recipient values. A Rule with trigger: outbound references that list through the in list operator and says "if a recipient is on this list, block ." A workspace carries the rule in its rule ids array, and every Agent Account in the workspace inherits it. Miss the last step and nothing fires — I'll come back to that, because it's the most common mistake. You need an Agent Account — a grant created via POST /v3/connect/custom against a registered domain, covered in Agent Accounts https://developer.nylas.com/docs/v3/agent-accounts/ — plus an API key for the same application. The host in every example is https://api.us.nylas.com , and every call carries Authorization: Bearer