- Home
- Skills
- APIs & Backend
- Convex Functions Check
More screenshots
Works with the AI Agents you already use
Convex Functions Check
This skill finds those and the other Convex mistakes below before you deploy, and tells you how to fix each one.
$5
Convex Functions Check
Example session with this skill installed
Check this project with convex-functions-check.
- Read your context and instructions
- Compiled the convex functions check
$ python3 scripts/check_convex.py examples/risky
BLOCK convex/ai.ts:9 C01 SECRET_IN_CONVEX_CODE
const OPENAI_API_KEY = "<redacted>";
Why: An API key, token, password or private key is written in a Convex source file: a constant or property with a secret name, an Authorization header, a literal fallback after process.env, a known key format (sk_live_, whsec_, GitHub or OpenAI keys, a deploy key), or a password in the user-info part of a database URL. Everyone with the repository can read it, and it stays in git history.
Safer: Store it as a deployment environment variable (npx convex env set NAME value, or the dashboard) and read it with env.NAME or process.env.NAME, with no literal fallback. Rotate the key that was committed.
BLOCK convex/http.ts:8 C03 CORS_ANY_ORIGIN_WITH_CREDENTIALS
BLOCK convex/tasks.ts:22 C02 PUBLIC_WRITE_BY_ID_WITHOUT_AUTH
REVIEW convex/ai.ts:11 C11 PUBLIC_FUNCTION_WITHOUT_AUTH
REVIEW convex/crons.ts:10 C13 PUBLIC_FUNCTION_SCHEDULED_OR_RUN
REVIEW convex/http.ts:14 C17 HTTP_ACTION_WITHOUT_AUTH_OR_SIGNATURE
REVIEW convex/http.ts:30 C19 CORS_ORIGIN_CHECK_UNCLEAR
REVIEW convex/tasks.ts:8 C15 UNBOUNDED_COLLECT
REVIEW convex/tasks.ts:12 C12 MISSING_ARGS_VALIDATOR
REVIEW convex/tasks.ts:15 C14 FILTER_INSTEAD_OF_INDEX
REVIEW convex/tasks.ts:15 C16 DATE_NOW_IN_QUERY
REVIEW convex/tasks.ts:33 C18 UNAWAITED_WRITE_OR_SCHEDULE
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 5 files, 5 with Convex content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
A mutation such as remove = mutation({ args: { id: v.id("tasks") }, handler: async (ctx, args) => { await ctx.db.delete(args.id) } }) works fine in development, and in production it lets anyone who copies your deployment URL from the browser delete any task: every exported query, mutation and action is public. The same goes for corsRouter with allowCredentials: true and the default origins, which echoes every site's Origin back, and for a cron job that calls api.messages.send with an author of "System" that any client can also send. This skill finds those and the other Convex mistakes below before you deploy, and tells you how to fix each one.
Your agent runs a scanner on the TypeScript and JavaScript files in your convex/ folder (functions, http.ts, crons.ts, schema.ts). It knows which constructors are public and which are internal, reads handler parameters in arrow, function and method form (and named handlers declared in the same file), follows import aliases, and treats ctx.auth, getAuthUserId, auth helpers that get ctx, custom function wrappers and secret, key or code arguments as access checks, so the Convex Auth and Clerk setups from the docs come out clean. Calls to other functions through ctx.runMutation and component calls such as a rate limiter are not mistaken for auth checks, and webhook routes need a real verification call, not just a name that says webhook. It never runs your code or connects to a deployment. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach, and the rules guide links the official page behind each rule. Secrets are never printed.
What it checks
BLOCK
- C01: API keys, tokens and passwords written in Convex code: secret-named constants and properties, Authorization headers, literal fallbacks after process.env, known key formats (Stripe and Clerk secret keys, webhook secrets, OpenAI, Anthropic, GitHub, Slack, Google and AWS keys, Convex deploy keys including preview keys, self-hosted admin keys, private keys) and passwords in database URLs
- C02: a public mutation that patches, replaces or deletes a document by an ID from its arguments with no check on the caller
- C03: credentials allowed for any origin: corsRouter with allowCredentials and default, "" or shared-host wildcard origins such as ".vercel.app", or an Origin header echoed back with Access-Control-Allow-Credentials and no check (or only a startsWith check)
REVIEW
- C11: a public mutation or action that never checks who is calling (saving through ctx.runMutation or calling a component does not count as a check)
- C12: a public function that reads its arguments without an args validator
- C13: api.* functions scheduled, run with ctx.runQuery / runMutation / runAction, or called by cron jobs instead of internal.*
- C14: .filter on a database query instead of an index (paginated queries excepted)
- C15: .collect() on a query with no index range
- C16: Date.now() or new Date() inside a query
- C17: an HTTP action that writes, schedules or stores files without ctx.auth, an Authorization or signature header check, or a verification call (svix, jwt, stripe constructEvent, HMAC)
- C18: ctx.db writes, scheduler calls or ctx.runMutation / runAction without await
- C19: an echoed Origin with credentials whose only check is loose or unclear (endsWith without a leading dot, includes, an unanchored regex)
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason, safer approach and official source for each rule
- A risky and a safe example Convex backend (tasks, an AI action, crons and HTTP routes), and the real report the scanner produces on the risky one
Limits It reads each file on its own. Handlers given by name are followed only when declared in the same file. Helpers and custom function wrappers defined in other files are trusted to do the checks their names suggest, so functions built with customMutation, authedMutation or Ents, and handlers imported from other files, are not checked for missing auth or validators. Queries built across several statements, row-level security rules, and allow lists or CORS settings kept in other files are not followed, and client code, .env files and dashboard settings are not read. NOT FLAGGED is not a guarantee.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Static check of code text. Helpers, wrappers and handlers in other files are trusted by name, queries assembled across statements are not followed, and client code, .env files and deployment settings are not read. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
- Software
Node.js
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example backend includes one clearly fake, inert key (not-a-real-...) for the scanner to find. Nothing in it is run.