MuleSoft

Mastering the AI Mesh: An In-Depth Guide to MuleSoft Agent Fabric

MuleSoft Agent Fabrics

What is Agent Fabric?

MuleSoft Agent Fabric is an enterprise-grade orchestration and governance platform for AI agents – part of Salesforce’s MuleSoft suite. It acts as a control layer (fabric) that allows organizations to discover, orchestrate, govern, and observe the growing number of AI agents, tools, and models operating across their business systems.

Complex tasks often require a series of steps, with each step‌ handled by a different agent or tool. Managing this process manually is difficult and error-prone. An agent network (a network of agents in a domain) acts as a coordinated group for defining, validating, and executing these multistep processes.

Why We Need MuleSoft Agent Fabric?

As organizations adopt AI agents (OpenAI assistants, Salesforce Einstein, or custom bots), they often face disconnected, siloed agents with no centralized control, security, or visibility.

Problems Without Agent Fabric:

  1. Agent Sprawl: Multiple teams create similar agents, leading to duplication and inconsistent behaviour.
  2. Lack of Governance: Agents can access data or systems without clear control, making compliance and auditing difficult.
  3. Integration Complexity: Agents need to interact with APIs and other agents safely; without orchestration, these connections are fragile.
  4. No Observability: Failures or wrong decisions are hard to trace due to missing centralized logging and monitoring.

Hence, MuleSoft Agent Fabric provides a centralized, secure, and observable platform to orchestrate, manage, and monitor all agents efficiently.

Key Advantages of Agent Fabric:

Agent Fabric manages and coordinates the execution of agents across your enterprise, regardless of where they’re deployed.

  1. Unified Agent Management: Teams can now discover, reuse and govern agents in a single place within MuleSoft, rather than managing them across different platforms, creating an enterprise app store for AI agents.
  2. Governance and Security: Built-In All interactions with an agent are subject to security controls to regulate data access, enforce compliance, and ensure responsible AI usage.
  3. Seamless Collaboration: Agents can also issue messages, or delegate tasks, for example, an “Order Processing Agent” can delegate a task to an “Invoice Agent” or “Logistics Agent”.
  4. End-to-End Observability: Visual tracking and analytics can provide perceptions into the agents’ decision-making, the bottlenecks in workflows, and the areas in which improvements may be made.

Important terms in Agent Fabric:

Agent Network

An agent network consists of brokers, agents, and MCP servers in the same domain. You define an agent network in a YAML template in your agent network project. The MuleSoft Dev Agent can help create and configure your YAML for you.

Agent Network Components:

Agent networks support brokers, A2A-compliant agents, and Model Context Protocol (MCP) servers.

  • Broker
  • An intelligent routing service that coordinates task delegation across specialized A2A-compliant agents in your enterprise. A broker is defined by the agents and MCP servers it can leverage to accomplish tasks. Brokers originate from MuleSoft and are referenced in the agent network YAML.
  • After you publish your agent network, brokers appear as specialized agents in Anypoint Exchange and can be reused by other brokers.
  • Agent
  • An autonomous software component that uses goals, context, and available tools, often via a large language model (LLM), to decide and execute actions on behalf of a user or system.
  • Agents can be defined either locally in the agent network or externally in a different agent network or elsewhere in your company. Your agent network can use both locally defined and externally defined agents to complete tasks.
  • Agent assets must be A2A-compliant.
  • MCP server
  • A service that implements the Model Context Protocol (MCP) to expose tools and data to AI clients, enabling LLMs to invoke external capabilities through a standard interface.
  • MCP servers can be defined either locally in the agent network or externally in a different agent network or elsewhere in your company. Your agent network can use both locally defined and externally defined MCP servers to complete tasks.

Core Capabilities of MuleSoft Agent Fabric: 

  1. Discover

Before you can manage your agents, you need to know what you have. The discovery phase is about cataloging every agentic asset in your enterprise.A centralized catalog (Agent Registry) in Anypoint Exchange for registering and discovering all AI agents, tools, and automation assets including those using Model Context Protocol (MCP) and Agent2Agent (A2A) making them reusable and easy to incorporate into workflows.

  • You can find agent, LLM, and MCP server assets in the Agents & Tools (New) tab.

Benefits: 

Quickly discover and reuse AI agents

  • Prevent duplication across teams
  • Compose multiple agents into larger workflows

  1. Orchestrate

Once agents are discoverable, you need to make them work together to achieve complex business outcomes.

MuleSoft Agent Broker is an intelligent routing service that organizes AI agents and tools into business-focused domains and dynamically routes tasks across them. Powered by your LLM of choice and connected through A2A and MCP, it:

    1. Organizes agents into business-focused domains
    2. Dynamically routes tasks to the best-fit agent
    3. Executes complex, multi-step processes seamlessly
  1. Govern

To operate safely at scale, you need to apply consistent security and compliance rules to all agent activity. MuleSoft Agent Governance provides enterprise-grade guardrails that apply security, compliance, and policy controls to every agent interaction. This allows organizations to scale AI adoption safely, helping to ensure every action is consistent, secure, and aligned with enterprise and regulatory requirements.

  • Flex Gateway Support for MCP & A2A is the high-performance gateway that extends MuleSoft’s governance to secure and inspect all agent-to-system (A2S) and agent-to-agent (A2A) flows.

The Bidirectional Protection Checklist:

To ensure security across dynamic interactions within the Agent Fabric, you need two types of gateways deployed:

  1. Ingress Flex Gateway: Enforces policies on traffic coming into the broker and API endpoints.
  2. Egress Flex Gateway: Enforces policies on traffic leaving brokers and agents toward external services.
  • This dual layer of protection allows you to apply enterprise-grade guardrails using specialized policies.
  • Here are some of the standard policies supported by MuleSoft Agent Fabric (via Anypoint Flex Gateway) for agents (both agent-to-agent (A2A) and agent-to-system (MCP) interactions):
  • A2A – Agent Card Rewrite – Rewrites the agent card URL so that the agent’s metadata is correctly proxied through the gateway.
  • A2A – PII Detector – Detects personally identifiable information in agent messages and prevents data leakage.
  • A2A – Prompt Decorator – Adds or modifies prompt context before agents handle requests by injecting metadata or clarifications.
  • A2A/MCP – Schema Validation – Validates that requests follow A2A or MCP protocol structures to block malformed payloads.
  • MCP – Attribute-Based Access Control (ABAC) – Controls access to MCP tools and resources based on user roles, headers, claims, or IP attributes.
  • A2A/MCP – Rate Limiting / Spike Protection – Limits request rates and protects against sudden traffic spikes from agent interactions.
  • A2A/MCP – SSE Logging – Logs Server-Sent Events in streaming interactions for auditing and compliance purposes.

  1. Visualize

Finally, you need to understand how your agent network is performing to optimize and troubleshoot it. With agents now executing actions autonomously, you need transparency to build trust. The MuleSoft Agent Visualizer provides the dedicated observability layer needed to monitor, audit, and continuously optimize your agent workforce.

  • Visualizer transforms complex, multi-agent workflows into an interactive, visual map. This gives architects and IT teams complete situational awareness—you can see all connected agents, their relationships, and the direction of calls.

Benefits: 

  • Identify bottlenecks and optimize processes
  • Build trust in autonomous AI agents across the enterprise

NOTE: As my organization is in the US East region, this feature is currently not available, as Agent Fabric is still being rolled out regionally and is mainly supported in the US Central control plane.

Model Context Protocol

The Model Context Protocol (MCP) defines how an AI agent interacts with and utilizes individual tools and resources, such as a database or an API.

This protocol offers the following capabilities:

  • Standardizes how AI models and agents connect to and interact with tools, APIs, and other external resources.
  • Defines a structured way to describe tool capabilities, similar to function calling in Large Language Models.
  • Passes inputs to tools and receives structured outputs.
  • Supports common use cases, such as an LLM calling an external API, an agent querying a database, or an agent connecting to predefined functions.

Agent2Agent Protocol

The Agent2Agent Protocol focuses on enabling different agents to collaborate with one another to achieve a common goal.

This protocol offers the following capabilities:

  • Standardizes how independent, often opaque, AI agents communicate and collaborate as peers.
  • Provides an application-level protocol for agents to discover each other, negotiate interactions, manage shared tasks, and exchange conversational context and complex data.
  • Supports typical use cases, including a customer service agent delegating an inquiry to a billing agent, or a travel agent coordinating with flight, hotel, and activity agents.

Why Different Protocols?

Both the MCP and A2A protocols are essential for building complex AI systems, and they address distinct but highly complementary needs. The distinction between A2A and MCP depends on what an agent interacts with.

  • Tools and Resources (MCP Domain):
    • Characteristics: These are typically primitives with well-defined, structured inputs and outputs. They perform specific, often stateless, functions. Examples include a calculator, a database query API, or a weather lookup service.
    • Purpose: Agents use tools to gather information and perform discrete functions.
  • Agents (A2A domain):
    • Characteristics: These are more autonomous systems. They reason, plan, use multiple tools, maintain state over longer interactions, and engage in complex, often multi-turn dialogues to achieve novel or evolving tasks.
    • Purpose: Agents collaborate with other agents to tackle broader, more complex goals.

Prerequisites: Gearing up for Agent Fabric

Before you build your first agent network, you need to set up your environment correctly. A little preparation ensures you can start creating quickly and easily. Here’s what you’ll need:

Anypoint Platform prerequisites

  • An Anypoint Platform Titanium package
  • A tenant relationship with a trusted Salesforce organization
  • Managed Flex Gateway with target space entitlements
  • An OpenAI instance (either Azure OpenAI or OpenAI Direct API) and login credentials

MuleSoft Dev Agents

A MuleSoft Dev Agent in Agent Fabric is a developer-created agent that automates tasks or connects systems within an enterprise, making it easier to build, orchestrate, and manage complex workflows across different platforms.

How to Enable MuleSoft Dev Agent in Visual Studio:

Step1:

If you don’t have Visual Studio Code installed, download and install it from the official website: https://code.visualstudio.com/

Step-2:

After installing Visual Studio Code, go to the Extensions section and search for Anypoint Extension Pack, then click Install to add it.

Step-3:

After installing the extension, restart the Studio — you’ll then see the MuleSoft Developer Agent icon appear on the left panel.

Step-4:

Then, log in to your respective Anypoint Platform account to access & leverage all the integrated Anypoint Platform features. After logging in you might encounter the below error (attached the image below).

This usually happens when your Salesforce org (tenant) and your Anypoint Platform org (tenant) are not yet linked — meaning the tenant relationship hasn’t been established.

Step-5:

You need to connect your Anypoint Platform org to your Salesforce org. Log in to your Anypoint Platform, navigate to Access Management → Salesforce, click Accept to enable Agent Force for Anypoint Platform, then select Add Salesforce Org, log in with your Salesforce administrator credentials

Step-6:

When you select “Add Salesforce Org”, a pop-up appears asking for the Salesforce Org Tenant Key. You can obtain this tenant key from your Salesforce org by navigating to MuleSoft Setup inside Salesforce.

Step-7:

Log in to your Salesforce organization with admin credentials, go to Setup, type MuleSoft in the Quick Find box, and select MuleSoft → Anypoint Platform Setup.

Step-8: When you click on “Complete the Connection” in Salesforce, a pop-up like below appears. Copy the displayed Salesforce Org Tenant Key from this window.

Step-9:

Navigate to Access Management → Salesforce → Add Salesforce Org, then paste the copied tenant key to complete the connection between Salesforce and Anypoint Platform and also give the name associated with your Anypoint Platform account.

Step-10:

Once the Salesforce tenant key is added successfully in Anypoint Platform, a confirmation window appears showing the Anypoint Platform Org Key. Copy this organization key — you’ll need to paste it back into Salesforce to complete the connection setup.

Step-11:

Paste the Anypoint Platform Organization Key (copied from Anypoint Platform) into the Anypoint Platform Organization ID field in Salesforce, then click Connect to complete the integration between Salesforce and Anypoint Platform.

Step-12:

Once the connection is successfully established, you’ll see confirmation details displayed in both Salesforce and Anypoint Platform.

Step-13:

Once the setup is complete, restart Visual Studio Code, then log in to your Anypoint Platform account. After successful login, you’ll see the MuleSoft Dev Agent interface open in VS Code, indicating that the connection and setup are successful.

Step-14:

The Auto-approve Settings let you choose the level of automation and permissions you want to grant the MuleSoft Dev Agent — you can enable or disable specific options based on your project needs and security preferences.

How to Create an Agent Network Project in Visual Studio

Step-1:

The MuleSoft Dev Agent can automatically generate an Agent Network project. Click the Dev Agent icon in Anypoint Code Builder and describe the agent network you want to build—such as the brokers, agents, MCP servers, and LLMs you plan to include. The Dev Agent will then create the initial project structure for you.

If you prefer not to use the MuleSoft Dev Agent, you can manually create the Agent Network project by following the steps below.

In Visual Studio Code, open the Anypoint Code Builder panel and select ‘Create an Agent Network’ from the Quick Actions menu to start a new Agent Network project.

Step-2:

Provide the project name, choose a save location, select the appropriate Business Group, and click Create to generate the Agent Network project.

Step-3:

Anypoint Code Builder automatically creates the foundational files for your Agent Network project. These files define your network’s configuration and structure

  • agent-network.yaml – This file defines the complete Agent Network, including brokers, agents, MCP servers, LLMs, policies, and authentication settings.
  • exchange.json – Lists all the Anypoint Exchange assets referenced by the Agent Network and includes variables used by the project

The visual canvas provides a read-only diagram of your agent-network.yaml. Selecting any component highlights its corresponding code in the editor.

Step-4:

Next, configure your agent network project for your unique business needs by defining your agent network specification.

Orchestrate AI Agents with Enterprise-Grade Control

Struggling with fragmented AI agents, lack of governance, or complex integrations? TGH helps you design and implement MuleSoft Agent Fabric to orchestrate, secure, and scale your AI ecosystem with full visibility and control.

👉 From agent orchestration and API integrations to governance and observability, we enable enterprises to build intelligent, connected, and future-ready AI architectures.

📞 Call Us: +91 88106 10395
🌐 Visit: www.techygeekhub.com
🔗 Talk to Our Experts: https://techygeekhub.com/contact-us/

Transform your AI strategy with TGH — build a powerful, governed AI Mesh today.

contact us

Author

Bandi Madhuri

Leave a comment

Your email address will not be published. Required fields are marked *