Section Insights
Introduction to AI Infrastructure at Modal
What does Modal do and what is the speaker's role?
Modal builds AI infrastructure, including sandboxes and LLM inference, and the speaker works on internal agents while assisting customers in building their own.
- Modal provides AI infrastructure for deploying agents.
- The speaker has insights from working with various customer architectures.
- There's a shift from tool calls to network access restrictions in agent design.
Transitioning from Tool Calls to Proxy Rules
How has the approach to agent functionality evolved?
The speaker has shifted from writing tools to creating proxy rules that allow agents to directly access APIs, enhancing their capabilities.
- Agents can now access APIs directly, improving flexibility.
- Proxy rules enable more complex operations than traditional tool calls.
- This approach allows agents to perform higher-order reasoning.
The Gator Agent: A Case Study
What is Gator and what capabilities does it have?
Gator is a read-only internal agent that accesses various data sources to answer queries and analyze data without modifying the codebase.
- Gator can pull logs and billing information for analysis.
- It demonstrates the need for agents to access data programmatically.
- The initial architecture relied heavily on tool calls, limiting its capabilities.
Enhancing Gator's Functionality
What improvements were made to Gator's architecture?
To enhance Gator, it was given the ability to write code programmatically, allowing for more complex data analysis and visualization.
- Agents can be more effective when allowed to write code on a scratchpad.
- Accessing tools programmatically enables richer functionality.
- The architecture leverages sidecars for secure credential management.
Implementing Proxy Architecture
How does the proxy architecture work for Gator?
The proxy inspects requests and determines if they are valid, allowing Gator to use various APIs while maintaining security through network boundaries.
- The proxy architecture allows agents to call command line applications effectively.
- Security is managed at the network boundary, enhancing agent capabilities.
- Sidecars provide a secure environment for credential management.
Transcript
0:07 At Modal, we build AI infrastructure including sandboxes and LLM inference. So a lot of our customers are using us to deploy their own agents on our infrastructure, particularly our our sandboxes. I work on agents at Modal, so I build internal agents, but I also help our customers who are building these agents. So I'm in a unique position where I get to talk to a lot of customers and see their architectures around agents. And today I wanted to talk about one pattern that I've started to notice and incorporate in my own agents that's sort of an evolution of how people are kind of transitioning from thinking about tool calls to network access restrictions.
0:53 So as a concrete example, let's say you have an agent that you want to give access to Datadog logs. A typical way that you could do that is through tool calling, maybe you would attach Datadog's MCP server or write some of your own tools for accessing Datadog. The problem with that is that the agent can't really compose those tools that it's it's a very rigid way of of calling a tool where you're going out to Datadog, you're getting results back that end up in your model context. So you it kind of restricts the model to doing lower level thinking, lower level reasoning, not being able to say chain a Datadog call with a grep or with a unpacking a JSON object or something like that.
1:44 And these models have gotten really good at coding. So we know that you know these models can think in higher order terms and compose these operations. But but just not really able to when we think in a in a tool call mindset. So, the transformation that I that I've had happen and and that I've seen happen with some of our customers, I would kind of sum up as I used to write tools, now I write proxy rules.
2:12 so the idea here is like in the DataDog example, instead of a tool call, let's just give the agent the ability to call the DataDog API, which means that it can run the DataDog CLI, it can use the DataDog SDK, it can write a Python script that talks to DataDog, and you know, DataDog is an example here, but this also applies to all of the different providers that could could could be accessing data on. And the important aspect here is that the proxy rules are code. These are not just kind of declarative, you can access DataDog, you can send post requests.
2:46 what I've found and and what some of our customers have found is that you actually have to go deeper, you have to kind of be able to intercept at the protocol level the messages going out. in order to be able to kind of get the fine-grained restrictions on network access that you want. But, once you do that, once you can restrict the network that goes out to DataDog, you no longer have to think about the tool call boundary as being where the security boundary is for these agents and where the permission boundary lives, which gives the the agents a lot more degrees of freedom to use these tools, use these remote resources as they would like while still being bound by the same access restrictions that they would be otherwise.
3:28 so to make this concrete, I want to talk about Gator. Gator is an internal agent that I built at Modal. it's short for investigator, so as you can imagine, it's basically a a read-only agent. It has access to a lot of read-only resources. this is not an agent that's going out and modifying the code base, but it is able to, you know, pull DataDog logs, pull billing information from our billing provider. can answer questions like why was this specific customer's payment blocked?
3:59 maybe there's some fraud rule that was hit. can also do more sophisticated things like plot a histogram of the warnings on this specific internal service over time and identify the pull request that landed that is likely to have caused it. so, you know, it has access to things like the GitHub API, a bunch of these resources, ClickHouse for audit logs, these different data providers that it has access to programmatically.
4:30 The first version of Gator, the architecture looked something like this. You had the agent and then you had a bunch of tool calls. The first, you know, three or four weeks of building this agent was just me sitting down, figuring out what tool calls it needed. if we wanted DataDog, we'd hook up the DataDog MCP server. for internal data sources, we'd write kind of internal bespoke tools for accessing that data. and so it it did a lot. Like it could it was an improvement over other things we had just because of the sheer amount of tools it had access to.
5:05 But what it couldn't do was things like create a graph of this, you know, metric over time or these log occurrences over time. So to do that, what we realized was we needed to give it the ability to write code, even though it's not a coding agent, even though it's never going to commit a PR, it needed to be able to kind of write code on a scratchpad. And that meant it needed to access these tools programmatically.
5:29 and this is not a new idea. Like people have been recognizing that agents are good at writing code and actually often better at writing code to call tools than they are at calling tools for years. So, what I'm trying to to convey here is not so much like that this is a good idea cuz a lot of you probably have already experienced that this is a good idea. when you use a local cloud code session, this is doing, you know, this is running shell commands.
5:57 but the to to tell you about the sort of architecture that makes this work. so the way that we were able to get this to work is we have this is a a modal feature in sandboxes called sidecars that gives you a separate isolation environment within a sandbox. And the nice thing about that is that that's a very natural place to put this proxy. we can give you know, your GitHub credentials, your DataDog credentials, your actual real credentials live in the sidecar. And what happens is that as the sandbox is using the CLI tools or writing against an SDK or even just using a raw curl call to make a tool call, those are all going through the proxy. The proxy is saying is the agent allowed to do this? And if it is, injecting the real credentials into that request and forwarding it on.
6:53 and in the case of of Gator, kind of looks the architecture looks something like this. You've got the proxy looks at where the request is bound to and then selects different handlers. So in the proxy code base, there's you know, a datadog.py, github.py, modal.py that has the actual specific rules for unpacking that request. it's, you know, able to inspect the actual contents and decide is this valid? And that that can be fairly complex. in the case of something like GitHub that means looking at a GraphQL statement because get GitHub uses a GraphQL API. So it's not as straightforward as sort of just looking at the host header and and kind of determining from there.
7:36 So to wrap this up, I I just want to summarize. So it's I think a really good idea to let agents call command line applications. They can do a lot with them. They can pipe them into different, you know, they can they can construct a whole bash pipeline. They don't have to, you know, ingest the output directly into their context, which is both slow and expensive. They can kind of think at a higher level about these things. And the way to make this work is to move the security to the network boundary with the proxy that can actually understand the traffic going through it.
8:13 And finally the piece of infrastructure that we have at Model for this is called sidecars. so yeah, that's that's all I have, but if you want to talk to some Model folks, I'll be downstairs with some other folks at Model. Thank you.
Summary
- Modal builds AI infrastructure for deploying agents, focusing on sandboxes and LLM inference.
- Transitioning from tool calls to proxy rules allows agents to access APIs directly, enhancing their capabilities.
- Agents can now compose operations, such as chaining API calls and processing data, rather than being limited to rigid tool calls.
- The internal agent "Gator" was developed to access various read-only resources, improving data retrieval and analysis.
- The architecture utilizes sidecars to manage security and access, allowing agents to run commands while ensuring proper credential handling.
- This approach enables agents to think at a higher level, constructing complex operations without being constrained by traditional tool call boundaries.
- The speaker emphasizes the importance of understanding network traffic for effective security management in agent operations.
Questions Answered
What does Modal do and what is the speaker's role?
Modal builds AI infrastructure, including sandboxes and LLM inference, and the speaker works on internal agents while assisting customers in building their own.
How has the approach to agent functionality evolved?
The speaker has shifted from writing tools to creating proxy rules that allow agents to directly access APIs, enhancing their capabilities.
What is Gator and what capabilities does it have?
Gator is a read-only internal agent that accesses various data sources to answer queries and analyze data without modifying the codebase.
What improvements were made to Gator's architecture?
To enhance Gator, it was given the ability to write code programmatically, allowing for more complex data analysis and visualization.
How does the proxy architecture work for Gator?
The proxy inspects requests and determines if they are valid, allowing Gator to use various APIs while maintaining security through network boundaries.