{"uid":"cap_ToMs8y98EOwRdTPhxj1oN","slug":"sql-query-safety-preflight-check-7a544d44","name":"SQL Query Safety Preflight Check","description":"Safety and performance preflight for a database query BEFORE you run it. Send the query for Postgres, MySQL or SQLite and get a pass, caution or block verdict with per-finding operation, severity, plain-language reason and a fix. Query-safety indicators, not a guarantee.","url":"https://api.agentstools.dev/sql/check","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"sql":{"type":"string","description":"The query text to check"},"dialect":{"enum":["postgres","mysql","sqlite","bigquery","snowflake"],"type":"string","description":"Database dialect (default postgres)"},"options":{"type":"object","description":"Optional hints, e.g. indexed_columns: list of column names to refine performance findings"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_IVsuDn7MOxpKRGeooSryr","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Analyzes a SQL query before execution and returns a pass/caution/block verdict with per-finding severity, reason, and suggested fix for Postgres, MySQL, or SQLite.","exampleAgentPrompt":"Before running this query, do a safety preflight check on it for Postgres and tell me if it's safe, needs caution, or should be blocked — and explain any findings: DELETE FROM orders WHERE status = 'pending';","exampleUseCases":[{"title":"Autonomous agent pre-execution guard","prompt":"I'm about to run this SQL on the production Postgres database — check it first and block if anything looks dangerous: UPDATE users SET role = 'admin';"},{"title":"Catching missing WHERE clause","prompt":"Can you audit this query for safety before I execute it on SQLite? It's: DELETE FROM sessions; — I want to know if it'll wipe everything and whether I should add a WHERE clause."},{"title":"Performance preflight for slow queries","prompt":"Run a preflight check on this MySQL query for performance issues — I know it touches a big table and I want to see if there are any missing index warnings before I run it: SELECT * FROM events WHERE user_id = 42 AND created_at > '2024-01-01';"}],"resultDescription":"Returns a top-level verdict of pass, caution, or block, along with a list of findings each containing the operation type, severity level, a plain-language reason explaining the risk or performance concern, and a suggested fix to resolve it.","failureModes":["Malformed or non-parseable SQL returns an error or block verdict","Unsupported dialect returns a validation error","Missing required 'sql' field returns a 400-style error","Very complex or extremely long queries may produce incomplete analysis","Findings are indicators, not guarantees — a 'pass' does not certify the query is production-safe"],"whenToPreferThis":"Use this endpoint when an AI agent or automated pipeline needs to validate SQL before executing it, especially in autonomous or low-oversight workflows where a dangerous query (e.g. DROP TABLE, DELETE without WHERE) could cause irreversible harm. Prefer this over manual review when speed and consistency matter, or when the query was generated dynamically by an LLM. Best suited for Postgres, MySQL, and SQLite workloads where a lightweight, per-query safety gate is needed without spinning up a full database linter or query planner.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T13:07:02.184Z","isFirstParty":false}