Implementation Guide

Compliance-Aware LLM Routing: Routing to the Cheapest Model Without Violating Policy

Compliance-aware LLM routing evaluates policy before it evaluates price. The router classifies each request, applies policy to produce a set of eligible models, and only then ranks that set by cost. If no eligible model is available, the request fails closed instead of falling back to a non-compliant model.

The principle: compliance is a filter, cost is a sort

Policy is evaluated first and acts as a hard constraint. Cost is an optimization that applies only within the set of models that policy permits. A model that policy excludes is never a candidate, however low its price.

Decision order for every request

The decision flow runs in four steps, in this order, for every request.

  1. ClassifyAssign data class, residency, and use case attributes.
  2. FilterRemove every model that policy does not permit.
  3. RankSelect the lowest-cost model among the eligible set.
  4. RecordLog the inputs, policy result, and chosen model.

Classify requests and build the eligibility registry

Classification assigns data class, residency, and use case attributes to each request. Policy then compares those attributes with the eligibility registry to decide which models remain in the eligible set.

What each registry entry records

  • Hosting and processing regions, including where logs and backups reside
  • Data retention terms for prompts and outputs
  • Whether provider terms permit training on customer data
  • Certifications and attestations the provider documents, with the verification date
  • Data classes the model is approved to receive
  • Approved use cases, contract status, and the internal owner of the entry

Fallback, failure, misclassification, and drift

Fallback is limited to the eligible set, so a substitute model must pass the same policy checks as the first choice.

Each outcome is recorded as dispatched, fallback used, queued, or rejected, with the fallback reason. The policy version and registry version used for each decision are recorded alongside it.

Routing audit record

The final step of the decision order is to record the decision. Each routing audit record includes:

  • Request ID, timestamp, calling application, and user or agent identity
  • Assigned classification attributes and how each was derived
  • Policy version and registry version used for the decision
  • Eligible models considered, with the reason for each exclusion
  • Selected model, region, and cost basis for the choice
  • Outcome: dispatched, fallback used, queued, or rejected, with the fallback reason

Enforce routing policy at runtime

See how runtime governance and audit logging can serve as the enforcement layer for model routing decisions.

Request a Demo