Wanted: Replit app security guide

It’d be pretty much amazing if Replit published a guide to securing web apps before hitting the ‘deploy’ button.

With many non-technical people now jumping in and creating apps, sometimes I wonder, if apps are being deployed with security in mind?

I know that people should be mindful of this, but it does seem to skip the mind sometimes when in the moment.

Perhaps this exists, but if not, it is an idea!

CC: @matt-replit

2 Likes

Thanks for the awesome video @matt-replit!

1 Like

Here’s a prompt for you guys that will systematically go through this workflow in a logical way.

I need you to perform a full security audit of this application to ensure the following security best practices are implemented correctly. Please check both frontend and backend code for each item below, and output a checklist with ✔️ or ❌ along with the specific file and line references where each security measure is (or isn’t) handled. If anything is missing or partially implemented, suggest exact code snippets to fix it.

Frontend Security:
	•	Use HTTPS everywhere
	•	Input validation and sanitization (prevent XSS)
	•	Do not store sensitive data in the browser (especially API keys or tokens)
	•	CSRF protection — anti-CSRF tokens for forms and state-changing requests
	•	Never expose API keys in frontend code

Backend Security:
	•	Authentication fundamentals (use proper libraries, hashed + salted passwords)
	•	Authorization checks (verify permissions before actions)
	•	API endpoint protection (auth required for all endpoints)
	•	SQL injection prevention (parameterized queries or ORM, never raw SQL)
	•	Basic security headers (X-Frame-Options, X-Content-Type-Options, HSTS)
	•	DDoS protection (use a CDN or service with DDoS mitigation)

Focus on static analysis first, then run a simulated audit if needed. Build a manifest of the changes needed. Output the results in a clean markdown checklist with details. If manifest is accepted, systematically implement it. As the manifest items are completed, remove them from the manifest so we stay on track.
2 Likes

Thanks for sharing that optimized prompt. Do you typically go through that step by step and iterate, test, and repeat, or are you doing it in one go?

Best to do it soon after initial prototype so you don’t break things. But yeah I try to do it all in one.

1 Like

This was added into the official Replit docs looks like as well: Replit Docs

2 Likes