A ChatGPT database query should not jump straight from prompt to production SQL.
That shortcut works in demos.
It fails when:
- the question is ambiguous
- the schema is messy
- the tenant scope is missing
- the result is too broad
- the answer affects a business decision
A safer workflow has a few steps:
- Provide scoped schema context.
- Use read-only roles by default.
- Generate a query plan before execution.
- Ask for clarification when scope is missing.
- Return a result contract, not just rows.
- Preserve provenance into the final answer.
- Audit the full chain.
The final answer should know where the number came from, how fresh it is, what filters were used, and whether the result was truncated.
Longer version: ChatGPT database query workflows
Natural language is the interface. Governance is the system.
Top comments (0)