Skip to main content

Cascading Failures in Multi-Agent Systems: Monitor and Control Agents with MLflow Tracing

Summary

  • Distributed complexity: Cascading errors, memory pollution and deadlocks are multi-agent risks.
  • Active observability: MLflow traces with OpenTelemetry export enable control and visibility.
  • Gateway controls: Unity AI Gateway guardrails prevent PII leaks and block unauthorized actions.

Cascading Failures in Multi-Agent Systems: Monitor and Control Agents with MLflow Tracing

Watch: Cascading Failures in Multi-Agent Systems: Monitor and Control Agents with MLflow Tracing
Talk by Oleksandra Bovkun, Sr. Developer Advocate, Databricks
Monitoring AI agents in production means treating a multi-agent system as a distributed system: capture every step with MLflow tracing and autolog, export traces in OpenTelemetry, then move from passive observability to active control with Unity AI Gateway and application-level guardrails. This video shows how cascading errors, polluted shared memory and agent deadlocks actually happen, including a three-agent example where ambiguous orchestration instructions cascade into wrong financial advice, and what to watch across operations, compliance, cost and quality.
Oleksandra Bovkun shows a three-agent example where ambiguous instructions from an orchestration agent cascade into a wrong answer from a financial advice agent, and why multi-agent systems are distributed systems. Learn how MLflow autolog captures a timeline of each step and exports traces in OpenTelemetry format, the four control dimensions (operational efficiency, compliance and auditing, cost, quality and value), how Unity AI Gateway restricts PII and isolates credentials, and how to build a kill switch from traces, such as blocking transfers over five thousand without MFA. It closes with three levels of quality evaluation: handoffs, coordination and system quality.

Chapters

FAQs

Why do agents misbehave in production even when they worked in testing?

This video opens with a rogue Slack post showing how agents cause unexpected real-world effects. When agents interact with each other and external systems outside sandbox environments, cascading errors, memory pollution and deadlocks can occur.

How does cascading error work in multi-agent orchestration?

This video describes a three-agent example where ambiguous instructions from an orchestration agent cascade into wrong financial advice from a financial agent. Multi-agent systems need careful error handling and validation at each handoff.

What four dimensions should I monitor for agent control?

This video identifies operational efficiency, compliance and auditing, cost, and quality and value. MLflow tracing captures these metrics, while Unity AI Gateway provides the first line of defense with restrictions on PII and credential isolation.

How do I build a kill switch from traces?

This video shows how to build guardrails like blocking transfers over five thousand without MFA using MLflow traces. Application-level guardrails give operators real control to prevent wrong actions.

Full transcript

00:00 Introduction

Good day everyone. This is the last day of the conference, but I am very grateful that you came to listen to my talk. I am Alexandra. I'm a Developer Advocate at Databricks, and today I want to spend most of my time talking about the intersection of AI systems and manufacturing realities. And I realized that creating an agent application is the easy part. It gets complicated when you actually start deploying these agents into production, and when these agents start communicating with each other and interacting with real systems outside of their tiny sandbox environment .
Over the next 20 minutes, I want to show you what happens when you deploy an agent to production and what you can do to avoid potential mistakes. So, let me start with the script. Imagine you were testing your agent in a sandbox on your laptop while developing something. Everything was going well until a moment later you receive a notification from a colleague: “Hey, why are you posting something to our general Slack channel? » And the most interesting thing is not that this is happening, right?

00:46 Why agents misbehave in production: the rogue Slack post

This is a situation we have all been in. The problem is that, first of all, you did n't know your agent was doing this. And secondly, you didn't know why he was doing it. And besides that small, annoying incident with colleagues, imagine if it wasn't Slack, but someone's bank account or an invoice sent to a client five times. So, first, we've all been introduced to creating agents, single- agent applications. Creating them has its challenges, but ultimately it's a pretty easy part.
It gets a little more complicated when you start deploying single- agent applications to production. So, essentially, the complexity has increased in two directions over the past few years. On the one hand, the complexity lies in the interaction of agents with real systems, and on the other hand, in the use of a larger number of agents or multi-agent systems. But multi-agent systems in production are, in essence, a disaster.
There are many situations that can go wrong, and that's exactly what I want to discuss with you and show you what mistakes can occur and what can be done to prevent them. So let's take a look at this agent system. Imagine you have three agents. You have an orchestration agent, a financial settlement agent, and a financial advice agent. So, first, somewhere between the orchestration agent and the financial calculations, correct but somewhat ambiguous instructions were sent.

02:40 Cascading errors in multi-agent systems

A step later, financial calculations complete the task but misinterpret the context and business rules. So, what happens next? The financial advice agent gives a completely wrong result, even though the analysis was performed correctly and in accordance with your assumptions and processes. This is a typical example of a cascading error. Eventually, one agent's error propagated down the chain to the last one, and while you're debugging the last agent, the real problem has arisen five levels higher.

03:59 Memory pollution and agent deadlocks

The situation becomes even more complicated when you have a shared memory. This is a common scenario, called memory pollution, where one agent contributes somewhat inaccurate or erroneous context to memory, and all other agents rely on it. The situation becomes even more complicated if, for example, one agent expects a response from another, and they essentially enter a state of mutual deadlock. If you've worked with databases, you know that deadlock is a common situation where two tables try to update each other and end up deadlocked .
But the difficulty is that from your side all you see is that the operation is taking forever. Your response time is, say, 5 minutes. You don't understand that these agents are actually just "stuck." So, the main idea I want to convey with this presentation is: multi-agent systems are, in essence, distributed software systems, but with a slight nuance. When comparing monitoring and observability for a single-agent application, you're looking at the input data, right?

04:59 Multi-agent systems as distributed systems: what to monitor

What is your request? What are the input parameters? You capture the original data. That is, the results you expected. You also check, for example, tool definitions, triggered skills, etc. But when moving to a multi-agent system, in addition to everything you need to capture for a single agent, you also need to track orchestration, routing, data exchange between agents, and latency at each stage. So, the problems you may face become much broader than the problems of one individual agent.

05:58 MLflow tracing, autolog and OpenTelemetry

That's why MLflow tracing is a powerful tool that gives significant visibility into what can be done. So, MLflow is an open source framework . It is also part of the Databricks ecosystem. But with one simple line like “MLflow autolog,” you can already start collecting a lot of information about your agent. What's amazing is that all of this information is essentially captured in the form of a timeline. So, you can easily see which step of the process took a long time, which was perhaps unnecessary, etc.
You can start exploring your multi-agent system, each individual step and the system as a whole. MLFlow also allows you to save these traces in OpenTelemetry format. If you are familiar with any observability system, OpenTelemetry is the de facto standard that can be used to collect trace data across the entire ecosystem, which means integrating your multi-agent system data with the rest of the platform. And this is where it gets interesting, especially when you move to a productive environment, because you want to know more than just what your agent is doing.
You also want to see how the rest of the ecosystem or platform reacts to it or interacts with it. So, essentially, we've looked at a reactive approach, right? For example, collecting traces, gathering information, etc. But ultimately, you want to move from a reactive approach to a proactive one. So , essentially, you want to move from observability to active control. Because knowing that your agent is doing something wrong—it's great, right?

07:41 From observability to active control

Knowledge is power. But if you can't control it, this knowledge is just an interesting story. This is a great fact, but it doesn't actually change the behavior of your system. I can give an example. It's cool to know that your agent has invoiced the client seven times. It's not good to know that it was sent to the client seven times. So, ultimately you want to have an active monitor. And I would like to introduce you to the concept of how you can think about control, observability, and active agent management, especially for a multi-agent system.

08:38 Four dimensions: operations, compliance, cost, quality

I want you to look at this in four dimensions. Each dimension is essentially interconnected with all the others. And having just one of them is not enough to make sure that the system is working correctly. So what are these four dimensions? First of all, it is operational efficiency. Operational health is something that you, as a software developer, data engineer, or platform engineer, already collect naturally. This is all your operational data.
For example, how efficient is my system? Is my system fast enough? Does my system call the right tools in the right sequence, etc.? So, ultimately, any information: how many times the call was made, how long it took, what the delay was, etc. The second dimension that is extremely important , especially in agent workflows, is compliance and auditing. If you can't control or restrict your agent from sending personally identifiable information ( PII) to the outside world, then you definitely can't run that agent in production.
The third dimension is, of course, cost management. Throughout the conference, you've probably heard more than once that basically everyone wants to at least know how much a certain agent system costs, and even better—try to reduce these costs to ensure the efficiency of your agent. And the last point is perhaps the most difficult and at the same time the most valuable . This is quality and value. You must know and be able to argue that any agent system, especially a multi-agent one, that you build really delivers business value.
After all, in the end, it doesn't matter what system you built, how cool, fast, or cost-effective it is , if it doesn't do anything for your business. So, there are two things I would like to draw your particular attention to. First, there is the Unity AI Gateway. There has been a lot of talk about the Unity AI Gateway, but I want you to consider it as the first line of defense for all of your agents from a cost control as well as management perspective.

10:55 Unity AI Gateway as the first line of defense

Taking a step back, compliance , auditing, and cost control are what you get from Unity AI Gateway. It allows you, for example, to restrict sending certain personally identifiable information (PII) to external systems or receiving it from outside, etc. It allows you to ensure that credentials are properly isolated so that your agent does not have access to them. But why do I call it the first line of defense? Because there is a second line of defense—these are application-level security barriers (guardrails) .
Unity AI Gateway can provide a lot, but it does not know the logic of your agent and the logic of your multi-agent system. After all, as I said before, knowing that something is happening is great. The controls are much better and give you enough information to make sure this agent can work in a production environment. This is, of course, just a code sample. In reality, everything will be much more complicated. But I wanted to show an example here of using MLflow traces—the data we collect for each step of our multi-agent system and each system in general, to be able to apply an active “kill switch,” if you will , to control that the agent doesn’t do anything malicious.

12:28 Guardrails and a kill switch built on MLflow traces

This particular example essentially prevents the agent from executing an operation unless a certain condition is met. In this example, we say that you cannot transfer more than five thousand currency units without verification via MFA. And this is something I would like you to actually use in your projects, in your multi-agent systems and so on. Using MLflow traces is not just passively collecting information that can only be used for debugging or something like that.
It is also a mechanism whose data can be used to actively monitor, control, and configure active fuses for your specific application. This does not apply to personally identifiable information ( PII). This applies to your own logic that you want to implement in your application. So, the last point for the full picture—how it works in a multi-agent system. I told you that value, namely quality and value, is the most difficult part of a multi-agent system.

14:07 Evaluating multi-agent quality at three levels

I would like to evaluate the quality of the agent's work. I would like to evaluate it on three levels. And this is inherent in multi-agent systems. So, first, the lowest level is the transfer of authority between agents. Essentially, how information is passed from one agent to another. And this is very important, because otherwise you will not be able to resolve conflicts effectively. Isn't that right? You simply won't be able to know what's going on.
Even if you know what is happening inside an individual agent, you need to know what information was passed between them. The second level, which is located above it, is coordination or, in essence, conflict resolution. Did my agent, such as a supervising agent or another agent, send the information to the correct recipient? Has a deadlock occurred? Was there an expectation between the agents for each other or something like that?
And of course, at the highest level you have system quality assessment and quality control. So , there was a lot of information in a very short time. If you're wondering what it was and don't understand anything , I have clear steps for you. First of all, you need to gather information about your agents. And MLflow is one of the tools that allows you to do this very easily. If you are not already doing so, especially for multi-agent systems, start with MLflow autolog.

15:21 Next steps for production multi-agent systems

It provides a lot of collected information “out of the box,” and anything else you need can be added later. Apply the fourth dimension of control to your multi-agent system. Think about whether you have operational analytics for your multi-agent system. Do you have cost control? Do you have control over the management of confidential information? And most importantly: do you know if your agent is actually making a profit?
And what does it mean that an agent is beneficial in your system? And lastly: learn more about MLflow, what it does, and how it works. This will definitely help get your agents into a productive environment and avoid embarrassing mistakes like sending the wrong thing to a public Slack channel. If you want to learn more, I'd be happy to chat on LinkedIn. I have also placed all of these examples in a repository on GitHub.
This is a somewhat simplified example, but it gives a holistic idea of how it can be done. So check it out or contact me directly. I would be happy to discuss this. The summit is almost over. I don't know if you will attend any more sessions or just stroll through the exhibition. Enjoy, and I hope you had a great time. Thank you.

Learn more about the Databricks Data and AI platform.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.