[FEATURE]: Pre-execution cost firewall for warehouse queries
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- google-cloud, sql, typescript
- Domain
- cloud, data-engineering, databases
Research direction
Start at the sql_execute entry point and review the existing governance configuration and sql_optimize tool. Check BigQuery's dry-run estimation behavior and determine how the proposed budget fields and confirmation flow should fit the default-off requirement; done means over-budget queries are guarded while unsupported warehouses remain unaffected.
Written by the indexing model from the issue text.
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
The agent can run an analytical query that scans terabytes. e.g. SELECT * FROM events and incur a large warehouse bill before anyone realizes. Today there is no pre-execution cost estimate or budget guardrail in sql_execute. The FinOps tooling that exists is all historical (analyzing spend after the fact), not preventive.
Proposed enhancement
An opt-in cost firewall that estimates a query's scan cost before it runs and asks for confirmation when it exceeds a configured budget:
- Estimate via warehouse-native dry-run where available (BigQuery
dryRunreturns exact bytes processed for free; no execution, no cost). - New
governanceconfig:max_query_cost_usd,max_bytes_scanned,cost_per_tib_usd. - When a query is over budget, prompt the user (with a hint to try
sql_optimizefirst). - Disabled by default; warehouses without estimation support are unaffected (the guard fails open).
Benefits
Cost control is core to the data-engineering workflow. A pre-flight guardrail turns a surprise $40 query into approve, or optimize first without changing behavior for anyone who doesn't set a budget.
Notes
I have an implementation ready (BigQuery estimator + the default-off guard framework) and can open a PR referencing this issue. The estimator is designed to extend to other warehouses (Snowflake via EXPLAIN, etc.).
- Dominant language
- TypeScript
- Stars
- 813
- Forks
- 134
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 62
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AltimateAI/altimate-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AltimateAI/altimate-code#1323 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
AltimateAI/altimate-code#1288 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
AltimateAI/altimate-code#1284 ·
-
Difficulty 2/5 Under an hour Newbie friendliness 72/100
AltimateAI/altimate-code#1283 ·
All issues in AltimateAI/altimate-code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·