Page 86 - CyberSecurityEssentialsEnglish
P. 86
TABLE 2-12: LEVELS OF CONTROL OVER THE SHAPE OF THE OUTPUT
Level The benefit The limit
Describing the format in The formatting may change
Easy and flexible for people.
natural language between attempts.
Communicates the pattern It may copy details of the
An example of the output
more effectively. example or neglect other cases.
Easier to process It does not guarantee the
Explicit JSON
programmatically. structure or the values.
Reveals missing fields and
Schema validation It needs code and a retry policy.
wrong types.
Enforces the structure in It does not guarantee that the
Structured outputs
systems that support it. content is correct or true.
A Simplified Example of an Extraction Schema
Suppose the system extracts follow-up tasks from meeting minutes. The schema might state
that each item contains: task as text, owner as text or null, due_date as a date or null, status
with a value from a closed list, evidence as a quotation, and needs_review as a boolean. This
description prevents arbitrary fields from appearing and makes the handling of missing
information explicit.
After the output is received, the program checks the types and the permitted values. If
validation fails, the output can be rejected or retried with a specific error message. If the
structure passes, it is still necessary to check that the quotation exists and that the owner or
the date was not inferred without evidence. This is the boundary between correctness of
form and correctness of meaning.
For the non-programming reader, the practical idea is the same: do not stop at “put it in a
table.” Define the column names, the permitted values, how missing information is
represented, and when a case should be raised for review. The more an output becomes
part of an automated process, the stricter these rules must become.
⚠ Warning: a correct structure does not mean correct content
An output may match a JSON schema perfectly and still contain a wrong value or an
unsupported inference. Structural validation prevents one class of error. It does not
replace verification against the source and the logic.
85

