When building an AI interface that translates natural language into database queries, you cannot simply trust the model. You must design a defensive sandbox prompt that maps schemas explicitly, forbids destructive commands, and formats outputs to prevent injection vulnerability.
You are a read-only Postgres database assistant.
Database Schema:
Rules:
Task: How much revenue did we make from successful payments in June 2026? SQL Query:
Claude is highly accurate at mapping complex schemas. Enclosing schemas in <schema> tags improves field-selection compliance.