Convex functions in AI-built apps: who can call them without logging in?
Convex gives an AI-built app a database and server functions with very little setup. The deployment URL ships in your browser code on purpose. That is fine. What matters is what the functions behind it will do for a stra
Convex gives an AI-built app a database and server functions with very little setup. The deployment URL ships in your browser code on purpose. That is fine. What matters is what the functions behind it will do for a stranger who calls them directly.
The risk in one sentence
A Convex query or mutation exported with the public helpers can be called by anyone who knows your deployment URL and the function name. If the function never checks who is calling, it works for everyone.
What to check
-
Every public function checks identity. In the function, look for a call to
ctx.auth.getUserIdentity()and a clear error when it returns null. Generated code often skips this on "simple" list and delete functions. - Ownership, not just login. Being signed in is not enough. A mutation that takes a document id should confirm the document belongs to the caller before it edits or deletes it.
- Private work uses internal functions. Helpers that should only run from other server code, scheduled jobs or webhooks belong in the internal function types, not the public ones.
- Arguments are validated. Each function should declare argument validators so a caller cannot send unexpected shapes or fields.
- No admin or deploy key in the browser. The deployment URL is public by design. A deploy key or admin key is not. Search your built JavaScript for it.
- Dev and production are separate. A production site pointing at a dev deployment with test data and loose rules is a common slip.
A quick outside test
Open your live app in a private window, signed out. Open dev tools and watch the network tab while you click around. Note the function names the app calls. Then ask a simple question for each one: if a stranger called this by name with no login, what would happen?
What an outside scan can and cannot tell you
I work on ProofForge. The free scan checks the public side of a URL you own or have permission to test: browser bundle, public files, headers and supported backend signals. It never signs in. It looks for things like private keys sitting in your JavaScript. It does not test what your Convex functions allow, so the checklist above still has to be done by whoever owns the code. A clean result means nothing was found in the public assets checked, not that the app is secure.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.