An agent receives JSON from a customs tariff tool. Occasionally fields are missing or units are wrong, which previously caused incorrect duty calculations. What should you implement before the agent commits downstream actions?
Select an answer to reveal the explanation.
Short Explanation
Tool output is untrusted data until proven otherwise. Schema-validate it, run business quality checks (required fields, units, consistency), and only then allow duty calculation tools to fire. Option C. Blind trust (A) repeats the incident. Guessing numbers (B) invents financial facts. Skipping validation for demos (D) ships latent production defects.
Full Explanation
Implementing tool result validation and quality checks is a core tool-ecosystem skill. Option C enforces structural and semantic checks before side effects.
Option A ignores real-world partial failures and upstream bugs.
Option B introduces hallucination into numeric pipelines.
Option D trades correctness for demo optics.
Combine JSON Schema/Pydantic-style validation with domain rules (e.g., weight > 0, currency codes ISO, duty rate bounds).
Exam tip: Validate tool results the same way you validate user input — especially before money or compliance actions.