Back to blog

5 patterns prodlint keeps catching in vibe-coded apps

updated 7 min readprodlint

Same tools, same blind spots

We built prodlint because AI-generated code has predictable gaps. Not random bugs. Predictable ones. Cursor, v0, Bolt, Claude Code, Copilot. They all produce code that compiles, passes linting, and runs fine locally. But they consistently skip the same production concerns. We've been running prodlint on our own projects and on open-source repos on GitHub. The same five patterns keep showing up, across different tools, different frameworks, different developers. Here they are.

#1 Hardcoded secret fallbacks

This one shows up everywhere. The AI writes process.env.SOMETHING || "default-value" because it's trying to make the code work out of the box. Helpful in a tutorial. Dangerous in production. The problem isn't that the fallback exists during development. It's that it ships to production, sits in your git history, and silently activates if someone forgets to set the env var during deployment. JWT secrets, database URLs, API keys. The AI does this unless you explicitly tell it not to.

Bad: fallback exposes secrets
const jwtSecret = process.env.JWT_SECRET || "dev-secret"

const resend = new Resend(
  process.env.RESEND_API_KEY || "re_123456789"
)
What prodlint reports for this rule
src/lib/services.ts  1:19  CRIT  Secret env var has a hardcoded fallback — if JWT_SECRET is unset, this literal becomes the production secret  env-fallback-secret        ↳ Throw an error if the env var is missing: const secret = process.env.SECRET ?? (() => { throw new Error("SECRET is required") })()  4:3  WARN  Security-sensitive env var has a hardcoded fallback — defaults to a literal string when missing  env-fallback-secret        ↳ Fail fast when required env vars are missing instead of falling back to a default value
Fix: crash if secrets are missing
function requireEnv(name: string): string {
  const val = process.env[name]
  if (!val) throw new Error(`Missing required env var: ${name}`)
  return val
}

const jwtSecret = requireEnv('JWT_SECRET')
const resend = new Resend(requireEnv('RESEND_API_KEY'))

#2 Server actions with no auth check

Next.js server actions are the worst offender here because the AI treats them like regular functions. It writes the database mutation, adds revalidatePath, and moves on. But server actions are HTTP endpoints. Anyone can call them. You don't need to be logged in, you don't need to be on your site, you just POST to the endpoint with the right payload. Delete operations, role changes, payment modifications — all without a single auth check. The AI just doesn't think about who's calling the function. It writes the happy path and stops.

Bad: no auth before mutation
'use server'

export async function deleteAccount(userId: string) {
  await db.delete(accounts).where(eq(accounts.id, userId))
  revalidatePath('/admin')
}

export async function changeSubscription(userId: string, plan: string) {
  await db.update(users).set({ plan }).where(eq(users.id, userId))
}
What prodlint reports for this rule
src/app/actions/admin.ts  1:1  WARN  Server action performs mutations without any authentication check — anyone can call this action  server-action-auth        ↳ Add auth check: const session = await auth(); if (!session) throw new Error("Unauthorized")
Fix: verify the caller first
'use server'

export async function deleteAccount(userId: string) {
  const session = await auth()
  if (!session?.user) throw new Error('Not authenticated')
  if (session.user.id !== userId) throw new Error('Forbidden')

  await db.delete(accounts).where(eq(accounts.id, userId))
  revalidatePath('/admin')
}

#3 API routes without rate limiting

AI-generated API routes almost never include rate limiting. Contact forms, signup endpoints, webhook receivers, AI chat completions (those are expensive). All accepting unlimited requests from anyone. The scariest version of this is when someone uses an AI tool to build a wrapper around OpenAI or Anthropic's API. The AI generates a clean Next.js route that proxies the request, but it never adds rate limiting. Anybody who finds the endpoint can burn through the developer's API credits in minutes.

Bad: no rate limiting
// app/api/chat/route.ts
export async function POST(req: Request) {
  const { messages } = await req.json()

  const completion = await openai.chat.completions.create({
    model: 'gpt-4o',
    messages,
  })

  return Response.json(completion)
}
What prodlint reports for this rule
src/app/api/chat/route.ts  2:1  INFO  No rate limiting — anyone could spam this endpoint and run up your API costs  rate-limiting        ↳ Add rate limiting: import { Ratelimit } from '@upstash/ratelimit' or use express-rate-limit
Fix: limit requests per IP
// app/api/chat/route.ts
import { Ratelimit } from '@upstash/ratelimit'
import { Redis } from '@upstash/redis'

const ratelimit = new Ratelimit({
  redis: Redis.fromEnv(),
  limiter: Ratelimit.slidingWindow(10, '1 m'),
})

export async function POST(req: Request) {
  const ip = req.headers.get('x-forwarded-for') ?? '127.0.0.1'
  const { success } = await ratelimit.limit(ip)
  if (!success) {
    return Response.json({ error: 'Too many requests' }, { status: 429 })
  }

  const { messages } = await req.json()
  const completion = await openai.chat.completions.create({
    model: 'gpt-4o',
    messages,
  })
  return Response.json(completion)
}

#4 Empty catch blocks

AI tools write try/catch when they remember to, but the catch block is often completely empty or just has a console.log that nobody reads in production. The result: errors vanish. Your app looks like it's working, but things are silently failing. Database writes that never happened, API calls that returned errors nobody saw, auth checks that threw exceptions and got swallowed. The "// handle error" comment is practically a signature of AI output at this point.

Bad: errors silently swallowed
export async function processPayment(orderId: string) {
  try {
    const order = await db.query.orders.findFirst({
      where: eq(orders.id, orderId)
    })
    await stripe.charges.create({
      amount: order!.total,
      currency: 'usd',
      source: order!.paymentMethod,
    })
    await db.update(orders).set({ status: 'paid' }).where(eq(orders.id, orderId))
  } catch (e) {
    // handle error
  }
}
What prodlint reports for this rule
src/lib/payments.ts  12:5  WARN  Empty catch block — errors are silently swallowed  shallow-catch        ↳ Log the error with context and either re-throw, return an error response, or recover gracefully
Fix: handle or rethrow
export async function processPayment(orderId: string) {
  try {
    const order = await db.query.orders.findFirst({
      where: eq(orders.id, orderId)
    })
    if (!order) throw new Error(`Order ${orderId} not found`)

    await stripe.charges.create({
      amount: order.total,
      currency: 'usd',
      source: order.paymentMethod,
    })
    await db.update(orders).set({ status: 'paid' }).where(eq(orders.id, orderId))
  } catch (err) {
    await db.update(orders).set({ status: 'failed' }).where(eq(orders.id, orderId))
    throw err // let the caller know
  }
}

#5 Supabase tables without RLS

This is the scariest one on the list because the consequences are total. Without Row Level Security, your Supabase anon key (which is public, it's right there in your frontend code) gives anyone full read and write access to that table. You paste the anon key and URL into a Supabase client, call .from('users').select('*'), and you get every row. Not a theoretical attack. The AI generates the CREATE TABLE statement and moves on. It doesn't add ALTER TABLE ... ENABLE ROW LEVEL SECURITY because nobody asked it to. If you're using Supabase with AI-generated migrations, check this first.

Bad: no row-level security
-- supabase/migrations/20240101_init.sql
CREATE TABLE profiles (
  id uuid PRIMARY KEY REFERENCES auth.users(id),
  full_name text,
  avatar_url text,
  stripe_customer_id text
);

CREATE TABLE messages (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  sender_id uuid REFERENCES profiles(id),
  recipient_id uuid REFERENCES profiles(id),
  body text NOT NULL,
  created_at timestamptz DEFAULT now()
);
What prodlint reports for this rule
supabase/migrations/20240101_init.sql  2:1  CRIT  Table "profiles" created without ENABLE ROW LEVEL SECURITY — all rows are publicly accessible via the Supabase API  supabase-missing-rls        ↳ Add: ALTER TABLE profiles ENABLE ROW LEVEL SECURITY; and create appropriate policies  9:1  CRIT  Table "messages" created without ENABLE ROW LEVEL SECURITY — all rows are publicly accessible via the Supabase API  supabase-missing-rls        ↳ Add: ALTER TABLE messages ENABLE ROW LEVEL SECURITY; and create appropriate policies
Fix: enable RLS on every table
CREATE TABLE profiles (
  id uuid PRIMARY KEY REFERENCES auth.users(id),
  full_name text,
  avatar_url text,
  stripe_customer_id text
);
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users read own profile"
  ON profiles FOR SELECT USING (auth.uid() = id);
CREATE POLICY "Users update own profile"
  ON profiles FOR UPDATE USING (auth.uid() = id);

CREATE TABLE messages (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  sender_id uuid REFERENCES profiles(id),
  recipient_id uuid REFERENCES profiles(id),
  body text NOT NULL,
  created_at timestamptz DEFAULT now()
);
ALTER TABLE messages ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users read own messages"
  ON messages FOR SELECT
  USING (auth.uid() = sender_id OR auth.uid() = recipient_id);

Why these five and not others?

AI coding tools optimize for one thing: make it work. They generate code that runs, handles the happy path, and looks clean. But production readiness isn't about making it work. It's about what happens when things go wrong, when someone malicious shows up, when an env var is missing, when a request fails. The AI skips these concerns because they're not part of the prompt. Nobody says "write me a server action and also add auth." They say "write me a server action that deletes a project." And the AI does exactly that. These five patterns are the gap between "it works" and "it's ready to ship." They show up across AI tools because the tools share a blind spot: they build what the prompt asks for.

Run it on your own code

Every pattern in this post is caught by prodlint. One command, zero config. It checks all 52 rules and tells you what to fix. If you're shipping AI-generated code, run it before you deploy. The full list of rules is at prodlint.com/rules.

Check your own code.

52 production readiness checks. Zero config.