Validation asks whether data or an AI-generated result is accurate, relevant, plausible, and fit for its intended decision. Treat it like a buddy system: inspect the work, compare it with expectations, and investigate anything that looks unusual rather than accepting it automatically. section 2.5.4 section 8.2.4
Validate data with a repeatable sequence:
- Define expected values, types, ranges, relationships, and other constraints before analysis. section 2.5.4
- Check records against those expectations and identify dates, values, or relationships that fall outside them. section 2.5.4
- Investigate deviations instead of automatically deleting them: they may indicate collection errors or important business events. section 2.5.4
- Check consistency across tables and address violations by correcting values, dropping rows, or applying another justified remedy. section 2.5.4
Testing AI-generated pricing code
Suppose an AI assistant generates code for pricing financial products. An expert need not rewrite every solution in parallel; instead, the expert can prepare normal and edge-case test cases, inspect the code, and verify that its behavior passes practical sanity checks. Compare results with domain knowledge, external information, or constraints defined upfront. Apply the same testing and code-review discipline to generated code as to manually written code before using it in production. section 8.2.4
Listing 2.2 Identifying foreign key violations
foreign_key_violations =
df_orders[~df_orders['order_id'].isin(df_order_payments['order_id'])]
if not foreign_key_violations.empty:
print("Foreign key violations found:")
print(foreign_key_violations)
# Handle violations (e.g., drop rows or correct the foreign key values)
Use the foreign-key violation listing to inspect orders whose identifiers do not appear in the payments table, then decide how to handle the discrepancies. section 2.5.4
Validation also includes transparent reporting. State whether checks were manual or automated, how often they were performed, which methods were used, and where people adjusted or overrode model outputs. Make limitations and uncertainty visible to decision-makers. section 8.4.4





























