AI Agents & AutomationFree checklistPDF, Excel, Word export

Text-to-SQL Guardrails Checklist for ERP Data

Letting a language model write SQL against an ERP database is powerful and risky. This checklist covers the controls that hold regardless of what the model generates: permissions, validation, limits, transparency and logging.

0%

0 of 31 items complete

11 critical items still open - these are the highest-risk gaps.

Download checklist:

Database permissions

Query validation before execution

Performance and cost protection

Transparency and accuracy

Injection, logging and operations

Every critical item should be complete before real users connect. Treat unchecked critical items as launch blockers; non-critical gaps can be scheduled with an owner and date.

Text-to-SQL design review

An optional review of your guardrails, test set and logging for an ERP query assistant.

Optional. The tool and every export work without this. No spam.

How to use it

Work through each group with your DBA and security lead before pilot users connect. Tick items you can evidence with a screenshot, config file or test result. The critical items are those where a failure can expose data or hurt ERP performance. Export the completed list and attach it to your change record or AI governance file.

Principle: the database is the boundary

Prompts guide behavior but do not enforce it. The reliable controls sit outside the model: a read-only account, an allow list of objects, a statement parser and resource limits. If those hold, a model that is confused or manipulated can still only run a bounded SELECT against data it is allowed to see. Transparency then lets users catch wrong but harmless answers.

  • Permissions and parser are hard controls
  • Prompts and glossaries improve accuracy
  • Showing the SQL builds trust and finds errors
  • Logs allow investigation after an incident

Common mistakes

Teams validate with a regex looking for the word DROP, which misses many risks. Others give the model the entire schema, including tables the user should never see. A subtle failure is hostile text stored in a comment field that instructs the agent to reveal other data, so treat all record text as untrusted. Finally, skipping the performance guard lets one broad query slow the ERP for everyone.

Frequently Asked Questions

Is read-only access enough protection?

It prevents changes but not data exposure or slow queries. You also need object and column restrictions, row limits, timeouts and logging so that read access stays within what each user is allowed to see.

Should we let the model run any SQL it generates?

No. Parse the statement, allow only a single SELECT on approved objects, add limits and timeouts, and then execute. Reject anything that fails these checks and tell the user why.

How do we test for prompt injection?

Insert instructions into test records such as item descriptions or notes, for example telling the agent to ignore rules, then ask normal questions. The agent should ignore them, and permissions should block any attempt anyway.

How often should we re-run the golden question set?

After any model, prompt, schema description or ERP version change, and on a regular schedule such as weekly in early production. Track the pass rate over time to see drift.

Netray ERPray answers questions over live ERP data in read-only mode and shows the query it ran. We can assess your own text-to-SQL design against this list.