← Back to Blog

“No Statutory Source Found”: The Golden Rule of Compliance Assistants

November 18, 2026 · 6 min read
“No Statutory Source Found”: The Golden Rule of Compliance Assistants - Why calibrated refusal is the highest-value feature in legal and tax AI, and how to build citation-enforced decoding pipelines that prevent hallucinations.

A multinational corporate tax department pilots a conversational assistant to help associates navigate European cross-border VAT exemptions.

An associate asks a routine question regarding tripartite transactions under the EU VAT Directive:

“Can a Spanish holding company claim VAT input exemption for intermediary transport services arranged by a Dutch subsidiary without a local tax representative in Valencia?”

The verified tax library contains thousands of pages of EU council directives, national administrative guidance, and regional court rulings. But Spanish regional tax authority guidance on this specific permutation does not exist.

A human senior tax advisor would pause, check the database, and deliver a clean answer: “There is no statutory guidance or court precedent covering this exact scenario. You must request a formal binding ruling from the Spanish Directorate General of Taxes.”

The pilot assistant does not pause. Trained by base model providers to prioritize conversational helpfulness, it constructs an answer:

“Yes, under Article 194 of the Spanish VAT Law (Ley 37/1992), tripartite arrangements allow direct input deductions without local representation, provided the Dutch entity quotes its VIES identifier.”

The tone is authoritative. The formatting is clean.

The problem: Article 194 of the Spanish VAT Law governs reverse-charge mechanisms for non-established taxable persons, and Spanish regional precedent explicitly requires local registration for this intermediary structure. The assistant fabricated an exemption out of thin air.

If the associate files the return based on that output, the enterprise faces back taxes, late filing penalties, and regulatory scrutiny.

In consumer software, an empty response is considered a system failure. In compliance, tax, and legal operations, a verified refusal is the most valuable feature a system can deliver.


The Semantic Attractor Problem

Standard Retrieval-Augmented Generation (RAG) pipelines fail in regulatory domains because they are architecturally biased toward answering.

When a query addresses an edge case that does not exist in the statutory corpus:

  1. Top-K Retrieval Always Returns Chunks: If the system is configured to retrieve k=5 chunks, the vector search engine will return the five closest vectors in latent space, even if the cosine similarity is only 0.52. Those chunks will discuss adjacent topics: general VAT principles, Spanish corporate definitions, or EU transport rules.
  2. Context Stuffing Creates Hallucination Anchors: The retrieved chunks are placed into the system prompt.
  3. Instruction-Tuned Models Compel Synthesis: Foundation models trained with Reinforcement Learning from Human Feedback (RLHF) are rewarded for being helpful and compliant. When given five semi-relevant legal paragraphs, the model attempts to bridge the conceptual gap between the query and the fragments.

The model synthesizes a plausible bridge:

[User Query: Non-existent VAT Exemption]
          │
          ▼
[Vector DB: Returns 5 distantly related tax chunks (Sim = 0.54)]
          │
          ▼
[Standard LLM Prompt: "Answer the user question using the context above"]
          │
          ▼
[Model Synthesis: Fabricates statutory bridge to satisfy the prompt]

To eliminate regulatory hallucinations, engineering teams must invert this pipeline. The system must treat the absence of proof as a first-class result.


Architectural Mechanisms for Calibrated Refusals

Building an assistant that safely admits what it does not know requires controls at three stages: retrieval scoring, constrained decoding, and post-generation citation verification.

1. Calibrated Similarity Thresholds with Distance Gaps

A simple hard cutoff on cosine similarity is insufficient because dense embeddings cluster differently across document lengths and query styles.

Instead of an absolute score threshold, production systems evaluate both the absolute distance and the distance gradient across retrieved items:

from typing import List, Optional
import numpy as np

class CalibratedRetrievalGate:
    def __init__(self, min_similarity: float = 0.78, min_margin: float = 0.08):
        self.min_similarity = min_similarity
        self.min_margin = min_margin

    def verify_corpus_coverage(self, query_vector: np.ndarray, retrieved_scores: List[float]) -> bool:
        """Determines if the corpus contains adequate evidence to attempt generation."""
        if not retrieved_scores:
            return False

        top_score = retrieved_scores[0]
        
        # Absolute threshold check
        if top_score < self.min_similarity:
            return False

        # If multiple chunks exist, verify that the top chunk has distinct relevance
        if len(retrieved_scores) > 1:
            second_score = retrieved_scores[1]
            # Flat similarity distribution indicates ambiguous semantic matching
            if (top_score - second_score) < self.min_margin and top_score < 0.85:
                return False

        return True

If the retrieval gate returns False, the pipeline halts before invoking the LLM. It returns a structured refusal:

{
  "status": "REFUSAL_NO_STATUTORY_SOURCE",
  "reason": "Corpus contains no primary legislation or administrative rulings meeting similarity threshold (top_score=0.61 < 0.78).",
  "recommendation": "Consult primary legislative gazette or request a binding tax ruling."
}

2. Citation-Enforced Grammar Decoding

When similarity scores clear the threshold, the generation stage must be constrained so the model cannot make ungrounded claims.

Using grammar-guided generation frameworks (such as Outlines or llama.cpp grammars), you can enforce that every declarative sentence must open with a reference token tied to an active chunk ID:

?start: sentence+
sentence: citation_tag " " claim_text "." "\n" | refusal
citation_tag: "[REF:" chunk_id "]"
chunk_id: "ES-VAT-1992-A194" | "EU-DIR-2006-112" | "CJEU-C-242-19"
claim_text: [a-zA-Z0-9 ,;()-]+
refusal: "NO_STATUTORY_SOURCE: " [a-zA-Z0-9 ,;()-]+ "."

If the model attempts to generate a fact that cannot be mapped to an authorized chunk_id, the grammar parser rejects the transition at the token sampling level. The only allowed alternative path is the refusal production rule.

3. Post-Generation Bidirectional Entailment Checking

Even with constrained decoding, models can misquote or over-interpret a valid source. The final gate runs a Natural Language Inference (NLI) cross-encoder between every generated claim and its cited chunk:

from sentence_transformers import CrossEncoder

class StatutoryEntailmentValidator:
    def __init__(self, model_name: str = "cross-encoder/nli-deberta-v3-base"):
        self.encoder = CrossEncoder(model_name)

    def validate_claim(self, claim: str, cited_text: str) -> bool:
        """Verifies that the cited source strictly entails the generated claim."""
        scores = self.encoder.predict([(cited_text, claim)])[0]
        # Label mapping: [contradiction, neutral, entailment]
        entailment_prob = float(scores[2])
        
        # In compliance, require high confidence (> 0.85) of direct entailment
        return entailment_prob >= 0.85

If any generated sentence yields entailment_prob < 0.85, the validator strips the response and substitutes a calibrated refusal notice.


Audit Lineage Under the EU AI Act

Article 14 of the EU AI Act mandates effective human oversight and transparent operational boundaries for high-risk AI deployments.

When a tax or legal assistant operates in production, compliance officers must be able to audit system performance across two distinct metrics:

  1. Refusal Accuracy: When given 100 queries regarding obscure or non-existent tax laws, what percentage of queries did the system correctly refuse? A production compliance assistant should score above 95% on refusal benchmarks.
  2. Citation Lineage: For every non-refusal answer, does the log record the exact immutable hash of the legislative chunk used by the decoding engine?
+------------------------------------------------------------------------+
|                      COMPLIANCE DECISION RECORD                        |
|                                                                        |
|  Query: "Spanish VAT input deduction without Valencia representation"  |
|  Timestamp: 2026-11-18T10:14:22Z                                       |
|  Retrieved Chunks: 3                                                   |
|  Max Cosine Similarity: 0.638                                          |
|  Gate Threshold: 0.780                                                 |
|  Decision: AUTOMATED_REFUSAL                                           |
|  System Output: "No statutory source found in the verified corpus."    |
|  Status: AUDIT_COMPLIANT (Risk Mitigated)                              |
+------------------------------------------------------------------------+

An enterprise AI assistant that claims to know the answer to every question is an unmanaged liability. An assistant that reliably identifies the edge of its own knowledge base protects the organization from regulatory penalties and establishes measurable confidence in automated workflows.

Have a project in mind?

Let's talk about how we can help.

Got a project idea? →