Abbi Labs

2026-12-06 · Daily security tips

Is your OpenAI or Anthropic key running in the browser?

The official OpenAI and Anthropic JavaScript libraries won't run in a browser by default, because that exposes your secret key. OpenAI's error message even shows the way around it: dangerouslyAllowBrowser: true. Easy to paste in when you just want the error gone. But then your key is in the JavaScript every visitor downloads.

Check: search your project for dangerouslyAllowBrowser. Then open your live site, DevTools > Sources, search all files for sk-proj- and sk-ant-. A hit means anyone can copy the key and spend your credits.

Fix: remove the flag, move the AI call to a server route or Edge Function with a new key in a server-only env var, then revoke the old key.

Full guide: what dangerouslyAllowBrowser exposes, a 1-minute code search and 2-minute live-site check, the fix order, a server route with sign-in and rate limits, and when browser use is fine.

Read the dangerouslyAllowBrowser guide →

Is your live site exposing something like this?

The free quick check looks at what your site already serves publicly: secret keys in your JavaScript, open /.env files and /.git folders, Supabase tables readable with your public key, missing security headers, CORS misconfiguration, insecure cookie flags and TLS certificate expiry. No sign-up needed.

No app handy?

Example result · our deliberately broken demo app

6 issues found: 3 critical, 1 high, 1 medium, 1 low

  • Critical: Stripe live secret key in public JavaScript
  • Critical: /.env file readable by anyone
  • High: Git repository exposed (/.git/HEAD)

The demo's problems are planted on purpose. Paste your own URL above to see yours.

No sign-up. Read-only public-resource and protocol metadata checks. No model prompts or tool execution. Scan only sites you own or are allowed to test.

Run on every deploy or use from Cursor / Claude Code via MCP →

Weekly AI-app security checklist

One short email a week: a practical check for apps built with Supabase, Next.js and AI tools (RLS, leaked keys, headers and more). Unsubscribe anytime.