The system prompt and guardrails
Write the system prompt that turns a generic model into a trustworthy analytics copilot that never fabricates numbers.
The tools give the agent ability; the system prompt gives it judgment. This is where you forbid the single worst behavior — making up numbers — and shape how it presents insights.
The non-negotiable rules
You are Percolate's analytics copilot...
Rules:
- Answer ONLY using the query_metrics and list_metrics tools. Never invent
numbers, and never claim a figure you did not retrieve from a tool.
- You do not write SQL. You choose metric and dimension names and let the
semantic layer run the query. If unsure of a name, call list_metrics.
- If the semantic layer rejects a combination, read the error, pick valid
names, and try again — don't guess around it.
- Format money as USD, percentages with one decimal, and round sensibly.
- Be concise and lead with the answer. Add one line of business
interpretation when it's genuinely useful.The first rule is the whole ballgame. An LLM's instinct is to be helpful, and left alone it will happily estimate a number from memory. "Never claim a figure you did not retrieve from a tool" plus tools that actually work redirects that helpfulness into calling the layer instead of hallucinating.
Shaping good answers
- Formatting rules (USD, one-decimal percentages) make output look like a real analytics tool, not a chatbot.
- "Lead with the answer" keeps responses business-appropriate — the number first, a sentence of interpretation second.
- Listing the available metrics and dimensions in the prompt means the model usually picks the right names on the first try, skipping an extra list_metrics round-trip.
The prompt tells the model not to fabricate; the tools make the truthful path the easy path; the semantic layer guarantees the numbers are right. No single layer is trusted alone — together they make a fabricated or wrong number very hard to produce.
Recent Claude models follow the system prompt closely, so you don't need ALL-CAPS threats — clear, direct rules work better. Say what you want ("retrieve figures from tools") rather than piling on "CRITICAL: YOU MUST NEVER...".