Build the safeguards
Eight explained steps, a source example and a checkpoint at each decision.
Read the tutorialPython / FastAPI / AI evaluation
Choose a pattern by the failure it addresses. Several safeguards can be necessary at once.
| Approach | Useful when | Decision or limitation |
|---|---|---|
| Prompt instructions | Describe desired model behavior | Do not enforce a schema or guarantee source support |
| Structured-output validation | Enforce shape and field constraints | A well-formed claim can still be false |
| Citation validation | Check source identity and applicability | Citation presence alone does not establish entailment |
| Narrow deterministic policy check | Validate a bounded structured domain | Does not generalize to arbitrary prose |
| Regression fixtures | Reproduce known failures cheaply | Do not estimate performance on a representative population |
| Live provider evaluation | Measure actual model behavior and usage | Needs controlled cases, recorded configuration and measured cost |
| Environment | What you can do | Scope |
|---|---|---|
| This browser lab | Click, compare, reset and inspect exact source | Actual Python runs in the open-source Pyodide runtime. Candidate answers and documents are deterministic fixtures; no live model is called. The exact policy validator is intentionally narrow and does not establish general factual accuracy or comprehensive prompt-injection resistance. |
| Independent download | Run the same prebuilt lab with Python’s local server | No package installation or automatic external calls needed for the prebuilt preview |
| Native exercise | Run language tests and the included local adapter or script | Requires the documented local toolchain; does not provision a cloud service |
The safeguarded evidence run matches all five expected fixture decisions. The slow run limits active tasks to two and cancels all five before returning. Active-at-finish is zero. These labels are regression cases, not an accuracy estimate.
Begin with an observable outcome, inspect the decisions that produced it, then test a repair. The companion tutorial explains the mechanism; the how-to guide takes the same source into an independent environment.
Ascertain describes Python/FastAPI engineering for its healthcare AI platform; this evaluation curriculum is a proposed extension of that work.
Eight explained steps, a source example and a checkpoint at each decision.
Read the tutorialUnderstand where each pattern helps and which tradeoffs remain.
Compare approachesDownload the independent environment, run the native checks and try a specific extension.
Open the how-to guide