Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
80b3bf3
W-23450489 Agent Fabric Use Case: MCP Bridge
valkyrie69 Jul 15, 2026
7d8ec62
Updated short description
valkyrie69 Jul 15, 2026
de86eb3
Reorg
valkyrie69 Jul 15, 2026
4681bd0
Adding use case overview
valkyrie69 Jul 16, 2026
fbb42a0
Human edits
valkyrie69 Jul 16, 2026
eb8e543
Human in the loop edits
valkyrie69 Jul 16, 2026
6e5c51f
Adding short descriptions to sections
valkyrie69 Jul 17, 2026
9cde384
wording tweak
valkyrie69 Jul 20, 2026
c63d279
Adding content
valkyrie69 Jul 21, 2026
bfdc418
Removed excessive bold
valkyrie69 Jul 22, 2026
433c826
Add Agent Fabric orchestration use case
IsaacEldridge Aug 4, 2026
f212598
post-review edits
IsaacEldridge Aug 4, 2026
0abbeb6
CX style review
valkyrie69 Aug 5, 2026
0d419c2
Apply suggestions from peer review
IsaacEldridge Aug 7, 2026
acd4eef
peer review edits
IsaacEldridge Aug 7, 2026
ed07846
Updating xrefs
valkyrie69 Aug 7, 2026
855b7a1
Merge pull request #529 from mulesoft/W-23573347-orchestration-use-ca…
valkyrie69 Aug 14, 2026
359d5a1
Merge branch 'latest' into W-23450489-mcp-bridge-use-case-vh
valkyrie69 Aug 14, 2026
267be62
W-23533642 Cost Management Use Case
valkyrie69 Aug 14, 2026
dc574e5
Delete modules/ROOT/pages/af-use-case-cost-management.adoc
valkyrie69 Aug 14, 2026
7f5fb10
W-23533642 Kill Switch Feature 8/31 Release
valkyrie69 Aug 14, 2026
c1abe77
Merge branch 'W-23533642-kill-switch-vh' of github.com:mulesoft/docs-…
valkyrie69 Aug 14, 2026
c5ddb66
W-23533533 Agent Fabric Cost Management
valkyrie69 Aug 14, 2026
f378c40
Merge pull request #545 from mulesoft/W-23533533-cost-management-use-…
valkyrie69 Aug 14, 2026
10c0ba6
Added cost management to nav
valkyrie69 Aug 14, 2026
36495cb
Updating xrefs
valkyrie69 Aug 17, 2026
d8d0620
commenting out use cases that don't exist yet
valkyrie69 Aug 17, 2026
cfe11fe
Added Kill switch feature to nav
valkyrie69 Aug 18, 2026
0719e6c
Merge pull request #544 from mulesoft/W-23533642-kill-switch-vh
valkyrie69 Aug 18, 2026
ecefc81
Renamed file
valkyrie69 Aug 18, 2026
a574bda
Fixing list item
valkyrie69 Aug 18, 2026
d85c11c
Adding Models and Model Wallets
valkyrie69 Aug 18, 2026
9de9c13
Adding business outcomes
valkyrie69 Aug 18, 2026
ef56928
Moving kill switch in nav
valkyrie69 Aug 20, 2026
b2d2d93
Updated Model Wallets prereqs
valkyrie69 Aug 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
*** xref:model-proxy-request.adoc[]
*** xref:model-proxy-semantic-service.adoc[]
*** xref:model-proxy-try-out.adoc[]
*** xref:exp-detect-and-contain-rogue-agents.adoc[]
** xref:exp-scanners-add-from-providers.adoc[]
*** xref:exp-scanners-prerequisites-reference.adoc[]
*** xref:exp-scanners-view-details.adoc[]
*** xref:exp-scanners-manage.adoc[]
*** xref:exp-providers-manage.adoc[]
** xref:exp-governance-view-cost-and-token-usage.adoc[]
*** xref:model-proxy-token-reports.adoc[]
*** xref:exp-models-manage-costs.adoc[]
*** xref:exp-model-wallets-manage.adoc[]
** xref:exp-akamai-risk-correlation.adoc[]
** xref:exp-governance-work-with-strategies.adoc[]
*** xref:exp-governance-create-strategy.adoc[]
Expand All @@ -48,6 +51,10 @@
* xref:learning-map-mulesoft-ai.adoc[]
* xref:agent-fabric-overview.adoc[Agent Fabric]
** xref:learning-map-agent-fabric.adoc[Get Started with Agent Fabric]
** xref:agent-fabric-use-cases.adoc[]
*** xref:af-use-case-mcp-bridge.adoc[]
*** xref:af-use-case-cost-management.adoc[]
*** xref:af-use-case-orchestration.adoc[]
** xref:agent-fabric-release-notes.adoc[]
** xref:agent-networks-get-started.adoc[]
* xref:learning-map-api-management.adoc[API Management]
Expand Down
220 changes: 220 additions & 0 deletions modules/ROOT/pages/af-use-case-cost-management.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
= Control LLM Costs in Agent Fabric

Agent Fabric gives you full visibility into token consumption and spend across every model call, and the controls to enforce limits before usage compounds. Use Model Wallets to set hard limits in tokens or dollars that agents can't exceed, and attribute every token and dollar to the team, application, or agent that generated them.

Key benefits include:

* Stop budget overruns before they happen: Model Wallets block requests when a budget limit is reached, so an unattended agent can't run spend past the cap. The limit is enforced, not just flagged.
* Cut cost without cutting quality: Semantic routing sends routine queries to a cheaper, faster model and reserves higher-cost models for complex work, lowering average cost per query while holding response quality.
* Turn spend into decisions: See token consumption and cost by application, agent, user, and model in one place, so you can act on what's driving cost instead of guessing.
* End cost surprises: Trace every token and dollar to the team, application, or agent that drove it, so overruns have an owner and a root cause.
* Govern once, everywhere: Apply the same policies, prompt protection, and automatic fallback across every provider, so adding a model or team doesn't mean rebuilding controls. * Govern once, everywhere: Apply the same policies, prompt protection, and automatic fallback across every provider, so adding a model or team doesn't mean rebuilding controls.

== The Problem

As agentic systems scale, LLM costs can quickly spiral out of control without proper visibility and enforcement:

* Unpredictable costs: Token usage varies widely based on agent behavior and queries.
* No visibility: Costs can't be attributed to specific applications, agents, or users.
* Inefficient model usage: Expensive models handle simple queries that cheaper models could address.
* Budget overruns: Nothing enforces the budget, so a number in the plan isn't a real limit.
* No optimization path: Without data on usage patterns, optimization is guesswork.

Gain visibility into what's driving costs and the controls to optimize spending without sacrificing quality.

== The Solution

Agent Fabric provides comprehensive cost management for agentic AI through the Model Proxy:

* Usage visibility: Tracks token consumption by application, agent, user, and model.
* Semantic routing: Routes each query to the appropriate model based on complexity, automatically.
* Budget enforcement: Caps token or spend usage with Model Wallets that block requests when a budget limit is reached.
* Model optimization: Provides data-driven insight into which models are used for which tasks.
* Cost attribution: Shows exactly what's driving your spend, down to the team, app, or agent.

== How Semantic Routing Works

Not all queries require the most powerful (and most expensive) AI models. Semantic routing analyzes query complexity and routes each request appropriately:

[source,text]
----
Simple query: "What's the status of order #12345?"
→ Route to: Fast, cost-effective model

Complex query: "Analyze this quarter's sales trends, identify anomalies, and recommend strategic adjustments"
→ Route to: Powerful, higher-cost model
----

The Model Proxy makes these routing decisions automatically based on configurable rules, maintaining quality while minimizing cost.

== How Model Wallets Enforce Usage Limits

Budget alerts tell you when you've overrun a limit. They don't stop it. By the time an alert fires at 90 percent of budget, an agent running unattended can push token or spend usage far past the limit before anyone reads the notification.

A Model Wallet closes that gap by turning a budget from a number in a plan into a financial control that agents can't overrun:

* Hard limits: Set enforced token or spend limits per provider so that when a budget reaches its limit, requests are blocked rather than flagged.
* Periodic caps: Set a daily, weekly, or monthly limit that resets automatically on a schedule, so token or spend usage stays bounded each period.
* Flexible metrics: Set limits in dollars (USD) or tokens, so budgets reflect the metric that matters most to your team.
* Identity-scoped controls: Tie usage controls to a Model Proxy's client identity so that each application or agent routes through its own governed access point with dedicated budget limits.

Model Wallets build on the Model Proxy. The proxy provides one governed access point for every provider, making token consumption and spend visible; Model Wallets add the enforcement layer on top, so the usage you can see is also usage you can cap.

== Who This Is For

These cost management capabilities are ideal for:

* FinOps teams managing cloud and AI spending
* Engineering leaders optimizing infrastructure costs
* Product teams building cost-effective agentic features
* Enterprises scaling agent deployments beyond proof of concept
* Any organization where LLM costs are a significant budget item

== Example Scenarios

These scenarios demonstrate how different organizations use Agent Fabric to bring LLM costs under control.

=== Scenario 1: Enterprise-Wide Cost Visibility

*Challenge:* A large organization has agents deployed across multiple business units but no visibility into which ones are driving LLM costs.

With Agent Fabric you get complete cost visibility:

. Route all LLM traffic through the Model Proxy.
. Tag requests by business unit, application, and agent.
. Generate cost dashboards showing usage patterns.
. Identify high-cost agents and opportunities for optimization.

*Result:* Every dollar of LLM spend maps to the business unit, application, and agent that drove it. Leaders can see which deployments cost the most and target optimization where it pays off, instead of splitting an unattributed bill across teams.

=== Scenario 2: Semantic Routing for Customer Support

*Challenge:* A customer support agent system uses expensive models for all queries, including simple lookups.

With semantic routing you cut cost without sacrificing quality:

. Configure semantic routing rules:
* Simple queries (order status, account lookups) route to a cost-effective model.
* Complex queries (troubleshooting, technical issues) route to an advanced model.
. The Model Proxy analyzes each request and routes it appropriately.
. Monitor quality metrics to ensure the customer experience isn't impacted.

*Result:* Routine lookups, which are often the majority of support traffic, move to a model that can cost roughly an order of magnitude less per query, while complex cases still reach a more advanced, higher-cost model. Average cost per query drops with no measurable change in resolution quality.

=== Scenario 3: Budget Controls for Development Teams

*Challenge:* Development teams experimenting with agents have no spending limits, leading to budget surprises.

With Model Wallets you get budgets agents can't overrun:

. Create a separate Model Proxy for each team, with budget limits configured per provider.
. Set a daily, weekly, or monthly limit in dollars (USD) or tokens depending on how the team tracks spend.
. Enable hard limits so requests are blocked when a budget is reached rather than allowed to overrun.
. Give teams visibility into budget consumption through the Model Proxy dashboard.

*Result:* A runaway experiment stops at its cap instead of surfacing as a month-end invoice. Finance gets predictable per-team spend, and teams keep the autonomy to experiment within a limit they can see.

=== Scenario 4: Multi-Model Optimization

*Challenge:* An organization uses multiple LLM providers but doesn't know which models are most cost-effective for its use cases.

With Agent Fabric you get evidence-based model selection:

. Deploy agents with flexible model configuration.
. Agent Fabric tracks cost and quality metrics per model.
. Analyze which models deliver the best cost/quality ratio for each use case.
. Adjust routing rules based on the data.

*Result:* Model selection becomes an evidence-based decision instead of a default. Each use case runs on the provider that delivers the best cost and quality ratio for it, and routing keeps pace as providers change pricing or release new models.

== Implementation Steps

Follow these steps to set up cost management in Agent Fabric.

=== Step 1: Deploy the Model Proxy

. Set up the Model Proxy as part of your Omni Gateway deployment.
. Configure integration with your LLM providers.
. Route agent traffic through the Model Proxy.

=== Step 2: Implement Usage Tracking

. Tag all requests with relevant metadata:
* Business unit or cost center
* Application name
* Agent identifier
* User or session ID
. Configure logging and metrics collection.
. Set up dashboards for cost visibility.

=== Step 3: Establish Baseline Costs

. Monitor usage patterns for one to two weeks without optimization.
. Identify current cost drivers.
. Categorize query types by complexity and frequency.
. Calculate baseline cost metrics.

=== Step 4: Configure Semantic Routing

. Define query complexity categories.
. Assign an appropriate model to each category.
. Create routing rules in the Model Proxy.
. Test routing with sample queries to ensure quality.

=== Step 5: Set Budget Controls with Model Wallets

. Create a Model Proxy per team, application, or agent to scope budget controls to a client identity.
. Add a budget for each provider the Model Proxy routes to, choosing a daily, weekly, or monthly period.
. Set the limit in dollars (USD) or tokens, and enable hard limits where overruns are unacceptable so requests are blocked when a limit is reached.
. Share the Model Proxy dashboard with teams so they can track budget consumption per provider.

=== Step 6: Monitor and Optimize

. Track cost trends after optimization.
. Monitor quality metrics to ensure no degradation.
. Refine routing rules based on results.
. Share cost savings and optimization wins.

== Metrics to Track

Track these metrics to measure and improve the impact of cost control.

=== Cost Metrics

* Total token usage by time period
* Cost per application, agent, and user
* Cost per model and provider
* Average cost per query

=== Usage Metrics

* Queries per time period
* Model distribution (which models handle what percentage of queries)
* Token usage distribution by query complexity
* Peak usage times and patterns

=== Quality Metrics

* Response quality scores
* User satisfaction ratings
* Error rates by model
* Average response time by model

=== Optimization Metrics

* Cost savings from semantic routing
* Percentage of queries routed to cost-effective models
* Budget adherence by team and application
* ROI of optimization efforts

== Related Documentation

* xref:agent-fabric-use-cases.adoc[]

== Next Steps

With cost controls in place, you're ready to:

* xref:af-use-case-policy-enforcement.adoc[Add policy enforcement for governance]
* xref:use-case-orchestration.adoc[Build complex workflows with cost awareness]
* xref:use-case-identity.adoc[Move to production with identity and cost controls]
Loading