Works with the AI Agents you already use
Text-to-SQL Data Agent (BigQuery-first)
Build a "chat with your data" agent that never runs dangerous queries, never surprises you with a warehouse bill, and never states a wrong number with confidence.
$19
Text-to-SQL Data Agent (BigQuery-first)
Example session with this skill installed
Build the query tool for our 'ask the sales data' agent on BigQuery. Business users will ask things like 'net revenue by region last month'. The sales dataset is 40 TB. Write the tool implementation in query_tool.py and the agent instructions in instructions.md.
- Read your context and instructions
- Compiled the text-to-sql data agent
query_tool.py: run_query(sql, purpose) → sql_guard (single SELECT, allow-list proj.sales.* and proj.ref.*, LIMIT ≤ 1000, warning on unfiltered order_lines) → dry run (refuse above 10 GiB with "add a filter on order_date or use the daily mart") → execute with maximum_bytes_billed=10 GiB, labels app=sql-agent, 120 s timeout → rows + bytes + truncated flag. instructions.md: look up net_revenue in the semantic layer before computing; always filter order_date; exclude test stores; state the period and assumptions; show the SQL and data freshness; never present a truncated result as complete.
Connects securely to your tools. The creator never sees your data.
About this skill
The hard part of a data agent is not generating SQL — strong models write good SQL. It is knowing what the business means (which table, which metric definition, which filters) and never returning a confident wrong number. This skill makes safety and cost controls structural, not prompt-based.
What your agent builds with it
- Semantic layer (YAML template included): curated tables with grain, partition, freshness and pitfalls; canonical metric SQL; safe vs fan-out joins; verified example queries; business calendar.
- Schema tools instead of pasting the whole schema:
search_schema,describe_table,get_metric_definition,run_query. - Layered safety and cost control
- Read-only service account (the real boundary).
sql_guard.py: exactly one read-only statement, no DML/DDL/EXPORT/scripting or denied functions, table allow-list (CTEs handled), LIMIT enforced or lowered, warnings forSELECT *and unfiltered large tables.bq_safe_query.py: dry run to estimate bytes and refuse with an actionable message, then execution withmaximum_bytes_billed, job labels and a timeout.- Per-user quotas and PII-free curated views.
- Agent behaviour rules: resolve ambiguity or state assumptions, always use the metric definition, filter on partitions, sanity-check totals and fan-out duplicates, show the SQL and data freshness, never present truncated results as complete.
- Evaluation: execution-accuracy golden set (not exact SQL match), with ambiguous and unanswerable questions.
BigQuery-first; the guard works for any sqlglot dialect (Snowflake, Postgres, …).
Part of the Production AI Agents series. Start free with Agent Architecture; pair with Agent Evals (statistics for your accuracy report) and Agent Guardrails.
Does not provide a hosted service or UI. The cost-capped runner is BigQuery-specific; for other warehouses you reuse the guard and adapt the execution layer. Generic tool design, eval statistics and policy gating are covered by companion skills.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
Requires
Permissions
Allowed Hosts
File Scopes
The SQL guard runs locally with no network access. BigQuery is only contacted with your own credentials when you run the query helper.