Playbook 04Playbook 04 · Multi-Tenant Agency OpsExpert

Agency Multi-Client Deliverability Isolation: RLS, Vault & Unit Economics

Multi-tenant architecture blueprint for outbound agencies: two-level org/workspace tenancy, PostgreSQL FORCE RLS, per-org Vault AES-256-GCM DEKs, SHA-256 client approvals, and Scale plan economics.

Published Updated 9 min read~1,795 words
Isolated Workspaces
15
Included on Scale ($349/mo)
Credential Encryption
AES-256-GCM
Per-org Vault DEK + context AAD
10-Client Infra Cost
~$150/mo
Per client · saves $4,500/yr

Executive TL;DR

  • Two-level tenancy separates billing & Vault keys (app.organizations) from strict operational client boundaries (app.workspaces).
  • Every app.* table — including monthly telemetry partitions — enforces PostgreSQL ENABLE + FORCE ROW LEVEL SECURITY via InitPlan-cached (SELECT private.user_can_access_workspace(workspace_id)).
  • OAuth and SMTP credentials encrypt under per-organization 256-bit supabase_vault DEKs with context-bound AES-256-GCM AAD (v1|org|ws|type|id|purpose|kv|rev) and zeroized buffers.
  • One noisy client tripping >2.5% hard bounces or >0.10% complaints auto-pauses locally while sibling client domains, tracking SSL CNAMEs, and opt-outs stay untouched.
  • Scale ($349/mo or $3,490/yr) includes 15 isolated workspaces, 15 seats, 75 BYO slots, 350,000 sends/mo, and 60 custom tracking hostnames.
Jump to section (7)
Section 01

1. Two-Level Tenancy: Organizations vs. Client Workspaces

Pool agency billing and credit allowances at the organization root while hard-isolating every client's domains, leads, opt-outs, and sequences inside dedicated workspaces.

Managing ten B2B clients inside a single flat sequencer workspace creates unavoidable risk: folder filters rely on human discipline, shared suppression tables accidentally cross-block overlapping industries, and a single CSV import error exposes Client A's prospect list to Client B's campaign.

WarmerStack separates commercial administration (app.organizations) from operational execution (app.workspaces). The agency pays one consolidated Stripe invoice and holds one cryptographic key root, while every client operates inside a dedicated database-isolated workspace with zero shared sending assets.

Resource ownership boundaries between app.organizations and app.workspaces
ResourceScopeClient Viewer AccessIsolation Mechanism
Stripe Subscription & InvoicesOrg Root
app.organizationsBlocked by RLSOwner / Admin roles only
256-bit Vault DEKCrypto Root
app.organizationsNever exposedsupabase_vault + zeroized buffers
Monthly Quota PoolsPooled
app.organizationsHiddenSends, verifications, finder, seed tests
Domains, Mailboxes & Tracking SSLIsolated
app.workspacesStatus read-only (no secrets)Dedicated secondary domains + CNAMEs
Leads, Sequences & UniboxIsolated
app.workspacesRead-only reportingFORCE RLS + workspace_id FK
Permanent Opt-OutsImmutable
app.workspacesCount / status onlyapp.workspace_opt_outs (DELETE revoked)
Section 02

2. PostgreSQL FORCE RLS, Vault DEKs & Context-Bound AAD

Defense-in-depth at the database and cryptographic layers ensures an application-level WHERE bug can never leak cross-client rows or transplant ciphertexts.

Every table in app.* — including monthly partitioned telemetry child tables — enforces both ENABLE ROW LEVEL SECURITY and FORCE ROW LEVEL SECURITY (preventing even table-owner roles inside the request path from bypassing policies). On Supavisor transaction-mode pools, per-request claims bind via SET LOCAL inside the active transaction, and all in-memory and Redis caches key strictly by (organizationId, workspaceId).

Policy predicates call SECURITY DEFINER helpers in the unexposed private schema wrapped inside scalar subqueries — (SELECT private.user_can_access_workspace(workspace_id)) — triggering PostgreSQL's InitPlan caching so the authorization lookup runs once per statement rather than per row.

Connected Google Workspace OAuth tokens, Microsoft 365 OAuth tokens, and SMTPS/IMAPS passwords are encrypted with a unique per-organization 256-bit CSPRNG Data Encryption Key stored in supabase_vault. Every AES-256-GCM ciphertext authenticates canonical Additional Authenticated Data (v1|org|ws|type|id|purpose|kv|rev) so copying an encrypted blob across workspaces or rolling back an older key revision fails authentication instantaneously. Raw DEK buffers are wiped via dek.fill(0) inside finally blocks.

PostgreSQL FORCE RLS + InitPlan-Cached Workspace Policy Patternsql
-- Applied to every app.* workspace table and monthly telemetry partition
ALTER TABLE app.campaign_sequences ENABLE ROW LEVEL SECURITY;
ALTER TABLE app.campaign_sequences FORCE ROW LEVEL SECURITY;

-- Read access scoped to workspace members & read-only Client Viewer seats
CREATE POLICY ws_select ON app.campaign_sequences
  FOR SELECT
  USING ((SELECT private.user_can_access_workspace(workspace_id, 'client_viewer')));

-- Mutations restricted strictly to active agency members/admins
CREATE POLICY ws_modify ON app.campaign_sequences
  FOR ALL
  USING ((SELECT private.user_can_access_workspace(workspace_id, 'member')))
  WITH CHECK ((SELECT private.user_can_access_workspace(workspace_id, 'member')));

-- Credential Vault tables restrict SELECT & ALL strictly to org admin/owner
-- AES-256-GCM AAD format: v1|org|ws|type|id|purpose|kv|rev
Section 03

3. Blast-Radius Containment Across Client Fleets

When one client supplies an unverified list or provocative offer, circuit breakers halt only that workspace — keeping sibling clients delivering cleanly.

Real agencies inherit messy client inputs: an aged conference spreadsheet, an aggressive promotional rewrite, or an overlapping niche campaign. Without physical and logical blast-radius boundaries, one noisy retainer jeopardizes every other client paying you monthly.

Trigger a simulated bounce spike or spam-complaint event in the interactive diagram below to inspect how WarmerStack isolates faults across three concurrent client workspaces.

Interactive Diagram · Blast-Radius Containment

Multi-Client Workspace Isolation Simulator

Agency Organization Root

app.organizations · Single Stripe Billing Root

Per-org Vault DEK (AES-256-GCM)FORCE RLS + InitPlan

Northstar SaaS

ws_northstar

Active
Pool tier
High-Trust (Score 94)
Daily cold cap
180/day (6 mb)
Tracking CNAME
track.northstar-outreach.com
Opt-out ledger
412 isolated rows
Client Viewer
Online · 0 secrets

FinEdge UK

ws_finedge

Active
Pool tier
High-Trust (Score 94)
Daily cold cap
270/day (9 mb)
Tracking CNAME
track.finedge-hq.co.uk
Opt-out ledger
289 isolated rows
Client Viewer
Online · 0 secrets

Apex Cloud

ws_apex

Active
Pool tier
High-Trust (Score 94)
Daily cold cap
180/day (6 mb)
Tracking CNAME
track.tryapexcloud.com
Opt-out ledger
194 isolated rows
Client Viewer
Online · 0 secrets

Active Clients

3 / 3

Sibling Throughput

630/day unaffected

Cross-Tenant Leaks

0 rows

Viewer Secret Exposure

0 credentials

Triggering a circuit breaker pauses only the offending workspace. Sibling domains, SSL CNAMEs, opt-out tables, and read-only client portals keep operating independently.Explore Agency Architecture
Failure-domain containment: flat agency folder tools vs. WarmerStack isolated workspaces
Failure EventFlat Folder ToolWarmerStack Isolated Workspace
3.4% hard-bounce spikeContained
Degrades shared tracking domain & pool standingOnly offending mailbox/workspace trips >2.5% Quarantine breaker
0.15% spam complaint eventEvicted
Shared pool co-engagement spreads drag to siblingsEvicts offending mailbox (>0.10% or >=2 in 7d) immediately
Tracking link blocklistedIndependent
Every client shares one redirect CNAMEPer-client track.<domain> & optout.<domain> TLS 1.3 CNAMEs
Prospect unsubscribesScoped
Global list blocks unrelated clients from pitchingImmutable per-workspace app.workspace_opt_outs tombstone
Client credential exposureZero-Secret
Shared team seat can view SMTP passwords or billingClient Viewer blocked from Vault secrets, API keys & Stripe by RLS
Section 04

4. Zero-Secret Client Viewer & SHA-256 Approval Lock

Eliminate screenshot reporting decks and post-hoc 'we didn't approve that email' disputes with read-only portals and cryptographic sign-off digests.

Inviting a client contact as a Client Viewer gives them live visibility into their own workspace's campaign metrics, lead status, reply threads, and StackHeat™ inbox placement scores — while PostgreSQL RLS blocks all access to connected OAuth tokens, SMTP passwords, scoped REST API keys, sibling workspaces, and wholesale agency Stripe billing.

Before any sequence starts sending, WarmerStack serializes the exact campaign steps, templates, sender plan, and audience cohort into a canonical sorted-key JSON stream and computes its SHA-256 digest (streamingCanonicalApprovalHash). Object keys are sorted lexicographically and undefined properties stripped so JSONB round-trips never cause hash drift. Changing a single word in a subject line or appending one extra lead invalidates the sealed hash and blocks dispatch until re-approved.

  • Client Viewer permissions: SELECT on own workspace analytics, lead progress, Unibox replies, placement reports, and approval history.
  • Client Viewer blocks (enforced in Postgres RLS, not just UI hiding): mailbox credentials, Vault DEKs, API keys, agency invoices, and all sibling workspace rows.
  • Canonical SHA-256 approval seal: immutable audit record linking approver user ID, timestamp, exact audience snapshot, and every step body.
  • Instant company-wide reply stop (<10s): when any prospect replies or sends a stop phrase, downstream touches halt for matching colleagues inside that client workspace.
Section 05

5. Scale Plan Unit Economics & 10-Client Agency Benchmark

Exact quotas and add-on economics sourced directly from WarmerStack's live billing catalog.

On a single Scale (Agency) subscription ($349/mo monthly or $3,490/yr annual), an agency running 10 active client workspaces with 1 Managed Warmed Mailbox 10-Pack ($115/mo) per client pays $1,499/mo total — approximately $150/client/mo for domains/SSL isolation, 100 warmed mailboxes, tiered warmup, seed placement, verification credits, and multi-tenant sequencing.

Compared against an equivalent fragmented 5-tool agency stack ($1,874/mo across outreach platform, raw mailbox slots, SSL masking across 40 domains, per-slot warmup, placement testing, and verification credits), that saves $375/mo ($4,500/yr) — preserving 94.0% gross retainer margin on $2,500/mo client retainers. Model custom retainers interactively on /agencies.

Scale (Agency) plan included allowances and modular add-on SKUs (live pricing catalog)
Component / SKUIncluded AllocationPrice (USD)Notes
Scale (Agency) BaseCore Plan
15 workspaces · 15 seats$349/mo ($3,490/yr)Annual saves 2 months vs monthly
BYO Slots & SendsIncluded
75 BYO slots · 350,000 sends/moIncluded100,000 active leads cap
Verification & FinderIncluded
25,000 verifications · 750 finder/moIncludedTop-ups: 25k verify $135 · 2.5k finder $79
Placement & Tracking SSLIncluded
50 seed tests/mo · 60 custom hostnamesIncludedExtra 50 seed tests: $49
Managed Warmed 10-PackPer Client
10 warmed slots / pack$115/moAuto DNS, SSL CNAMEs & StackHeat™
Choice 1A .com/.net/.orgBundle Promo
Up to 2 domains / Managed pack$33/yrvs $52/yr standalone (GM-guarded)
Extra BYO 10-PackAdd-On
10 extra BYO slots$35/moConnect additional Google / M365 seats
Dedicated IP ClusterPrivate IP
10 private mailboxes + IP$1,497/quarter$499/mo equiv., billed quarterly
Section 06

6. Standard Operating Procedure: Client Onboarding & Offboarding

Repeatable checklist to launch new retainers safely inside 14 days and offboard churning accounts with zero residual leakage.

Standardizing workspace lifecycle removes ad-hoc errors across account managers and creates clean compliance audit trails whenever a client joins or departs.

  • Onboard Step 1 — Provision dedicated workspace: create a fresh app.workspaces record, register 3–4 lookalike domains (Choice 1A at $33/yr where eligible), and assign 1 Managed 10-Pack (2–3 mailboxes/domain).
  • Onboard Step 2 — Validate DNS & SSL: verify SPF (<=8 lookups), 2048-bit RSA DKIM, DMARC, MX, and TLS 1.3 on track.<domain> and optout.<domain>.
  • Onboard Step 3 — Lock 14-day warmup: let mailboxes run inside Quarantine peer warmup while building and verifying the launch prospect list (0 cold sends Days 1–13).
  • Onboard Step 4 — Pre-flight & SHA-256 sign-off: lint copy in /tools/spam-checker, run a baseline 6-ESP seed placement test, invite the client sponsor as Client Viewer, and lock the canonical SHA-256 approval hash.
  • Offboard Step 1 — Drain & pause: halt new sequence intake immediately; let active positive replies drain through Unibox or hand off threads cleanly.
  • Offboard Step 2 — Export & revoke: export the client's immutable app.workspace_opt_outs suppression log for regulatory recordkeeping, revoke Client Viewer seats and scoped REST API keys, and archive the workspace without disturbing sibling accounts.
Reference FAQ

Frequently asked questions

If a prospect unsubscribes from Client A, are they blocked from receiving Client B's campaigns?
No. Opt-outs are stored inside per-workspace app.workspace_opt_outs tables scoped strictly by workspace_id (with DELETE revoked at the PostgreSQL role level). That honors Client A's permanent suppression permanently without silently starving unrelated Client B retainers.
How does PostgreSQL FORCE RLS protect us if an application query forgets a workspace_id filter?
Because policies are enforced directly inside the PostgreSQL query planner — even against the table owner via FORCE ROW LEVEL SECURITY — any query lacking an authorized SET LOCAL session context for a workspace simply receives zero rows instead of leaking sibling client data.
What happens when our agency scales past 15 active client workspaces?
Each Scale plan covers 15 isolated client workspaces and 60 custom tracking hostnames. Agencies crossing 15 clients add a second Scale tier allocation (e.g., 2× Scale = 30 workspaces, 150 BYO slots, 700,000 sends/mo, 120 tracking hostnames). See /agencies and /pricing?tier=scale#stack-builder.
Can a Client Viewer ever see our agency Stripe invoice or raw mailbox credentials?
Never. Billing tables live at app.organizations behind owner/admin policies, and encrypted OAuth/SMTP credentials plus scoped API keys are blocked from client_viewer roles by PostgreSQL RLS policies. See /security for the full architecture overview.

Companion Free Tool · Zero Sign-Up

Audit client sequence drafts for trigger phrases, link counts, public URL shorteners, and word-count balance before SHA-256 approval.

Open Tool
All playbooks
Zero-Loss Unified Stack

Ship this architecture without five tools.

Provision secondary domains with 1-click Auto-DNS, StackHeat™ tiered warmup, 6-ESP seed tests, and circuit-breaker outbound sequencing from one workspace.