AI pentesting guides / By tech stack

Vibe coding

Security testing for vibe-coded apps

Security testing a vibe-coded app means testing what the deployed app actually does, because the person who prompted it into existence often has not read, and may not be able to read, the code behind it. Black-box testing suits that situation: it asks the running app the questions an attacker would and records the answers.

Apps built by prompting a model tend to work convincingly in the demo path. The gaps sit off that path: what happens when a request skips the UI, uses someone else's ID, or arrives with no login at all.

What typically goes wrong

  • Authentication done in the browser only: the page checks if the user is logged in, but the API or database answers anyone.
  • Databases exposed directly to the frontend (Supabase, Firebase) with row-level rules missing or set to allow everything.
  • Secret keys for payment, email or AI APIs placed in frontend environment variables and shipped in the JavaScript bundle.
  • Admin features hidden from the menu but reachable by URL.
  • No rate limiting on login, sign-up, password reset or paid AI endpoints, which invites abuse and unexpected bills.

Why prompting for 'make it secure' is not enough

A model can add a login screen, an auth check or a security policy when asked, and it often will. What it cannot do reliably is confirm that every path to the data goes through that check, especially after dozens of later edits. Each new prompt can add a route or table without the protections the earlier ones had. The only way to know is to test the deployed result, and to test again after significant changes.

A minimum pre-launch checklist

  • Sign up as two separate users and try to read and edit each other's data.
  • Call every API endpoint you can find with no session at all.
  • Search the deployed JavaScript for keys and check which are secret.
  • Confirm database rules (RLS or Security Rules) are enabled on every table or collection.
  • Check that error pages do not show stack traces or configuration.
With Pentest-Swarm

Testing a vibe-coded app with Pentest-Swarm

Pentest-Swarm is an open-source autonomous pentester that tests web apps and APIs over HTTP, so it does not matter which tool or model wrote the code. Run it against a preview or staging URL you own.

  • Start with pentestswarm run, the interactive launcher, which walks you through choosing a model, a target and a live view; no flags to memorise.
  • Turn on headless-browser recon (--browser) so it can see the API calls a JavaScript-heavy app makes.
  • Give it a test account's session so it can try the cross-user checks above automatically.
  • Run it on a local model through Ollama or LM Studio if you prefer that no data leaves your machine.
  • Each proven finding comes with evidence and a severity rating you can paste back into your AI tool as a fix request.

Where it falls short

A black-box test only reaches what it can discover and the accounts you give it, and it does not review code quality or dependencies. Pair it with your platform's built-in security checks and a dependency scan, and retest after big changes. The free, self-hosted edition also deliberately limits its most powerful exploitation features; Armur's managed service adds human-reviewed reports and retests.

Questions

Can I test my app if I did not write the code?

Yes. Black-box testing works from the outside, against the running app, so you do not need to understand the code to find out whether it leaks data.

Is it legal to pentest my own vibe-coded app?

Testing apps you own is fine. Make sure your hosting provider's terms allow it, and never point a scanner at services you do not own.

How often should I test?

Before launch, then after any change that adds pages, tables or API routes. Each prompt can change your attack surface.