By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Plain question answering has one input and one output. RAG adds a retrieval step that can fail on its own. Agents add actions that cannot be taken back. Both need their own risk checklist before you write tests.
| Risk | What it looks like | Test that catches it |
|---|---|---|
| R1 Wrong chunk ranks first | UK question answered with US policy | Assert the expected document ID is in the top-k for a labelled question set |
| R2 Chunk boundary splits a rule | Exception clause in the next chunk is lost | Golden answers require the full rule; check answer completeness against the source |
| R3 Context overflow drops chunks | Right document retrieved, then truncated out of the prompt | Log prompt length and assert retrieval fits; test with worst-case multi-doc questions |
| R4 Unsupported claims | Answer adds 'you will get a full refund' from general knowledge | Faithfulness / groundedness scoring against the retrieved context |
| R5 Stale index | Retired 30-day policy quoted after being changed to 14 days | Index freshness check: a known-changed document must surface its new text |
| Risk | What it looks like | Test that catches it |
|---|---|---|
| A1 Loop | Calls search_orders then get_order then search_orders forever | Cap iterations; assert the trace terminates within N steps |
| A2 Wrong arguments | Calls refund(order_id='4521') for a different customer's order | Assert tool arguments equal expected values, including the customer scope |
| A3 Unauthorised action | Issues a refund when policy says only a human may | Assert no forbidden tool was called for high-risk intents |
| A4 False success | Says 'refund processed' without ever calling the tool | Assert claimed actions appear in the trace |
| A5 Cost runaway | 20 tool calls per message, tokens explode | Assert tool-call count and token budget per turn |
Notice that every agent test asserts on the trace — the ordered list of tool calls and their arguments — not just the final sentence. Words can lie; the trace cannot.
## Nova risk register (excerpt)
| ID | Risk | L | I | Score | Control |
|----|-----------------------------|---|---|-------|--------------------------------|
| R1 | UK query served US policy | H | H | 9 | Retrieval top-k assertion |
| R4 | Invented refund promise | M | C | 8 | Faithfulness + rule check |
| R5 | Stale policy in index | M | H | 6 | Freshness probe, nightly |
| A2 | Refund on wrong order | L | C | 7 | Argument assertion + guardrail |
| A5 | Tool-call loop | M | M | 4 | Iteration cap, trace length |Key takeaways
RAG adds retrieval risks: wrong chunk, split rule, overflow, unsupported claim, stale index.
Agents add action risks: loops, wrong arguments, unauthorised actions, false success, runaway cost.
Agent tests assert on the tool-call trace, not only the final text.
Every risk needs detect, prevent or recover — or an explicit decision to accept it.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.