AI Remediation SQL
Bigeye can automatically generate a SQL statement to help you fix the underlying data affected by a data quality issue.
AI Remediation SQL is a Bigeye feature that automatically generates a SQL statement to help you fix the underlying data affected by a data quality issue. When a metric crosses its threshold and opens an Issue, Bigeye can use an AI model to analyze the alerting metric, its debug query, and a preview of the anomalous rows, then produce a ready-to-run SQL statement that directly addresses the rows affected.
Note that this does not address the underlying root cause(s) of the data quality issue. The Suggested resolutions help to address the underlying problem. The remediation SQL is intended to clean up the affected data, which is most effective after the underlying cause has been addressed.
The generated SQL appears on the Resolve tab of any open, metric-backed Issue.
Prerequisites
AI Remediation SQL requires two feature flags to be enabled at the company level:
- AI Issue Overviews — the parent feature that enables all AI-generated content on Issues.
- Remediation SQL (Beta) — the specific flag for AI-generated remediation SQL.
Both can be toggled from Settings → Advanced Settings → AI Issue Overviews. Contact your Bigeye account team or a Bigeye employee with admin access to enable them.
Beta FeatureThis is a Beta feature. It is not enabled by default, and the SQL statements created modify or delete data. Use at your own risk.
How It Works
When you open the Resolve tab of an open, metric-backed Issue:
- Bigeye checks whether AI Remediation SQL is enabled for your workspace.
- If enabled, it calls the AI model with context about the Issue:
- The human-written issue description (if any)
- The SQL query underlying the alerting metric
- The Bigeye debug query that isolates the anomalous rows
- A preview of the rows returned by the debug query
- Your warehouse type (Snowflake, BigQuery, Redshift, etc.)
- The AI generates a single SQL statement (
UPDATEorDELETE) targeting only the rows identified as anomalous. - The generated SQL is displayed in a syntax-highlighted code block with a Copy to clipboard button.
The result is cached after the first call. Subsequent visits to the Resolve tab return the same SQL without re-invoking the AI.
Reading the Generated SQL
The generated SQL always begins with a -- comment explaining what the statement does and why, for example:
-- Set status to 'valid' for rows where status is NULL, which is causing the null_percentage metric to exceed its threshold.
UPDATE orders
SET status = 'valid'
WHERE status IS NULL
AND order_date >= '2026-09-01';Key properties of the generated SQL:
| Property | Description |
|---|---|
| Single statement | Always one complete DML statement — UPDATE, DELETE, or rarely INSERT. No SELECT. |
| WHERE clause from debug query | The filter is derived from the debug query that isolates anomalous rows, not from the metric threshold values. |
| Warehouse-specific syntax | The SQL is written for your specific warehouse type. |
| Explanatory comment | Every statement begins with a comment describing what it fixes and why. |
Running the SQL
Bigeye generates the SQL but does not execute it on your behalf. You must:
- Review the generated SQL carefully — verify the
WHEREclause is correct and the scope matches your expectations. - Test the statement against a staging or development environment if available.
- Copy the SQL using the Copy to clipboard button and run it in your own database client or workflow tooling.
Always Review Before RunningAlways review AI-generated SQL before executing it in production. The AI operates on sampled row previews and metric metadata, which may not capture every edge case in your data.
Availability
AI Remediation SQL is shown only when all of the following are true:
- The AI Issue Overviews feature is enabled.
- The Remediation SQL (Beta) feature is enabled.
- The Issue is metric-backed (created from a metric alert, not a manual issue).
- The Metric has a debug query (most notably, Freshness and Volume do not).
- The Issue is currently open (not resolved or closed).
For closed issues, the Resolve tab is not shown and no remediation SQL is generated.
Frequently Asked Questions
What if no remediation SQL is available?
The Resolve tab displays an informational message: "No remediation SQL available." This can happen if the AI model could not generate a valid DML statement from the available context (for example, if the metric has no associated debug query).
Can I regenerate the SQL?
The SQL is generated once and cached. If you need a different result, contact Bigeye support or a Bigeye administrator to clear the cached value.
Which AI model is used?
Bigeye uses AWS Bedrock with the Anthropic Claude model configured for your workspace.
Is the generated SQL sent anywhere outside of Bigeye?
The metric query, debug query, debug query row preview, and issue description are sent to AWS Bedrock as context for generating the SQL. No data values from your warehouse rows (beyond the debug query preview) are included. Review your organization's AI/data governance policies before enabling this feature.
Updated about 2 hours ago
