# SQL Injection Detection API

> SQL Injection Detection API is a paid API for AI agents from defi-shield-hazel.vercel.app, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Analyzes SQL query strings for injection vulnerabilities including UNION attacks, stacked queries, tautologies, blind injection, error-based, and boolean extraction patterns

## Facts

- Endpoint: POST https://defi-shield-hazel.vercel.app/api/dev/query-safety
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-shield-hazel-vercel-app-d6b664e0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4_YgmPQ07VZVgOeSP3Igm

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-shield-hazel-vercel-app-d6b664e0 -d '<json body>'
```

Example prompt: Can you check if this SQL query is safe to execute — 'SELECT * FROM orders WHERE user_id = ' + userInput — and tell me whether it contains any injection patterns like UNION attacks or tautologies?

## When to prefer this

Use this endpoint when you need fast, real-time SQL injection screening of user-supplied or dynamic query strings before execution — especially when you need structured findings and a risk level rather than just a pass/fail. Prefer this over generic prompt injection detectors when the input is specifically a SQL query.

## Known failure modes

- Missing or malformed query field returns validation error
- Extremely long query strings may be truncated or rejected
- False negatives possible for highly obfuscated or novel injection patterns not in the 18-pattern ruleset
- Non-SQL input (e.g. NoSQL, GraphQL) may return misleading results

## How this service works

Performs safety assessments of DeFi contracts and transactions, returning security scores and risk indicators for developer use.

## Output

Returns a JSON object with injection_detected boolean, risk_level (e.g. 'none', 'high'), an array of findings describing detected patterns, the number of patterns checked (up to 18), whether the query uses parameterized form, a human-readable recommendation, and response time in milliseconds.

## Example request

```json
{
 "query": "SELECT * FROM users WHERE id = 1 AND name = 'admin'"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-shield-hazel-vercel-app-d6b664e0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-shield-hazel.vercel.app](https://www.zero.xyz/host/defi-shield-hazel.vercel.app/llms.txt)
