← Back to library

Supervise an AI-built SaaS like a junior engineer

Using only Replit Agent, u/rohynal took a multi-tenant SaaS to production in about two weeks and found every layer breaking in surprising ways: security policies quietly skipped, OAuth tokens double-encrypted, environment settings changing back, and production wired to the dev database. The builder likens the job to supervising a junior engineer.

  • OutcomeWhen an agent builds a multi-tenant app, verify the risky layers yourself: row-level security, token handling, environment settings and which database production points at.
  • SetupAn afternoon+
  • LevelAdvanced
  • Creditu/rohynal on r/replit
View original
Works with
Custom agent

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 24, 2026

When should you use it?

  • An agent is building a multi-tenant app
  • You are about to launch to paying users
  • Customer data must stay separated

Not for: Single-user prototypes; Apps with no customer data

What do you need, and what do you get?

You need

  • Repo and environments
  • Database policies
  • Auth setup
  • Deployment config

You get

  • Checklist results per layer
  • Tenant isolation test
  • Environment map

How does it work, step by step?

  1. Map environmentsWrite down which database, keys and URLs each environment uses.
  2. Test tenant isolationLog in as two test tenants and try to read each other's data.
  3. Check token handlingConfirm tokens are encrypted once and refresh correctly.
  4. Lock settingsTrack environment variables in a reviewed file so reverts show up.
  5. Recheck on every deployRun the same checks after each agent change before release.

The prompt

Our own prompt, inspired by u/rohynal on r/replit and written to work in Custom agent. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt2 variables
Review this multi-tenant app before release. Repo: {repo}. Environments: {envs}.
1. List every table and its row-level security policy; flag any query using a key that bypasses policies.
2. Trace OAuth token storage and confirm it is encrypted exactly once.
3. Show which database URL each environment uses.
4. Write a test where tenant A tries to read tenant B's records. Report results; do not change production.

Inspired by u/rohynal on r/replit: My first serious Replit build: a production multi-tenant SaaS in 15 days (and the lessons I’m still using every day). The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • Security policies that look present but are bypassed by a service key.
  • A live deployment that still reads and writes the development database.

Our take

This is one of the most concrete lists of AI build failures we have seen, and each item maps to a check you can run in minutes. The theme is silent failure: things that look configured but are not. Treat the agent's work like a junior engineer's and verify layers where a mistake leaks one customer's data to another. Write each check as an automated test the agent must keep passing, so a later change that weakens isolation fails loudly. Write down which database, keys and URLs each environment uses, then log in as two test tenants and try to read each other's data. Confirm tokens are encrypted once and refresh correctly. Track environment variables in a reviewed file so silent reverts show up. Watch for security policies bypassed by a service key and for production still wired to the development database. Run these checks after every agent change. Prototypes can skip some of this.

Where the time goes back: A short pre-release checklist catches the failures that would cost customer trust.

FAQ

Where is the full write-up?
The poster links their own article from the Reddit post.
Can the agent test this itself?
Ask it to write the tests, but run the isolation test yourself.

Source and credit

Inspired by u/rohynal on r/replit. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
My first serious Replit build: a production multi-tenant SaaS in 15 days (and the lessons I’m still using every day)
Creator
u/rohynal on r/replit
Published on
Reddit
Original date
Dec 2, 2025
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Custom agent
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in IT & Security

All 82 IT & Security playbooks →

Related playbooks

IT & SecurityWorkflow✓ AI dry run

Build one pull request dashboard across two DevOps servers

Have a coding agent build a small internal web page that gathers every open pull request from several repositories and highlights the ones needing action.

Credit: cmpalmer52 on Hacker News

An afternoon+
IT & SecurityWorkflow✓ AI dry run

Fan one coding task out to parallel agents

Have a lead agent split a big job into independent pieces, start child agents on each, then combine and compare their results.

Credit: Jared Zoneraich (@imjaredz)

An afternoon+
IT & SecurityWorkflow✓ AI dry run

Have a browser agent run your API tests in Postman

Give a browser agent your endpoint details and let it build varied test payloads in Postman, run them, and write a results report.

Credit: AshutoshShrivastava (@ai_for_success)

Minutes