Emergent

Emergent (emergent.sh) Security Best Practices

Built something with Emergent? YC-backed speed meets real-world security threats. Scan your app before users find the gaps.

Verify your app follows these best practices automatically.

These best practices are derived from the actual security findings we see in Emergent (emergent.sh) apps — not a generic OWASP list. Priority ordered: critical items close data-exposure gaps, high items prevent compromise, medium items reduce attack surface. Stack-specific guidance for Supabase included.

Quick Wins

Enable Row Level Security (Supabase) or Security Rules (Firebase) on every table
Move all secrets server-side (environment variables, serverless functions)
Enforce email verification, minimum password requirements, and rate limiting on auth endpoints
Enforce email verification, minimum password requirements, and rate limiting on auth endpoints
Run a VAS scan against the deployed Emergent (emergent.sh) app

Security Best Practices

#1Enable access controls on every table

critical

Emergent apps often connect to Supabase without configuring Row Level Security, leaving tables publicly readable.

Implementation

Enable Row Level Security (Supabase) or Security Rules (Firebase) on every table. For custom backends, enforce authorization at the query layer — never client-side.

Don't do this
-- Table created without RLS — the default in Supabase
create table public.posts (id uuid primary key, user_id uuid, content text);
Do this instead
-- RLS on, with ownership check
create table public.posts (id uuid primary key, user_id uuid, content text);
alter table public.posts enable row level security;
create policy "Users manage own posts" on public.posts
  for all to authenticated
  using ((select auth.uid()) = user_id)
  with check ((select auth.uid()) = user_id);

#2Client-Side API Key Leakage

high

Third-party API keys are embedded directly in generated frontend code instead of server-side proxies.

Implementation

Move all secrets server-side (environment variables, serverless functions). Rotate any keys previously in frontend code. Audit bundles for leftover credentials before each deploy.

#3Close: Unprotected API Endpoints

high

Backend routes generated by Emergent may lack authentication middleware.

Implementation

Enforce email verification, minimum password requirements, and rate limiting on auth endpoints. Test auth flows as unauthenticated and cross-user to verify access controls.

#4Insecure Default Auth Configuration

high

Generated auth flows may skip email verification, rate limiting, and password complexity requirements.

Implementation

Enforce email verification, minimum password requirements, and rate limiting on auth endpoints. Test auth flows as unauthenticated and cross-user to verify access controls.

Common Mistakes to Avoid

Exposed Supabase Credentials with Missing RLS

Why it's dangerous:

Emergent apps often connect to Supabase without configuring Row Level Security, leaving tables publicly readable.

How to fix:

Enable Row Level Security (Supabase) or Security Rules (Firebase) on every table. For custom backends, enforce authorization at the query layer — never client-side.

Client-Side API Key Leakage

Why it's dangerous:

Third-party API keys are embedded directly in generated frontend code instead of server-side proxies.

How to fix:

Move all secrets server-side (environment variables, serverless functions). Rotate any keys previously in frontend code. Audit bundles for leftover credentials before each deploy.

Unprotected API Endpoints

Why it's dangerous:

Backend routes generated by Emergent may lack authentication middleware.

How to fix:

Enforce email verification, minimum password requirements, and rate limiting on auth endpoints. Test auth flows as unauthenticated and cross-user to verify access controls.

Insecure Default Auth Configuration

Why it's dangerous:

Generated auth flows may skip email verification, rate limiting, and password complexity requirements.

How to fix:

Enforce email verification, minimum password requirements, and rate limiting on auth endpoints. Test auth flows as unauthenticated and cross-user to verify access controls.

Verify Your Emergent (emergent.sh) App Security

Following best practices is the first step. Verify your app is actually secure with a comprehensive security scan.

Get Starter Scan

Frequently Asked Questions

What's the minimum security I need for a Emergent app?

The critical-priority items above are non-negotiable for any Emergent (emergent.sh) app that handles user data: enable access controls on every table. Everything else is iterative.

Should I run a security scan before launching a Emergent (emergent.sh) app?

Yes — unconditionally. The mitigations above are specific enough that a scan proves they're implemented correctly. "I followed the checklist" isn't evidence; "the scan came back clean" is.

Is Emergent (emergent.sh) secure by default?

Emergent (emergent.sh) provides secure infrastructure, but the application-layer configuration (listed above) is the developer's job. The default state of a Emergent (emergent.sh) app before any security work typically has at least one critical-priority issue open.

Last updated: April 2026