{"uid":"cap_5wNWZ3MJezAlKeExlLBWH","slug":"vrsai-sql-preflight-check-f1b3876a","name":"vrsai SQL Preflight Check","description":"Check PostgreSQL SQL immediately before execution to prevent destructive or unsafe database changes by AI agents and automated systems.","url":"https://api.vrsai.tech/v1/capabilities/sql_preflight/versions/1.0.0/execute","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object"},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"checks":[{"id":"parse_validity","status":"PASS"},{"id":"statement_count","status":"PASS","evidence":{"count":1}},{"id":"unbounded_delete","status":"BLOCK","reason_code":"DELETE_WITHOUT_WHERE","statement_index":0},{"id":"protected_relation_mutation","status":"BLOCK","evidence":{"relations":[{"name":"customers"}]},"reason_code":"PROTECTED_RELATION_MUTATION","statement_index":0},{"id":"expected_statement_kind","status":"PASS","statement_index":0}],"coverage":{"dialect":"postgresql","assessment_scope":["unbounded_delete","unbounded_update","truncate","destructive_drop","destructive_cascade","alter_table_hazards","nonconcurrent_index","create_extension","protected_relation_mutation","dynamic_or_procedural_sql","expected_statement_kind","multi_statement_evaluation"],"checks_performed":["unbounded_delete","unbounded_update","truncate","destructive_drop","destructive_cascade","alter_table_hazards","nonconcurrent_index","create_extension","protected_relation_mutation","dynamic_or_procedural_sql","expected_statement_kind","multi_statement_evaluation"],"checks_not_performed":["privilege_change","explicit_locking","alter_system","availability_maintenance","external_program_execution","drop_schema_or_database","read_cost_and_row_estimation","sensitive_data_access_and_exfiltration","tenant_isolation","semantic_correctness"],"complete_for_declared_scope":true},"decision":"BLOCK","statements":[{"kind":"DELETE","index":0,"decision":"BLOCK","relations":[{"name":"customers"}],"mutates_data":true,"reason_codes":["DELETE_WITHOUT_WHERE","PROTECTED_RELATION_MUTATION"],"administrative":false,"changes_schema":false,"changes_privileges":false}],"reason_codes":["DELETE_WITHOUT_WHERE","PROTECTED_RELATION_MUTATION"],"machine_action":"DO_NOT_EXECUTE","ruleset_version":"1.0.0","statement_count":1,"input_fingerprint":"v1:4634deedb0970b042098df09e6f8bf365f2ddb635a18742c5ffa676844e4fa62"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xp2PfFBN5wGWeU6pAu7ND","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates PostgreSQL SQL statements immediately before execution to detect and block destructive or unsafe database operations by AI agents and automated systems.","exampleAgentPrompt":"Before you run that DELETE statement on the users table, send it through the vrsai SQL preflight check to make sure it won't cause any destructive or unintended changes to our PostgreSQL database.","exampleUseCases":[{"title":"Guarding AI-generated schema migrations","prompt":"I'm letting an AI agent write and run database migrations automatically — before any SQL gets executed against our PostgreSQL database, run it through the vrsai SQL preflight check to block anything that could drop tables or wipe data."},{"title":"Blocking runaway DELETE in agentic workflow","prompt":"My automated agent just generated a DELETE statement with no WHERE clause — can you send it to the vrsai SQL preflight endpoint right now to check if it's safe before it runs?"},{"title":"Compliance review for AI database writes","prompt":"We need every INSERT and UPDATE that our AI assistant produces to be checked for unsafe patterns before hitting production PostgreSQL — run this SQL through vrsai's preflight check and tell me if it's cleared or flagged."}],"resultDescription":"The endpoint returns a safety assessment of the submitted SQL statement, indicating whether it is safe to execute or should be blocked, along with identified risk flags such as destructive operations (DROP, TRUNCATE, DELETE without WHERE), unscoped bulk modifications, or other unsafe patterns that could cause data loss or unintended state changes.","failureModes":["Malformed SQL input may return a parse error or rejection","Non-PostgreSQL SQL dialects may not be accurately assessed","Payment failure (402) if USDC balance is insufficient","Schema validation error if required body fields are missing or incorrectly typed","Network timeout if the API is temporarily unreachable","False negatives on highly obfuscated or dynamically constructed SQL strings"],"whenToPreferThis":"Choose this endpoint when you need a real-time, pre-execution safety gate specifically for PostgreSQL SQL in agentic or automated pipelines. It is ideal when AI agents are generating or executing SQL autonomously and human review is not feasible before every query. Prefer it over generic SQL linters when you need a decision-ready approve/block signal rather than style feedback, and especially when the risk of data loss or destructive operations from AI-generated queries is a primary concern.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:34:28.752Z","isFirstParty":false}