Skip to Content
MailroomMailroom home

Governance, policies, and approvals

The policy engine — the core differentiator for agent sending.

Early access

A policy is an ordered list of rules evaluated against every agent-originated send (and optionally any send from a key with policy_id). First match wins, then default_action.

Inputs

Agent, recipient addresses/domains, recipient is new vs known, recipient count, thread context (reply to inbound from that recipient?), time of day, attachments, content regexes (dollar amounts, “wire”, account numbers), links to non-allowlisted domains, recent send volume, org spend.

Actions

allow · require_approval (approvers, expires_in, on_expire: reject|allow) · deny · allow_with_delay (cancellable window) · pause_agent

Default policy for a new agent

  1. Replies within an existing thread to an address that emailed this inbox → allow
  2. New recipient at a domain on the org allowlist → allow
  3. Any other new recipient → require_approval
  4. More than 50 sends/day or 10/min per agent → deny + pause_agent (configurable)
  5. Bounce rate > 5% or any complaint in the last 24h for this agent → pause_agent and notify

Rules are a JSON DSL. Every evaluation is stored for audit.

Dry-run

await mailroom.policies.simulate(policyId, {
  agent_id: 'agt_support',
  to: ['new.person@unknown.example'],
  subject: 'Intro',
  text: 'Hello',
});
// → { decision: 'require_approval', matched_rule: 'r_new_recipient', ... }

Approvals

Pending mail has status pending_approval. Decide via:

  • Dashboard queue (diff view, edit-then-approve)
  • POST /approvals/{id}/approve or /reject
  • Signed one-time email link (approve requires login; no GET side effects)
  • approval.* webhooks so you can wire Slack yourself

Agent-scoped keys cannot approve.

Kill switch

POST /agents/{id}/pause → 423 agent_paused on new sends; queued/scheduled cancelled.

On this page