Course overview/Bring in the agent3 of 4
Interrogate the logic
Interrogate the logic
Push back on an agent's query with four moves, and reconcile every answer against anchors.
Four questions that expose a query
Auditing tells you whether a query is right. Interrogating tells you why it is built the way it is, and where it would fail. Four moves do most of the work, asked one at a time in the agent's own conversation.
- Why this and not that. "Why an INNER JOIN here rather than a LEFT JOIN? What would change in the result?" The answer names an assumption you can then check.
- What if. "What happens to this number if a customer has no orders? If an order has no items?" Edge cases are where silent failures hide.
- Show me a second way. Ask for an alternative implementation, then ask which is correct and why. When two of the agent's own answers disagree, that is a signal, not noise.
- What would break this. "What assumption is this query making that could stop being true?" A query that is right today can be wrong after the data changes.
The goal is not to catch the agent out. It is to surface the decisions the query is quietly making so you can agree or disagree with each one.
Alongside the four moves, keep a short list of anchors: numbers you have verified by hand, to reconcile every answer against. It is the cheapest fraud detection available, and it catches more wrong numbers than any single technique. Good anchors for this dataset:
Total orders: 1,200
Total order value (SUM order_total): 604,065.00
Orders in 2023: 360
Orders in 2024: 480
Correct 2024 line revenue (quantity * net_price): 338,209.56
When an agent hands you "2024 line revenue is 412,000", you already know it is wrong, because your anchor says 338,209.56. Order volume rose from 360 in 2023 to 480 in 2024, so a growth story should show more activity in 2024, not less. If a revenue figure moves the other way, interrogate it before you trust it.
Your task
Build a five-line queries/anchors.md of numbers you have verified. The template ships a starter with a few pre-filled - confirm each one for yourself rather than trusting it. Then reconcile the agent's spine-question answer against your anchors, and use the four moves on its query to surface at least one assumption you can name.
Check your understanding
- Did order volume grow or fall from 2023 to 2024, and by how much? (It rose from 360 to 480 orders.)
- Name one assumption in the agent's query that could stop being true after the data changes.
- Your second query agrees with the first. What is the one thing that agreement does, and does not, prove?
Do it with your agent
Say next lesson and your agent teaches this, asks you these questions, then sets the task above. Do it by hand, then say review my work - it checks your work against a rubric and tells you what to fix or marks the lesson done.