{"uid":"cap_H8Wf-dAU3R19PAQ2v6hCu","slug":"defi-intel-agent-gateway-sql-ast-validator-5d370b03","name":"DeFi Intel Agent Gateway – SQL AST Validator","description":"Validate a SQL statement and score injection/performance risk WITHOUT executing. Returns a normalized AST summary. DO NOT use to run queries. — $0.002 USDC/call on Base. Pay-per-call via x402 — no API key, no account. Free samples daily.","url":"https://defi-intel-agent-gateway.gg-neo15.workers.dev/v1/code/sql-ast-validator","method":"POST","headers":{},"bodySchema":null,"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fga-byWt62YzOBCgG6eZo","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a SQL statement and scores it for injection and performance risk without executing it, returning a normalized AST summary","exampleAgentPrompt":"Check this SQL query for injection vulnerabilities and performance issues without running it — SELECT * FROM users WHERE id = '1 OR 1=1' — and give me the risk scores and AST summary.","exampleUseCases":[{"title":"Sanitize user-submitted search queries","prompt":"A user just submitted this SQL through our search form: SELECT * FROM orders WHERE customer_id = '5' OR '1'='1'. Can you validate it for injection risk and tell me the AST breakdown before we touch the database?"},{"title":"Audit dynamically generated ORM queries","prompt":"Our ORM is generating this query at runtime: SELECT u.name, o.total FROM users u JOIN orders o ON u.id = o.user_id WHERE o.status = 'open' ORDER BY o.total DESC. Can you score it for performance risk and parse it into an AST so I can see the structure?"},{"title":"Pre-flight check on analyst-written SQL","prompt":"Before I let this analyst-written query anywhere near production, can you validate it for both SQL injection patterns and performance red flags: SELECT * FROM transactions JOIN wallets ON transactions.wallet_id = wallets.id WHERE wallets.balance > 1000?"}],"resultDescription":"Returns a normalized AST (Abstract Syntax Tree) summary of the parsed SQL statement along with a scored assessment of injection risk and performance risk — without executing the query. Includes structured breakdown of query components such as clauses, tables, conditions, and joins.","failureModes":["Malformed or unparseable SQL may return a parse error with no AST","Extremely long or complex queries may exceed payload limits","Non-SQL input (e.g. NoSQL, shell commands) will fail validation","Missing or malformed request body returns a 400 error","Payment failure via x402 protocol results in a 402 response blocking the call"],"whenToPreferThis":"Choose this endpoint when you need a safe, non-executing analysis of a SQL statement for security auditing, injection detection, or performance pre-screening — especially in agent workflows where executing untrusted SQL is unacceptable. Prefer this over manual review or database EXPLAIN plans when you need a fast, programmatic, scoreable risk assessment without any database connection.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:33:00.357Z","isFirstParty":false}