<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Systems Around AI]]></title><description><![CDATA[Systems Around AI]]></description><link>https://systems-around-ai.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a943e0ed584895148cfb3db/c56ad311-0806-4508-8355-6cd94a0d2b62.png</url><title>Systems Around AI</title><link>https://systems-around-ai.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 09:17:28 GMT</lastBuildDate><atom:link href="https://systems-around-ai.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Structured Output Is Not Trusted Output]]></title><description><![CDATA[A student writes a correct sentence. An AI tutor tells them to fix it.
The feedback looks complete. It names the skill being assessed, gives a result and quotes the student's own words. The software a]]></description><link>https://systems-around-ai.hashnode.dev/structured-output-is-not-trusted-output</link><guid isPermaLink="true">https://systems-around-ai.hashnode.dev/structured-output-is-not-trusted-output</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[software architecture]]></category><category><![CDATA[System Design]]></category><category><![CDATA[education]]></category><dc:creator><![CDATA[Radiance Obi]]></dc:creator><pubDate>Sat, 05 Sep 2026 15:33:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/5203223c-4874-40ec-a9e7-39c1aa27e10e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A student writes a correct sentence. An AI tutor tells them to fix it.</p>
<p>The feedback looks complete. It names the skill being assessed, gives a result and quotes the student's own words. The software accepts the response without a problem.</p>
<p>But the feedback is wrong.</p>
<p>This is the gap between an answer software can read and an answer people can rely on. <strong>Structured output</strong> means the AI responds in an agreed format, with information in expected places. That makes the response easier to process. It does not make its conclusions correct.</p>
<p>We can see the problem in a fictional English practice tool. Everything in the example is invented, not an account of a real product or incident. The lesson applies anywhere software uses AI responses to make decisions about people's work.</p>
<h2>The student got it right. The feedback did not.</h2>
<p>The exercise asks:</p>
<blockquote>
<p>Write one sentence about two things you did yesterday. Use the past simple.</p>
</blockquote>
<p>We are checking one thing: whether the student uses the past simple correctly for two completed actions yesterday. This is the assessment criterion, or the rule the answer is judged against.</p>
<p>The student writes:</p>
<blockquote>
<p>Yesterday I went to the market and bought some fruit.</p>
</blockquote>
<p>Now imagine the model returns this assessment:</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Proposed value</th>
</tr>
</thead>
<tbody><tr>
<td>Criterion</td>
<td>Use past simple for two completed actions</td>
</tr>
<tr>
<td>Verdict</td>
<td>Not demonstrated</td>
</tr>
<tr>
<td>Evidence</td>
<td>“went to the market and bought some fruit”</td>
</tr>
<tr>
<td>Feedback</td>
<td>“Use past tense verbs to describe what you did yesterday.”</td>
</tr>
</tbody></table>
<p>Software can check that “Not demonstrated” is an allowed result. It can also check that the quoted words really appear in the answer. Both checks pass. Neither tells us whether the student actually made a mistake.</p>
<p>The sentence meets our rule. “Went” is the past simple of “go”; “bought” is the past simple of “buy.” These are irregular forms, so they do not end in “-ed.” The <a href="https://learnenglish.britishcouncil.org/free-resources/grammar/english-grammar-reference/irregular-verbs">British Council's irregular verb reference</a> lists both. The feedback asks the learner to fix something that is already correct.</p>
<p>Finding the student's words is one job. Deciding what those words show is another.</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/d2f77889-23bd-469c-9c77-c7f269971b0e.png" alt="The learner uses went and bought to describe yesterday. The fictional model quotes those words but says past tense is not demonstrated. A real quote does not establish a correct judgment." /></p>
<p><em>The format is valid and the quote is real. The conclusion is still wrong.</em></p>
<h2>A completed form is not a correct answer</h2>
<p>A structured response works much like a completed form. Each piece of information has a place: the result goes here, the quote goes there, and the feedback goes below it.</p>
<p>The rules for that form are called a <strong>schema</strong>. They can require certain fields, limit the available choices and set rules for numbers. Some schemas can also make one requirement depend on another. But describing a field as “correct feedback” does not give the software a way to check its truth. See the <a href="https://json-schema.org/draft/2020-12/json-schema-validation">JSON Schema validation specification</a>.</p>
<p>Our tool might allow three results: demonstrated, not demonstrated and uncertain. This stops the model returning an unexpected label that the software cannot handle. It does not tell us which of the three results the student deserves.</p>
<p>Format checks are useful. We just need to be clear about what they check.</p>
<p>OpenAI makes the same distinction in its <a href="https://openai.com/index/introducing-structured-outputs-in-the-api/">Structured Outputs announcement</a>: a response can follow the required structure and still contain mistakes.</p>
<p>Once the format passes, we still have three questions: did the feedback use the right answer, is its judgment justified, and what should it be allowed to change?</p>
<h2>First, check that it used the right answer</h2>
<p>Imagine the student first writes “Yesterday I go to the market.” While the AI is checking it, they change “go” to “went.” Feedback about the first version could now flag a mistake the student has already fixed.</p>
<p>The application should keep a copy of the answer and assessment rules sent for checking. A set of assessment rules is often called a rubric. If either the answer or the rules change, the tool should check again or clearly say that the feedback refers to an earlier version.</p>
<p>The application needs its own record of this link. Asking the AI to say which version it checked is not enough on its own.</p>
<p>Then check the quotation. Does it come from that answer, and does it preserve the student's wording?</p>
<p>One approach asks the AI to identify where a quote starts and ends. The application then takes the words directly from its saved copy. This helps ensure the displayed quote contains the student's actual words, rather than an invented version.</p>
<p>This follows the broader principle of checking AI-generated references against their sources, recommended in <a href="https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf">NIST's Generative AI Profile, action MS-2.5-003</a>. Here, the source is the student's answer.</p>
<p>We now know where the words came from. We still do not know whether they support the feedback.</p>
<h2>Next, check whether the judgment makes sense</h2>
<p>In our original example, the AI quotes “went” and “bought” but says the student has not used the past simple. We need to compare its conclusion with the language in the answer and the task we set. Engineers sometimes call this <strong>semantic validation</strong>: checking whether the meaning makes sense, not just whether the format is allowed.</p>
<p>Some checks have clear rules. We can reject feedback about a skill the exercise did not ask us to assess. We can stop feedback about an old answer from appearing as feedback on a new one.</p>
<p>Others need more judgment. Are the verbs used correctly in this sentence? Did the learner answer the question? Is the feedback pointing out an error or just suggesting a different way to write?</p>
<p>A reliable verb list can confirm that “went” and “bought” are past simple forms. It cannot tell us that every sentence containing them is correct. We still have to read them in context.</p>
<p>Adding a label such as “evidence verified” does not settle this. Verified how, and by what check? If the AI adds that label to its own response, it is making another claim, not proving the first one.</p>
<p>For this tool, I would keep the rule, the relevant text and the reason for each judgment together. That makes the judgment easier to review. A convincing explanation can still be wrong.</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/7531187b-273d-481d-a860-03bcd657570e.png" alt="Format checks examine permitted fields. Source checks examine the original answer. Judgment checks examine evidence against the task. Permission checks govern the action." /></p>
<p><em>Passing one check does not answer the next question.</em></p>
<p>Context matters especially when the feedback says something is missing. Quoting only “to the market” does not prove that the answer has no past tense verbs. To make that claim, the tool must examine the full answer, not just the selected words.</p>
<h2>A rewrite is not necessarily a correction</h2>
<p>Suppose the tool suggests replacing “bought some fruit” with “purchased some fruit.” Both fit our past tense exercise. The change may be useful in a vocabulary lesson, but presenting it as a required grammar correction would misrepresent the learner's answer.</p>
<p>The learner needs to know whether the tool is correcting a mistake, offering an optional alternative or assessing a particular skill. More polished wording does not mean the original was wrong.</p>
<p>Research reflects this distinction. Davis and colleagues tested ten language models on four sets of English correction tasks. Results differed depending on whether the tests rewarded small corrections or allowed broader changes to improve fluency. How we define a good edit matters when we measure the tool. See <a href="https://aclanthology.org/2024.findings-acl.711/">their ACL 2024 study</a>.</p>
<h2>A small code example: what this check can tell us</h2>
<p>This optional JavaScript example checks three things: the answer and rules have the expected versions, the criterion is known, and the quotation matches the saved answer. It does not decide whether the feedback is correct. If you do not read code, skip to “The important part is the result” below.</p>
<pre><code class="language-javascript">export function checkEvidence(proposal, context) {
  if (proposal.answerRevision !== context.answerRevision ||
      proposal.rubricRevision !== context.rubricRevision) {
    return { kind: "context_mismatch" };
  }
  if (!context.criteria.includes(proposal.criterion)) {
    return { kind: "unknown_criterion" };
  }
  const { start, end, quote } = proposal.evidence;
  if (!Number.isInteger(start) || !Number.isInteger(end) ||
      start &lt; 0 || end &lt;= start || end &gt; context.answer.length) {
    return { kind: "invalid_span" };
  }
  if (context.answer.slice(start, end) !== quote) {
    return { kind: "quote_mismatch" };
  }
  return { kind: "source_verified", judgment: "unchecked" };
}
</code></pre>
<p>The important part is the result: <strong>source verified, judgment unchecked</strong>. It means “these are the student's words,” not “this feedback is correct.”</p>
<p>The accompanying test deliberately sends our wrong judgment through this check. It passes, as it should. The quote is real even though the conclusion is wrong.</p>
<p>That is a useful thing to test. The result's name should say exactly what was checked, so another developer does not later mistake it for approval of the whole response.</p>
<p>For implementation: the function assumes a format check has already confirmed the required fields and data types. The application supplies its own saved request details. Quote positions use JavaScript string indices, so both sides must use the same counting convention. This is one limited check, not a complete feedback system.</p>
<h2>Can another AI check the first one?</h2>
<p>A second AI model could compare the feedback with the task, full answer and assessment rules. It may catch a mistake the first model missed. A teacher could review cases that remain uncertain or could affect an important decision.</p>
<p>Neither guarantees a correct result. Two models can agree and both be wrong. A human can also miss an error. I would show reviewers the student's work before asking them to consider the AI's explanation, so that explanation is not their only starting point.</p>
<p>The reviewer should see the original task, full answer and assessment rule together. The AI's judgment should be clearly marked as a suggestion that can be corrected. Sending something “for review” only helps if someone has the time and authority to act on it.</p>
<p>There is useful research on combining systems for language correction. Park and colleagues studied unnecessary edits and developed a method that follows an AI model's edits with a smaller, specially trained correction model. Their results concern performance on correction tests, not whether the feedback helps students learn. See <a href="https://aclanthology.org/2025.emnlp-main.1431/">their EMNLP 2025 paper</a>.</p>
<p>The lesson is not to avoid automation. It is to know what each added check contributes and where it can still fail.</p>
<h2>Then decide what the feedback may change</h2>
<p>Suppose the judgment is well supported. Should it produce a practice hint, update a grade or mark a skill as completed? Those are different decisions.</p>
<p>A tool could allow a tentative hint but require a teacher's review before changing a recorded grade. The people designing the product need to set those rules. A correctly formatted AI response should not decide its own authority.</p>
<p>This does not make practice feedback harmless. A wrong hint can still confuse a learner, so there should be a clear way to question or correct it. Being suitable for one use does not automatically make the same feedback suitable for another.</p>
<p>UNESCO's guidance calls for checking whether generative AI is educationally appropriate and ethically sound. That goes beyond making its output readable by software. See <a href="https://www.unesco.org/en/articles/guidance-generative-ai-education-and-research">Guidance for generative AI in education and research</a>.</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/4ec805df-6ba2-428c-807b-df80c31902c5.png" alt="A proposed assessment may be used for a provisional practice hint with a correction path. In this fictional policy, a recorded grade requires review. Each use needs separate permission." /></p>
<p><em>Permission to offer a hint is not permission to change a grade.</em></p>
<h2>Test for wrong feedback, not just broken responses</h2>
<p>Counting how often the AI fills out the form correctly will not tell us how often it helps or misleads a student.</p>
<p>Tests should cover different ways the process can go wrong: a missing field, a quote from an old answer, or a real quote followed by a wrong conclusion. They should also check that even correct feedback cannot change a grade without the required review.</p>
<p>For the language exercise, include correct forms such as “went,” regular forms such as “walked,” errors such as “buyed,” and sentences that mix correct and incorrect forms. Include valid alternative wording and rewrites that change the student's meaning. Language educators should review the expected answers. Where they disagree, record that disagreement instead of assuming the model is wrong.</p>
<p>Correct answers matter just as much as incorrect ones. A tool may catch genuine mistakes while also telling students to change good answers. Keep optional vocabulary suggestions separate from actual corrections when measuring its performance.</p>
<p>For this fictional tool, I would track:</p>
<ul>
<li>Wrong answers accepted as correct.</li>
<li>Correct answers marked as wrong.</li>
<li>Explanations that do not fit the answer or task.</li>
<li>How often the tool needs a reviewer.</li>
</ul>
<p>I would also check which cases the tool handles on its own. Good results mean less if it sends almost every difficult case to a teacher. These are proposed tests, not results measured from a real product.</p>
<p>Repeat these checks when the model, instructions, assessment rules or intended use changes. Getting the correction right is important. Finding out whether the feedback actually helps students learn requires a separate study of learning outcomes.</p>
<h2>What to ask before trusting the next response</h2>
<p>Before using an AI response, ask:</p>
<ol>
<li>Did it follow the required format?</li>
<li>Did it assess the right version of the answer, using the right rules?</li>
<li>Are the quoted words really there?</li>
<li>Do those words, in context, justify the conclusion?</li>
<li>What may this result change, and who can correct it?</li>
<li>Have we tested examples where each of these checks could fail?</li>
</ol>
<p>Our fictional student used the right verbs. The AI quoted them accurately and still reached the wrong conclusion. A format check and a quote check could not catch that mistake because neither was designed to judge the answer.</p>
<p>That is the broader lesson: a response can be easy for software to read and still be wrong about what it has read. Before letting it guide a person or change a record, we need checks that match the decision we are asking it to support.</p>
]]></content:encoded></item><item><title><![CDATA[The Model Is Not the System]]></title><description><![CDATA[A model receives a support case and returns a structured response like this:
{
  "action": "billing_queue",
  "confidence": 0.94,
  "evidence": ["The case includes an invoice number and a duplicate ch]]></description><link>https://systems-around-ai.hashnode.dev/the-model-is-not-the-system</link><guid isPermaLink="true">https://systems-around-ai.hashnode.dev/the-model-is-not-the-system</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[software architecture]]></category><category><![CDATA[Reliability Engineering]]></category><category><![CDATA[System Design]]></category><category><![CDATA[AI Safety]]></category><dc:creator><![CDATA[Radiance Obi]]></dc:creator><pubDate>Sun, 30 Aug 2026 16:47:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/8bbbdba6-5a85-453e-9d1b-a18f30989a63.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A model receives a support case and returns a structured response like this:</p>
<pre><code class="language-json">{
  "action": "billing_queue",
  "confidence": 0.94,
  "evidence": ["The case includes an invoice number and a duplicate charge."]
}
</code></pre>
<p>The request succeeded. The response uses valid JSON, a standard data format. It matches the schema. The confidence is high.</p>
<p>None of that proves the case should be routed automatically.</p>
<p>The caller might not be authorized to trigger that action. Automatic routing might be disabled for the account. The cited evidence might not exist in the original case. The action might be unavailable during an incident. The model might have been given stale context. Even the meaning of <code>0.94</code> may be less stable than the number suggests.</p>
<p>This is the architectural mistake behind many fragile AI features: treating a successful model response as a completed product decision.</p>
<p>The model is not the system. It is one probabilistic component inside the system.</p>
<p>Here, <strong>probabilistic</strong> means the model can produce an uncertain or different answer when a request looks similar. <strong>Deterministic</strong> means the surrounding software follows explicit rules and produces the same decision from the same checked facts.</p>
<p>I find it useful to design a <strong>deterministic shell</strong> around that component. The model interprets messy material and proposes a result. Conventional software checks its format, evidence and business rules before changing a real record.</p>
<p>In plain terms: the model suggests, the application checks, business rules permit or block, and storage records. Uncertainty and system failure leave through separate paths.</p>
<p>For teams building AI-backed workflows, the useful question is not “How much should we trust the model?” It is “Where does permission to act live?”</p>
<p>The shell does not make the model deterministic. It gives uncertainty somewhere controlled to go.</p>
<h2>A valid format is not permission to act (schema and authorization)</h2>
<p>A schema is a list of rules for a response: which fields must exist, what each field may contain and which values are allowed.</p>
<p>Structured-output features are valuable because they make a model follow those rules. They replace a large class of brittle parsing code with a declared contract. For example, OpenAI's Structured Outputs can constrain a response to a supplied JSON Schema. That gives an application a stronger guarantee about the shape of a response than free-form text provides. <a href="https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create">The API documentation describes that guarantee as schema adherence</a>.</p>
<p>That guarantee is about format. In technical terms, <a href="https://json-schema.org/draft/2020-12/json-schema-validation">the JSON Schema validation specification defines assertions about the structure of instance data</a>. It does not know the application's permission rules or evidence standards.</p>
<p>But a schema can tell us only that a field called <code>action</code> contains one of the allowed strings. It cannot determine whether that action is justified in this particular business context.</p>
<p>Consider these three questions:</p>
<ol>
<li><strong>Is it well formed?</strong> Does the response match the expected type and schema?</li>
<li><strong>Is it supported?</strong> Does the referenced evidence exist, and does it support the proposed interpretation?</li>
<li><strong>Is it permitted?</strong> May this system perform that action for this user, account and current operating state?</li>
</ol>
<p>Structured generation helps with the first question. The application still owns the other two.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/b6c8057a-8fef-4a62-baef-7deb387d0714.png" alt="Three checks ask whether a response has the required format, is supported by evidence and is permitted by business rules. A saved decision requires all three." style="display:block;margin:0 auto" />

<p>That distinction is also a security boundary. The Open Worldwide Application Security Project (OWASP) warns that model output must be checked and cleaned before other software uses it. The risk grows if model output can trigger actions that the original user could not. <a href="https://genai.owasp.org/llmrisk/llm052025-improper-output-handling/">OWASP classifies this as LLM05:2025</a>.</p>
<p>Treating model output as a formal proposal with named fields, not as an instruction, keeps that boundary visible.</p>
<h2>Keep suggestions separate from permission to act (interpretation and authority)</h2>
<p>Models are useful where inputs are ambiguous and the application needs interpretation:</p>
<ul>
<li>extracting facts from unstructured material;</li>
<li>classifying intent;</li>
<li>comparing a document with a rubric;</li>
<li>proposing a next action;</li>
<li>generating an explanation for a result already determined elsewhere.</li>
</ul>
<p>Authority is different. Authority means permission to change the world. It approves, rejects, pays, publishes, deletes, routes, suspends or changes a saved business record, also called durable state.</p>
<p>The model can contribute evidence to that process without owning it.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/45557354-961d-4ab5-b361-b7653842eba8.png" alt="A checked request reaches a model, whose proposal must pass evidence checks and business rules before the application saves a decision. Uncertainty and system failure leave through separate paths." style="display:block;margin:0 auto" />

<p>The application therefore needs three honest kinds of result:</p>
<ul>
<li>a proposal supported by evidence;</li>
<li>an explicit statement that there is not enough evidence;</li>
<li>a technical failure, such as a timeout or unavailable service.</li>
</ul>
<p>The second result means the system is uncertain. The third means the system failed to complete the work. Neither should be disguised as a normal business decision.</p>
<h3>Optional technical example</h3>
<p>The next two TypeScript examples show how software can preserve those three results. They add implementation detail, but they are not required to understand the argument. Readers who do not work with code can skip to <strong>What the code guarantees</strong>.</p>
<p>A formal result definition, often called a contract, makes the separation explicit:</p>
<pre><code class="language-typescript">type ModelProposal =
  | {
      kind: 'proposal';
      action: 'billing_queue' | 'security_queue';
      confidence: number;
      evidence: string[];
    }
  | {
      kind: 'insufficient_evidence';
      missing: string[];
    }
  | {
      kind: 'model_failure';
      reason: 'timeout' | 'invalid_output' | 'unavailable';
      retryable: boolean;
    };
</code></pre>
<p>This type makes two decisions before any model is called.</p>
<p>First, uncertainty is legitimate. The model does not have to manufacture a proposal when the input lacks sufficient evidence.</p>
<p>Second, a model failure remains a system failure. It cannot be silently converted into a business result.</p>
<p>The application then applies its business rules, or policy:</p>
<pre><code class="language-typescript">function authorizeAction(
  proposal: ModelProposal,
  policy: RoutingPolicy,
): RoutingDecision {
  if (proposal.kind === 'model_failure') {
    return {
      kind: 'system_failure',
      reason: proposal.reason,
      retryable: proposal.retryable,
    };
  }

  if (proposal.kind === 'insufficient_evidence' || proposal.evidence.length === 0) {
    return { kind: 'needs_review', reason: 'insufficient_evidence' };
  }

  if (!policy.automaticRoutingEnabled) {
    return { kind: 'needs_review', reason: 'automatic_routing_disabled' };
  }

  if (!policy.permittedActions.has(proposal.action)) {
    return { kind: 'needs_review', reason: 'action_not_permitted' };
  }

  if (proposal.confidence &lt; policy.minimumConfidence) {
    return { kind: 'needs_review', reason: 'low_confidence' };
  }

  return {
    kind: 'authorized',
    action: proposal.action,
    evidence: proposal.evidence,
    policyVersion: policy.version,
  };
}
</code></pre>
<h3>What the code guarantees</h3>
<p>The important feature is not the syntax. It is the location of authority. The model may propose <code>security_queue</code>, but it cannot grant itself permission to use that route. High confidence cannot enable a feature that business rules have disabled. Missing evidence cannot be repaired by optimism.</p>
<h2>The eight layers of the shell</h2>
<p>The shell is a way to organize responsibility, not a software library. Its implementation will vary, but eight responsibilities recur in serious systems.</p>
<h3>1. Check the request (input contract)</h3>
<p>Check the request's size, type, required information, who made it and what that person is allowed to do before sending anything to the model. This is the input contract. An expensive model is not an input-checking service.</p>
<h3>2. Record what the model saw (context assembly)</h3>
<p>Record the instructions, business records, rule versions and documents given to the model. This is context assembly. Without that record, two apparently identical requests may produce decisions that cannot be explained or reconstructed later.</p>
<h3>3. Limit time, cost and retries (invocation budget)</h3>
<p>Set explicit limits for waiting time, retry attempts, generated text, simultaneous requests and cost. Engineers call this an invocation budget. “Call the model until it works” is not a failure policy.</p>
<h3>4. Check the response format (structural validation)</h3>
<p>Require the declared response shape. This is structural validation. Reject unknown result types, missing fields and malformed values. Do not let response-reading software silently invent values for fields that affect a decision.</p>
<h3>5. Check whether the claims are supported (semantic validation)</h3>
<p>Check the model's claims against material the application can verify. This is semantic validation. Confirm that referenced records exist, quoted evidence is real, numeric ranges make sense and the proposed action fits the current situation.</p>
<h3>6. Apply business rules (policy decision)</h3>
<p>Apply permissions, account settings, risk limits, enabled features and rules that must always hold. This policy decision happens in ordinary code. It is where a proposal becomes permitted, rejected or sent for review.</p>
<h3>7. Save the result safely (durable state transition)</h3>
<p>Save important changes so they survive a restart. Engineers call this a durable state transition. Make the save idempotent: repeating the same request or receiving the same event twice must not perform the consequential action twice.</p>
<h3>8. Keep a record and monitor the process (audit and observability)</h3>
<p>Record the proposal, evidence, rule version, final decision and reason for any failure. Measure each stage separately. This creates an audit record and makes the process observable. A service may appear healthy while document retrieval is broken, the model connection is changing or the business-rule checks reject nearly everything.</p>
<p>This system-level view is consistent with the AI Risk Management Framework from the U.S. National Institute of Standards and Technology (NIST). It treats governance, measurement and management as concerns throughout a system's life. Its Core calls for documented controls around outside AI components, defined human oversight, interpretation of outputs in context and systems that can fail safely beyond their knowledge limits. <a href="https://airc.nist.gov/airmf-resources/airmf/5-sec-core/">The framework is broader than model quality alone</a>.</p>
<p>The same boundary appears in the multinational <a href="https://www.ncsc.gov.uk/collection/guidelines-secure-ai-system-development">Guidelines for Secure AI System Development</a>. They recommend limiting the actions AI components can trigger, adding independent safety mechanisms, giving each component only the access it needs and checking model outputs before use.</p>
<h2>“Needs review” is a real result</h2>
<p>Many applications recognize only two results: success and failure.</p>
<p>When a probabilistic component is added, teams often overload one of those states. Low confidence becomes rejection. A timeout becomes “not approved.” Missing evidence becomes an empty result that later parts of the system interpret as negative.</p>
<p>Those mappings are convenient and wrong.</p>
<p>A mature system normally needs at least three outcomes:</p>
<ul>
<li>the evidence and business rules permit an action;</li>
<li>the evidence or business rules require review;</li>
<li>the system could not produce a trustworthy proposal.</li>
</ul>
<p>The second path represents uncertainty. The third represents failure. Combining them damages both product behaviour and operations. Review queues become filled with infrastructure incidents, while users receive negative outcomes caused by unavailable dependencies.</p>
<p>Confidence does not solve this. A confidence score can contribute to a review rule, but it is not evidence, permission or proof that the score is reliable. A system should explain why the evidence was sufficient under particular business rules, not merely report that the model sounded certain.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/06b32c78-c411-4afc-8089-9362ce168009.png" alt="Three separate outcomes require different responses: an authorized business action, a needs-review uncertainty state and a system failure." style="display:block;margin:0 auto" />

<h2>Preserve the identity of failure</h2>
<p>Suppose the model call times out. The application has several honest options:</p>
<ul>
<li>retry a limited number of times within a fixed time and cost budget;</li>
<li>place the work in a queue that survives a service restart;</li>
<li>return a retryable system error;</li>
<li>continue with reduced but documented capability;</li>
<li>ask a human to complete the operation.</li>
</ul>
<p>“Return the negative business result” is not one of them.</p>
<p>Keeping the reason for failure matters because different people and systems can respond. A user may correct a badly formed request. An operator may investigate an outside service outage. A worker may retry a temporary error. A product owner may decide whether reduced operation is acceptable.</p>
<p>Flattening all of these into <code>false</code> or <code>score: 0</code> destroys that coordination.</p>
<p>Giving each result a clear name keeps the reason intact as it moves through the system. It also creates better measurements: business rejection rate, insufficient-evidence rate and system-failure rate are different signals. Combining them produces a number that tells nobody what to fix.</p>
<h2>Test the surrounding system without relying on a live model</h2>
<p>The deterministic shell creates a large surface that can be tested without a live model. Small automated checks, commonly called unit tests, can prove that the application's rules behave as intended.</p>
<p>Those tests can prove that:</p>
<ul>
<li>an action without evidence never becomes authorized;</li>
<li>a disabled capability cannot be enabled by high confidence;</li>
<li>a disallowed action goes to review;</li>
<li>timeouts remain technical failures and state whether retrying may help;</li>
<li>repeated versions of the same operation cannot produce duplicate changes;</li>
<li>every saved decision records the version of the business rules used.</li>
</ul>
<p>Integration checks can verify the request and response formats against a controlled stand-in for the model service. Engineers often call these adapter contract tests. A small, controlled set of live checks can then detect whether the real service still accepts the schema and returns compatible responses.</p>
<p>That division is useful because live model tests answer a different question. They can reveal a broken connection or provider drift, meaning changes in behaviour over time. They should not be the only proof that the application's essential rules always hold.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a943e0ed584895148cfb3db/5d0cadd3-2d4a-41ab-b6c8-b45a213b40a7.png" alt="Three testing levels separate automated checks of business rules, integration checks and limited checks against the live model service." style="display:block;margin:0 auto" />

<h2>The shell has limits</h2>
<p>A deterministic shell does not make an AI system automatically correct merely because it was designed this way.</p>
<p>Checks of meaning and evidence, known as semantic validation, can be incomplete. Evidence extraction can miss relevant facts. A business rule can encode the wrong decision. Human review can become a slow queue that nobody monitors. A model can be systematically wrong while still producing perfectly formed proposals.</p>
<p>The point is narrower: the architecture should reveal where each responsibility lives.</p>
<p>The model owns uncertain interpretation. Validation owns format and evidence checks. Policy owns permission to act. Storage owns the saved business record. Operations owns recovery and monitoring. Humans own the decisions the organization has chosen not to automate.</p>
<p>Those boundaries make failure inspectable. They make consequential actions harder to trigger accidentally. They allow individual components to improve without silently changing the meaning of the entire product.</p>
<h2>Eight questions for an architecture review</h2>
<p>Use these questions before allowing a model response to change a saved business record.</p>
<ol>
<li>What is the model allowed to propose?</li>
<li>What evidence must accompany that proposal?</li>
<li>Which checks establish that the evidence is real and relevant?</li>
<li>Where does the application decide whether the action is permitted, known as authorization?</li>
<li>Which explicit result represents insufficient evidence?</li>
<li>Can a timeout or malformed response become a user judgment?</li>
<li>Can the same change be retried safely without happening twice?</li>
<li>Can the decision be reconstructed from its evidence, what the model saw and the version of the business rules used?</li>
</ol>
<p>If the answer to several of these questions is “inside the prompt,” the system probably has an authority problem.</p>
<p>The hard part of production AI is rarely obtaining a response. It is deciding what that response is allowed to mean.</p>
]]></content:encoded></item></channel></rss>