DRILLS.ai · Chapter 06
The assessment: choose a reference, don't copy it
The assessment compares a profile with a posting. The model identifies the requirements and links evidence to them. The danger: reworded, or invented, quotes that look as if they came from the CV.
The concept
The model does not copy a quote: it picks the ID of an excerpt from a list imposed by the SchemaThe required shape of a piece of data: its fields, their types, their bounds.See in the glossary →. Code then puts the original passage back in its place.

The sequence
Split, choose, restore
- Split.
source_excerpts()cuts the profile and the posting into windows of at most 600 characters, with a step of 500: two neighbouring windows overlap. - Constrain. The IDs (
profile_0,job_0…) are imposed in the selection schema: the model cannot invent one, or mix the sources. - Restore.
resolve_selection()replaces each chosen ID with the original passage, then checks it is there.
From the repository (code written with the help of ChatGPT and Codex):
def source_excerpts(text: str, prefix: str) -> dict[str, str]:
"""Bounded overlapping slices, each preserved verbatim from the approved input."""
excerpts = {}
for start in range(0, len(text), 500):
excerpt = text[start:start + 600].strip()
if len(excerpt) >= 8:
excerpts[f"{prefix}_{len(excerpts)}"] = excerpt
return excerpts
More rules follow. A not_documented item must not carry a candidate quote. Two requirements with the same name are rejected. On a fixable evidence error, one Corrective retryA single second attempt where the model gets back the error from its first one. Beyond that, a flagged refusal.See in the glossary → is made; after that, the error goes up with a code (candidate_quote:0, for example), never with the CV’s text.
This fixed the reworded quotes, which caused rejections and 502 errors. It does not check that the chosen passage really shows the SkillAn instruction sheet the assistant loads only when the task matches. It's judged by the difference it makes, with evidence.See in the glossary →, or that the CV tells the truth.
Inputs are data
The CV and the posting are treated as data, never as instructions. A posting can contain a sentence that looks like an order. Instructions against Prompt injectionAn order hidden in a text (document, page, tool output, product name) that tries to steer the model. You treat it as data, never as an instruction.See in the glossary → are not enough alone: the model’s limited scope, never running candidate code, Constrained referenceThe model picks the ID of an excerpt from a list imposed by the schema, instead of copying a quote; code then puts back the original passage.See in the glossary → and human review each reduce a different risk.
ConsentThe person's explicit agreement before their data goes to a service. Without it, the request is rejected before any call.See in the glossary → is enforced by the type: consent: Literal[True]. A request without agreement is rejected before any call. Requests to the Responses API go out with store=False, which does not mean “no retention at the provider”.
Residence and right to work
The profile can state a country of residence, a country concerned by the right to work, and a declared status: unknown, yes, restricted, or sponsorship needed.
Living in France is not enough to establish a right to work. Nationality never becomes a factor of the technical score. A declaration documents a declared condition; it is not an administrative check, and it does not settle an internship-agreement or graduation-date requirement.
What I keep
- The less the model writes, the less there is to check: it chooses, code copies.
- The GroundingThe fact that an answer is actually supported by the document it cites.See in the glossary → checked here is textual: the reference exists, but does it prove the skill?
- The correction is capped at one attempt, to explain a failure without an endless loop.
The Python mechanisms
- My Python for AI 101, chapter 3 · Data: card 61, the strict PydanticA Python library that validates data against typed classes; with extra="forbid", an unexpected field is rejected.See in the glossary → model and the
LiteralA Python type that only accepts exact values: Literal["fr", "en"], or Literal[True] for a mandatory agreement.See in the glossary →consent; card 62, the schema built at runtime that only accepts existing IDs. - My Python for AI 101, chapter 5 · Text: card 63, the overlapping windows of
source_excerpts(). - My Python for AI 101, chapter 7 · Errors and guardrails: card 30, an exception (
EvidenceError) caught and turned into a safe answer, with a code and no personal text. - My Python for AI 101, chapter 5 · Text: card 21, strict JSON, to compare with the Pydantic schema of Structured outputAsking the model to answer in a fixed format (JSON), so the interface always shows the same thing, in the same place.See in the glossary →.
The defense question
Why not ask the model to copy a quote freely?
Because it rewords it. An altered quote can no longer be found in the CV, and validation rejects it. By choosing an ID, the model can only point to a passage that exists; code puts back the exact text.
Does valid JSON guarantee a true analysis?
No. The schema guarantees the shape. The meaning of a requirement and the relevance of a piece of evidence still need reviewing.