Harden the public Emergent app: Auth, preview≠Deploy, and abuse controls before campaigns
A shared Emergent preview link (`*.preview.emergentagent.com`) or a public Deploy URL (`*.emergent.host`) invites scrapers, credential stuffing, and managed-hosting credit burn the moment you paste it. Hardening means sealing workspace secrets, putting Auth in front of FastAPI writes, treating preview MongoDB as disposable non-prod, locking who can Redeploy from the coding-agent workspace, and deciding credit-burned Deploy versus org GitHub CI—before campaigns treat your agent-built MVP as free infrastructure. You keep the MVP surface; you close the abuse doors Emergent defaults leave open.
CodeCross LLC treats emergent-mvp-hardening as closing two Emergent surfaces before ads: a shared `*.preview.emergentagent.com` lab link and a credit-funded `*.emergent.host` Deploy. Operators lock Redeploy ACLs on the coding-agent workspace, require sessions on mutating FastAPI writes, treat preview MongoDB as disposable, and watch hosting-credit burn. Finished when a stranger with the public URL cannot drain credits or read another user’s documents, and the agent cannot write the production cluster.
How a shared Emergent URL gets abused
Anyone-with-the-workspace-invite is not a launch posture
Preview links and `.emergent.host` origins are easy to discover once shared. Assume the URL is hostile until rate limits, Auth, and sharing ACLs say otherwise.
Anonymous callers hammer signup and paid FastAPI routes
Bots probe preview URLs left shared. Hosting credits burn on Emergent managed compute before you buy a single ad.
Workspace invites expose secrets or Deploy controls
Sharing that lets app viewers open the workspace or hit Deploy turns a demo into an incident.
Secrets appear in client bundles, agent chat, or committed .env
Rotate anything that showed up in collaborator history. Separate personal laptop keys from the production Emergent workspace.
Launch day is the first preview≠production DB conversation
If you learn preview MongoDB is what Auth pointed at—or invoices spike while the agent still mutates prod—hardening failed before campaigns started.
The public-Emergent harden we actually run
Seal secrets, require sessions, then document preview≠Deploy
Keep the MVP surface. Close the doors Emergent defaults leave open. Prefer a locked Deploy or custom-domain URL for customers.
01
Secrets only in server env
Never in client bundles, agent chat, or committed .env from Emergent. Treat preview MongoDB as disposable. Back up production DB before traffic.
02
Real sessions on mutating routes
Kill demo bypasses. Tighten workspace sharing so viewers cannot open secrets or Deploy. Auth callbacks match the public hostname you advertise—not a preview that sleeps after idle.
03
Rate-limit expensive FastAPI routes; add a kill switch
Cap concurrency and paid-API spend. Alert on 5xx, 429, and credit-burn spikes. Strangers should not be able to burn hosting credits from the public Emergent URL.
04
Write whether prod is Emergent Deploy or GitHub into org CI
Document the model before campaigns. Hardening fails if the agent still mutates prod on launch day.
How to
Harden a public Emergent app before campaigns
Auth, preview≠prod DB, and abuse controls on the hostname users will hit. Success is strangers unable to burn hosting credits or read data from the public Emergent URL.
Step 01
Assume the shared Emergent URL is hostile
Anonymous signup, Auth, and FastAPI routes that hit paid APIs get rate limits. Shared preview links get locked. Workspace invites stop exposing Deploy.
Step 02
Seal the workspace bag and rotate leaked values
Secrets only in server env. Rotate anything that appeared in collaborator history. Separate developer personal keys from the production Emergent workspace.
Step 03
Require real sessions on writes; match Auth to the public hostname
Kill demo bypasses. Prefer a locked Deploy or custom-domain URL for customers. Keep the editable agent workspace private. Do not point production Auth at a preview that sleeps after idle.
Step 04
Treat preview MongoDB as disposable; back up production DB
Never point production Auth at preview DB. Confirm a restore exists on the production cluster.
Step 05
Document Deploy vs owned CI and add credit / 5xx / 429 alerts
State whether production uses Emergent managed Deploy or GitHub into org CI. Cap paid-API spend. Add a kill switch before campaigns.
Read next
Proof, the essay, and sibling intents
These pages are already on the site. Use them to pressure-test the bet before a call.
Why is a shared `*.preview.emergentagent.com` link a different risk class than Deploy?
Preview may sleep after idle, often points at a non-prod MongoDB, and is frequently shared widely during agent iteration—so leaked preview links expose lab data and half-finished Auth. Deploy on `.emergent.host` is the credit-funded live origin customers hit. Harden both: revoke stale preview shares, never point production Auth at preview DB, and treat Deploy as hostile until rate limits and sessions are real. Conflating the two hosts is how teams “secure prod” while leaving preview wide open.
How do you stop strangers from burning managed hosting credits through open FastAPI routes?
Require authenticated sessions on mutating and paid-API-backed routes; kill demo bypasses the agent left in. Cap concurrency and outbound spend; add a kill switch on the Deploy. Alert on 5xx, 429, and credit-burn spikes—not only HTTP errors. Anonymous callers will hammer signup and agent-generated endpoints as soon as the URL is public; credits make that burn visible on the invoice if you are not watching.
What Auth and workspace-sharing rules belong on an agent-built MVP before campaigns?
Put keys in the Deploy or destination vault only—chat transcripts, committed `.env`, and browser bundles are leak paths. Rotate values that showed up in collaborator history. Invite people as viewers of the app, not as operators who can Redeploy or open the workspace secret bag. Customers should hit a locked `.emergent.host` or custom domain; the coding-agent workspace stays private. Callbacks must list that advertised origin, never a sleeping `*.preview.emergentagent.com` share that still holds lab Mongo rows.
How do you keep the coding agent from mutating production MongoDB while you harden?
Give agent sessions the preview MongoDB URI only. Production writes go through Deploy’s production cluster (or an owned host) that the workspace cannot see. Snapshot that cluster before you buy traffic. Write down the runtime choice—credit-metered `.emergent.host` versus Save/Push into org CI—so on-call already knows how to roll back. If campaign day is when you first notice preview ≠ production DB, or the agent can still insert prod rows while credits spike, the harden did not finish.
Close the public Emergent URL before you buy the traffic.
Bring the share link and the preview-versus-production DB list. We will name the abuse path that would burn hosting credits in week one — or tell you Auth already fails closed.
“What impressed us most about CodeCross was their ability to deeply understand our vision and translate it into a complete digital solution. Unlike many agencies that just focus on technical delivery, CodeCross approached our project like true partners.”