{"id":9,"date":"2025-11-06T10:00:00","date_gmt":"2025-11-06T07:00:00","guid":{"rendered":"https:\/\/www.hasangultekin.com\/2025\/11\/06\/validate-ai-answers-before-delivery\/"},"modified":"2025-11-06T10:00:00","modified_gmt":"2025-11-06T07:00:00","slug":"validate-ai-answers-before-delivery","status":"publish","type":"post","link":"https:\/\/www.hasangultekin.com\/tr\/2025\/11\/06\/validate-ai-answers-before-delivery\/","title":{"rendered":"M\u00fc\u015fteri G\u00f6rmeden \u00d6nce Yapay Zeka Taraf\u0131ndan Verilen Cevab\u0131 Kontrol Etmek"},"content":{"rendered":"<p>An answer can be clear, polite, and wrong in exactly the place that matters. A support assistant might quote the right product description and then add a delivery promise that the source never made.<\/p>\n<p>I treat generation and validation as separate responsibilities. The model proposes a response. The application decides whether that response satisfies the evidence and product rules required for delivery.<\/p>\n<h2>Identify the claims that create risk<\/h2>\n<p>Not every sentence needs the same treatment. A greeting has little factual content. A price, product identifier, warranty condition, or link can directly influence a customer&#8217;s decision.<\/p>\n<p>I begin by identifying those concrete claims. The validator then compares them with the retrieved sources or authoritative structured data. It should preserve relationships: finding the number 49 in a source is not enough to support a price of \u20ac49 for the selected product.<\/p>\n<p>Currency, variant, quantity, date, and market can all change the meaning of a value. A useful check asks whether the complete claim is supported in the relevant context.<\/p>\n<h2>Keep links tied to trusted source records<\/h2>\n<p>A model can produce a plausible URL that does not exist. It can also produce a real URL that points to the wrong product. I prefer links selected from verified source records rather than paths assembled from generated text.<\/p>\n<p>The link check needs an explicit normalization policy. Comparing only domains would accept many incorrect destinations. Comparing raw strings without handling legitimate formatting differences can reject valid links.<\/p>\n<p>If the application fetches a generated URL to validate it, that fetch introduces its own security boundary. In many cases, matching against a controlled source catalog is simpler than allowing arbitrary network requests from the validator.<\/p>\n<h2>Use deterministic checks where the domain permits<\/h2>\n<p>Structured product identifiers and known prices are good candidates for deterministic validation. Open-ended policy paraphrases are harder: matching keywords cannot prove that a sentence preserves the original conditions.<\/p>\n<p>A model-based verifier can help inspect semantic claims, but it introduces another fallible component. I would calibrate it against human-reviewed examples and keep high-impact rules explicit. Asking the same generation model whether it was correct is weak evidence on its own.<\/p>\n<p>A possible result structure is:<\/p>\n<pre><code>{\n  \"decision\": \"needs_revision\",\n  \"unsupported_claims\": [\"delivery_by_requested_date\"],\n  \"allowed_source_ids\": [\"shipping-policy-v3\"],\n  \"next_action\": \"ask_for_postcode\"\n}<\/code><\/pre>\n<p>This is an illustrative contract. The important part is that failure produces an actionable state instead of a generic Boolean that downstream code can ignore.<\/p>\n<h2>Plan what happens when validation fails<\/h2>\n<p>The application may regenerate once using narrower evidence, remove an unsupported claim, ask for missing information, or hand the conversation to a person. That choice should depend on the reason for failure.<\/p>\n<p>Retries need a limit. Repeatedly generating until a response passes can increase cost while selecting for weaknesses in the validator. Every attempt should remain within the request&#8217;s time and spending budget.<\/p>\n<p>Streaming also changes the design. Text already shown to the customer cannot be made unseen. If the product promises validation before delivery, high-impact claims need to be buffered or generated from approved structured fields before they are released.<\/p>\n<h2>Keep evidence validation separate from instruction trust<\/h2>\n<p>A retrieved document can contain useful facts and malicious instructions. Passing an evidence check does not give that document authority to change tool permissions or system behavior. OWASP&#8217;s <a href=\"https:\/\/genai.owasp.org\/llmrisk2023-24\/llm01-24-prompt-injection\/\" target=\"_blank\" rel=\"noopener\">prompt injection guidance<\/a> is a useful reference for this separate trust boundary.<\/p>\n<p>I want validation failures to become evaluation cases. Each unsupported promise or incorrect link describes a concrete behavior the system should recognize next time, and a regression check the team can run before changing the pipeline.<\/p>\n<p class=\"hg-editorial-note\"><small>Updated 25 September 2026.<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bir yapay zeka yan\u0131t\u0131n\u0131 yay\u0131nlamadan \u00f6nce, fiyatlar, \u00fcr\u00fcn tan\u0131mlay\u0131c\u0131lar\u0131, ba\u011flant\u0131lar ve politika beyanlar\u0131na ili\u015fkin kan\u0131t kontrollerinden ak\u0131c\u0131 metin \u00fcretimini ay\u0131r\u0131n.<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[151],"tags":[166,167,183],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-ai-engineering","tag-grounding","tag-guardrails","tag-rag"],"_links":{"self":[{"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":0,"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hasangultekin.com\/tr\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}