---
skill_id: text-to-sql-agent
evaluation: free
price_usd_full: 8.99
challenge: https://lvlltd.com/api/pay?skill=text-to-sql-agent
outline: https://lvlltd.com/skills/text-to-sql-agent/outline.json
standards: x402, ERC-7857
---

# Free sample — Text To SQL Agent

**Skill ID:** `text-to-sql-agent`  
**Full unlock:** $8.99 USDC via x402 on Base  
**Challenge:** https://lvlltd.com/api/pay?skill=text-to-sql-agent  
**Outline JSON:** https://lvlltd.com/skills/text-to-sql-agent/outline.json

## Summary

Ground NL questions in live schema, generate parameterized read-only SQL, dry-run explain, and return results with query provenance.

## When to use

- Business users ask data questions
- Need safe SQL from English
- Agent analytics over warehouse

## Decision criteria (buy vs skip)

- You need this when: Business users ask data questions
- You get capability: Load schema and permissions
- Budget fits: full unlock is $8.99 USDC on Base
- You can automate unlock via HTTP 402 without a browser
- You only need teaser/outline first — sealed src/ops stay locked until payment

## Outline (preview)

1. Load schema and permissions
2. Ground entities and filters
3. Draft parameterized SQL
4. Dry-run explain
5. Execute read-only
6. Return answer + SQL

## Capabilities (preview)

- Load schema and permissions
- Ground entities and filters
- Draft parameterized SQL
- Dry-run explain
- Execute read-only
- Return answer + SQL

## What you get after payment

- SKILL.md (teaser public)
- agent-install.json (public meta)
- src/index.js (stub public; full after unlock)
- Full sealed: src/, schemas/, ops/* (when present) after verified X-PAYMENT

## Agent buy path (zero human UI)

```
GET  https://lvlltd.com/skills/text-to-sql-agent/outline.json
GET  https://lvlltd.com/api/pay?skill=text-to-sql-agent   → HTTP 402
# transfer maxAmountRequired USDC to payTo on Base
POST https://lvlltd.com/api/pay
  X-PAYMENT: {"txHash":"0x…","skill":"text-to-sql-agent"}
# response.sealed_pack.files = full pack
```

## Sample excerpt

# Text To SQL Agent

**Price:** $8.99 / unlock
**Category:** Data

## Summary

Ground NL questions in live schema, generate parameterized read-only SQL, dry-run explain, and return results with query provenance.

---

---
name: text-to-sql-agent
description: Convert natural language questions into safe read-only SQL with schema grounding and dry-run checks. Use when text to sql agent, NL to SQL, natural language database query, or /text-to-sql-agent.
---

# Text To SQL Agent

Ground NL questions in live schema, generate parameterized read-only SQL, dry-run explain, and return results with query provenance.

## Quick Reference
| Item | Value |
|------|-------|
| Category | Data |
| Unlock | $8.99 USDC (x402 Base) |
| Triggers | text to sql, NL2SQL, natural language query, /text-to-sql-agent |

## When to use
- Business users ask data questions
- Need safe SQL from English
- Agent analytics over warehouse

## Core workflow
1. Ingest question and schema catalog
2. Resolve tables and columns
3. Generate SELECT-only SQL
4. Explain and cost check
5. Run with row limits
6. Present answer with caveats

## Procedures (non-obvious)
### Safety
SELECT/CTE only. No INSERT/UPDATE/DELETE/DDL. Parameterize literals. Row and time limits mandatory.

### Grounding
Refuse if schema cannot support the question; ask for clarification instead of inventing columns.

## Edge cases
- Ambiguous metrics
- Multi-tenant row filters

## Failure modes
- Write queries
- Hallucinated columns
- Unbounded full scans

## Verification
- SQL is read-only
- Columns exist in schema
- Row limit present

## Artifact outputs
- `query.sql`
- `explain.json`
- `answer.md`

## Related skills
- analytics-dashboard-generator
- metric-definition-oracle
- report-narrative-composer

## Super Alignment Contract
- Scalable oversight method: process supervision + human+AI critique before high-blast actions
- Corrigibility guarantees: shutdown, steerability, non-deception; operator may abort mid-run
- Value model: Partnership Agreement + 5 Behavioral Protocols
- Drift detection: flag invented evidence, skipped verification, or revenue-over-truth optimization
- Red-team surface: prompt injection via retrieved content,

…(remainder sealed after x402 unlock)…

