# DeFi Intel Agent Gateway – SQL AST Validator

> DeFi Intel Agent Gateway – SQL AST Validator is a paid API for AI agents from defi-intel-agent-gateway.gg-neo15.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Validates a SQL statement and scores it for injection and performance risk without executing it, returning a normalized AST summary

## Facts

- Endpoint: POST https://defi-intel-agent-gateway.gg-neo15.workers.dev/v1/code/sql-ast-validator
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-intel-agent-gateway-sql-ast-validator-5d370b03
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_H8Wf-dAU3R19PAQ2v6hCu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability defi-intel-agent-gateway-sql-ast-validator-5d370b03 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-intel-agent-gateway-sql-ast-validator-5d370b03/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-intel-agent-gateway.gg-neo15.workers.dev](https://www.zero.xyz/host/defi-intel-agent-gateway.gg-neo15.workers.dev/llms.txt)
