Cost optimization evidence and model routing accountability for centralized AI access management
The question Smart Routing creates. Smart Routing sends a request to a cheaper model. The output looks fine. Six weeks later, an Article 12 audit asks: which model processed this specific customer's loan decision on October 14? Smart Routing made the routing choice, but that decision is not in your compliance records. It is in AWS operational logs that you may or may not have retained. Every routed request is a governance event -- and right now, most organizations have no structured record of which model actually ran.
AWS introduced two services that reshape how organizations manage AI model access and cost:
A centralized model access layer that sits between users and foundation models. Gateway provides organizational controls -- spending limits per user or group, IAM-based model access policies, and a unified catalog that spans Bedrock-hosted models, third-party endpoints, and self-hosted infrastructure. Administrators can set budget caps, enforce approval workflows for expensive models, and monitor consumption across the entire organization from a single console.
An automatic model selection layer that evaluates incoming requests and routes them to the most cost-effective model capable of producing comparable output quality. AWS reports 40-50% cost savings in internal testing. Smart Routing analyzes prompt characteristics -- complexity, expected output length, domain -- and selects from a pool of approved models based on quality benchmarks and pricing.
Both services change two fundamental questions in AI operations: which model runs and how much it costs. AWS positions these services as infrastructure for enterprise AI management. From a witness perspective, every routing decision, budget threshold, and model substitution is an event that may warrant evidence.
Bedrock Gateway consolidates model access management into a single organizational layer. Rather than individual teams managing their own Bedrock endpoints, API keys, and budgets, Gateway provides centralized control with several governance-relevant capabilities:
Administrators define which models are available to which teams. A research group may have access to large frontier models while a customer-service team is restricted to smaller, cost-effective options. The catalog spans Bedrock-native models, third-party models accessed via API, and models self-hosted on SageMaker or EC2 -- creating a single registry regardless of deployment topology.
Per-user, per-group, and per-IAM-role spending limits can be configured with threshold alerts at configurable percentages. When a team hits 80% of its monthly budget, Gateway can notify administrators, throttle requests, or block access entirely depending on policy configuration.
Gateway integrates with Okta, Microsoft Entra, and AWS IAM Identity Center for identity-based model access. This means model permissions follow the same identity governance as other enterprise resources -- joiners get model access through group membership, leavers lose it automatically.
From a governance evidence perspective, Gateway produces several event types that may warrant witness anchors:
Gateway creates a single pane of glass for model management. But the glass itself produces operational records that auditors may ask about -- particularly when regulatory frameworks require evidence of access control, cost management, or model inventory.
Smart Routing picks the cheapest model that can deliver comparable quality. The operative word is "comparable" -- and that word carries the entire governance burden.
When Smart Routing substitutes a less expensive model, the organization needs to answer: Can you prove the cheaper model's output was equivalent? The 40-50% savings figure is attractive to any FinOps team. But it raises immediate auditor questions: "Which model actually processed this request? Was quality assessed before or after substitution? Who approved the quality threshold?"
Cost savings at the expense of accuracy may be acceptable for some workloads (summarization, classification) and unacceptable for others (medical diagnosis support, legal analysis, financial risk scoring). Without evidence of the routing decision and its quality assessment, an organization cannot distinguish between cost optimization and quality degradation after the fact.
If Smart Routing replaces Model A with Model B and no record exists of that substitution, the organization has a gap in its operational record-keeping. This is particularly relevant under:
| Scenario | Governance Question | Without Evidence | With SWT3 |
|---|---|---|---|
| Model downgrade | Did cheaper model meet quality threshold? | No record | AI-DEL.1 + AI-INF.1 |
| Budget breach | Who approved spending above limit? | CloudTrail only | AI-COST.1 + AI-AUDIT.1 |
| Context truncation | Did truncation affect output quality? | Unknown | AI-CTX.1 |
| Routing failure | Was fallback model authorized for this workload? | Unclear | AI-DEL.2 + AI-MDL.8 |
| Quality dispute | Which model produced the contested output? | Ambiguous | AI-INF.1 + AI-AUDIT.1 |
AI-COST.1 records per-inference resource consumption, creating a witness trail that connects model usage to organizational budgets. In a Bedrock Gateway environment, cost evidence serves multiple audiences:
Each inference carries a resource footprint -- input tokens, output tokens, compute seconds, and API call costs. AI-COST.1 witnesses these values as immutable records, allowing organizations to reconstruct cost profiles for any time period, model, or team.
When spending hits 80%, 90%, or 100% of an allocated budget, the threshold crossing itself is a witnessable event. This evidence may be relevant for demonstrating that cost controls were monitored and that budget overruns were detected in a timely manner.
By linking AI-COST.1 records to AI-INF.1 inference provenance records, an organization can build a cost-quality dataset: "For this prompt class, Model A cost $0.03 and scored 94% on quality metrics. Model B cost $0.008 and scored 91%." This linkage gives auditors a basis for evaluating whether cost optimization affected output quality.
Smart Routing makes cross-model cost comparison a daily reality. Recording the cost of the model that was selected -- alongside the cost of the model that would have been selected without Smart Routing -- provides the evidence basis for validating the savings claims.
When an agent sends a request to Bedrock and Smart Routing redirects it to a different model, that redirection is a delegation event. The original caller delegated inference to Bedrock, and Bedrock delegated it further to a specific model based on routing policy.
Each Smart Routing decision can be witnessed as a delegation event. The anchor records the delegation depth (how many hops from the original caller to the executing model), the authorized depth (maximum hops permitted by policy), and the total delegation count for the session. This creates a chain of custody for the inference request.
Gateway policies may impose constraints on delegation -- maximum depth (an agent cannot delegate to another agent that delegates to another agent indefinitely), time bounds (a delegation expires after N minutes), and scope limits (a delegated model cannot access certain data sources). AI-DEL.2 records these boundary conditions and whether the actual execution stayed within them.
When Gateway blocks a model request because the user has exceeded their budget, that block is a delegation constraint enforcement. The request was delegated to Gateway, and Gateway refused to delegate further. Recording this refusal provides evidence that access controls functioned as configured.
Consider a typical agentic workflow: a user asks an orchestrator agent to analyze a document. The orchestrator calls Bedrock. Smart Routing selects a model. The model calls a tool that itself triggers another Bedrock inference. This creates a delegation chain:
User -> Orchestrator -> Bedrock Gateway -> Smart Router -> Model A -> Tool -> Bedrock Gateway -> Model B
Each hop in this chain is a witnessable delegation event. Without delegation evidence, the organization cannot reconstruct who authorized what, or identify where in the chain a problem originated.
Smart Routing picks a model -- but what if the selected model has a smaller context window than the original target? A request crafted for a 200K-token context window that gets routed to a model with a 32K-token window may lose critical context.
When context is truncated to fit a smaller window, the output quality may be affected. AI-CTX.1 records the original context size, the actual window used, and whether truncation occurred. This evidence allows after-the-fact analysis when output quality is questioned: "Was the context complete, or was it cut to fit?"
Organizations may set token budgets per request, per session, or per user. When Smart Routing selects a model, the token budget for that model's pricing tier becomes relevant. AI-CTX.1 witnesses the utilization percentage -- how much of the available window was used -- providing data for capacity planning and cost optimization.
When context must be reduced, different strategies produce different quality impacts. Truncation (removing oldest context) differs from summarization (condensing context) differs from selective pruning (removing low-relevance segments). Recording the eviction method alongside the truncation event provides the evidence needed to assess whether quality degradation was a function of routing or of context management.
Practical note: AI-CTX.1 is especially relevant when Smart Routing moves a request from a large-context model to a smaller-context model. The routing decision (AI-DEL.1) and the context management decision (AI-CTX.1) together tell the complete story of what happened to the request.
Seven SWT3 procedures are relevant to Bedrock Gateway and Smart Routing governance. Each card shows the procedure identifier, description, factor definitions, and an assessor tip.
Records per-inference resource consumption including token usage, compute time, storage, API calls, and bandwidth. Witnesses budget threshold crossings when spending reaches configured percentages of allocated budgets.
| Factor | Name | Type | Description |
|---|---|---|---|
factor_a | resource_type_code | int | 0=tokens, 1=compute_seconds, 2=storage_bytes, 3=api_calls, 4=bandwidth |
factor_b | consumption_value | int | Quantity consumed in units defined by resource_type_code |
factor_c | budget_threshold_pct | int | 0-100; percentage of budget consumed at time of witness. 0 if no budget is configured |
Records delegation depth and authorization boundaries when a request is routed from one model or agent to another. Each Smart Routing decision that redirects a request to a different model is a delegation event.
| Factor | Name | Type | Description |
|---|---|---|---|
factor_a | delegation_depth | int | Number of hops from original caller to executing model |
factor_b | authorized_depth | int | Maximum delegation depth permitted by policy |
factor_c | delegation_count | int | Total number of delegations in the current session or chain |
Records the maximum delegation constraints configured by policy and the actual delegation parameters observed during execution. Captures time-bound constraints for delegations with expiration windows.
| Factor | Name | Type | Description |
|---|---|---|---|
factor_a | max_depth_allowed | int | Policy-defined maximum delegation depth |
factor_b | actual_depth | int | Observed delegation depth for this request |
factor_c | time_bound_minutes | int | Maximum delegation validity period in minutes; 0 if unbounded |
Records context window utilization and truncation events. Particularly relevant when Smart Routing selects a model with a different context window size than the originally targeted model.
| Factor | Name | Type | Description |
|---|---|---|---|
factor_a | window_size_tokens | int | Total context window size of the selected model in tokens |
factor_b | utilization_pct | int | Percentage of context window consumed (0-100) |
factor_c | truncation_occurred | int | 0 = no truncation; 1 = context was truncated to fit window |
Records the approval status of models within a centralized registry. In a Bedrock Gateway environment, this attests that the model selected by Smart Routing was present in the organizational catalog and carried an appropriate approval status at the time of inference.
| Factor | Name | Type | Description |
|---|---|---|---|
factor_a | registry_entry_id | str | Hash of the model's registry entry (model ID + version + provider) |
factor_b | approval_status | int | 0=pending, 1=approved, 2=deprecated, 3=blocked |
factor_c | last_audit_date | int | Epoch days since last audit of this registry entry |
Records the integrity state of audit logs produced by Gateway and Smart Routing operations. Witnesses log entry counts, hash chain validity, and the last verification timestamp to establish that operational records have not been tampered with.
| Factor | Name | Type | Description |
|---|---|---|---|
factor_a | log_entry_count | int | Number of log entries in the current audit period |
factor_b | hash_chain_valid | int | 0 = chain broken or unverified; 1 = hash chain intact |
factor_c | last_verified | int | Epoch milliseconds of last hash chain verification |
Records prompt and response hashes to establish inference lineage. In a Smart Routing context, AI-INF.1 provides the cryptographic link between a specific prompt and the model that processed it -- answering the question "which model actually handled this request?"
| Factor | Name | Type | Description |
|---|---|---|---|
factor_a | prompt_hash | str | SHA-256 hash of the input prompt (first 12 hex characters) |
factor_b | response_hash | str | SHA-256 hash of the model response (first 12 hex characters) |
factor_c | timestamp | int | Epoch milliseconds when inference completed |
The following examples demonstrate witnessing Bedrock Gateway and Smart Routing events using the SWT3 SDKs. Both Python and TypeScript examples produce equivalent witness anchors.
from swt3_ai import Witness
witness = Witness(
endpoint="https://your-instance.example.com/api/v1/witness",
api_key="axm_your_key",
tenant_id="your-tenant-id"
)
# Witness a Smart Routing decision (delegation)
witness.witness_routing_decision(
source_model="claude-sonnet-4-6",
target_model="claude-haiku-4-5",
routing_reason="cost_optimization",
quality_threshold_met=True,
cost_savings_pct=42
)
# Witness resource consumption
witness.witness_resource_consumption(
resource_type="tokens",
consumption_value=1500,
budget_threshold_pct=65
)
# Witness context window management
witness.witness_context_window(
tokens_before=8192,
tokens_after=4096,
eviction_method="truncation"
)
witness.flush()
import { Witness } from '@tenova/swt3-ai';
const witness = new Witness({
endpoint: 'https://your-instance.example.com/api/v1/witness',
apiKey: 'axm_your_key',
tenantId: 'your-tenant-id',
});
// Witness a Smart Routing decision (delegation)
witness.witnessRoutingDecision({
sourceModel: 'claude-sonnet-4-6',
targetModel: 'claude-haiku-4-5',
routingReason: 'cost_optimization',
qualityThresholdMet: true,
costSavingsPct: 42,
});
// Witness resource consumption
witness.witnessResourceConsumption({
resourceType: 'tokens',
consumptionValue: 1500,
budgetThresholdPct: 65,
});
// Witness context window management
witness.witnessContextWindow({
tokensBefore: 8192,
tokensAfter: 4096,
evictionMethod: 'truncation',
});
await witness.flush();
This matrix maps each procedure to Bedrock Gateway features, Smart Routing features, and the combined evidence profile when SWT3 witnessing is added.
| Procedure | Bedrock Gateway | Smart Routing | Combined + SWT3 |
|---|---|---|---|
| AI-COST.1 | Native | Native | Full evidence chain |
| AI-DEL.1 | IAM only | Routing decisions | Full delegation tree |
| AI-DEL.2 | Policy limits | Implicit bounds | Explicit boundary records |
| AI-CTX.1 | Not tracked | Internal only | Truncation evidence |
| AI-MDL.8 | Model catalog | Pool membership | Attestation + audit date |
| AI-AUDIT.1 | CloudTrail | CloudTrail | Hash chain integrity |
| AI-INF.1 | Not tracked | Not tracked | Prompt/response lineage |