Skip to content
Regolo Logo
Self‑Hosting & DevOps

Secure Multi-Agent Orchestration for Beginners: CrewAI, AutoGen & MetaGPT

Alex Genovese
6 min read
Share

Many teams eagerly wire up a multi-agent framework to automate their workflows and point it at a default US-based API, only to later realize that those autonomous agents are continuously passing proprietary company data back and forth in an endless conversational loop. While this approach might be acceptable for a weekend hobby project, it creates a massive compliance nightmare for any serious enterprise deployment. In this guide, we will show you exactly how to run powerful frameworks like CrewAI, AutoGen, and MetaGPT entirely on European infrastructure so that you can leverage multi-agent orchestration without leaking a single byte of sensitive data.

In a nutshell

Multi-agent frameworks generate intense API traffic as agents debate, summarize, and retrieve data collaboratively. You can easily secure this entire conversational loop by pointing the frameworks’ standard OpenAI configuration to https://api.regolo.ai/v1, which seamlessly routes all traffic to a single EU-hosted LLM endpoint. This architectural tweak keeps your proprietary reasoning processes strictly under EU data residency and zero data retention while requiring just a few lines of code to implement.

Table of Contents

The Multi-Agent Privacy Nightmare

While a standard LLM interaction involves sending a single prompt and receiving a direct response, a multi-agent system relies on an orchestration framework to delegate tasks to distinct personas like Researchers, Writers, and Editors. These specialized agents continuously converse with one another by sharing raw context, intermediate drafts, and final outputs across dozens or even hundreds of automated API calls.

If you connect these frameworks to default international providers, every single turn of the agents’ internal monologue gets transmitted across jurisdictions, which poses a fatal security flaw for operations involving financial analysis, HR recruitment, or legal document reviews. Fortunately, you can eliminate this compliance risk entirely by moving your compute layer to a secure EU inference provider, proving that you do not need to rewrite your complex agent logic when you can simply change where the API requests are routed.

1. CrewAI: The Role-Playing Team

CrewAI enables role-playing agents to operate as a cohesive team, functioning much like a virtual agency where every participant knows exactly what their specific job entails. Because CrewAI is built directly on top of LangChain, it inherently supports custom OpenAI-compatible endpoints with minimal friction.

from crewai import Agent, Task, Crew
from langchain_openai import ChatOpenAI
import os

# 1. Define the secure European LLM endpoint
secure_llm = ChatOpenAI(
    openai_api_key=os.environ.get("REGOLO_API_KEY"),
    openai_api_base="https://api.regolo.ai/v1",
    model_name="meta-llama/Meta-Llama-3.1-70B-Instruct"
)

# 2. Assign the secure LLM to your agents
researcher = Agent(
    role="Senior Data Analyst",
    goal="Analyze internal Q3 financial data securely",
    backstory="You are an expert analyst handling strictly confidential EU data.",
    llm=secure_llm,
    verbose=True
)

writer = Agent(
    role="Report Writer",
    goal="Draft the executive summary based on the analysis",
    backstory="You write clear, actionable corporate summaries.",
    llm=secure_llm,
    verbose=True
)

# 3. Define tasks and orchestrate the crew
task1 = Task(
    description="Analyze the provided sales CSV.", 
    agent=researcher, 
    expected_output="A bulleted list of key trends."
)
task2 = Task(
    description="Write a 2-paragraph executive summary.", 
    agent=writer, 
    expected_output="A polished 2-paragraph summary."
)

crew = Crew(
    agents=[researcher, writer],
    tasks=[task1, task2]
)

result = crew.kickoff()
print(result)Code language: Python (python)

How this example works

First, we initialize a secure_llm object using LangChain’s standard ChatOpenAI class, but we override the openai_api_base parameter to route all requests directly to our European infrastructure. After setting up the endpoint, we create two distinct personas—a Researcher and a Writer—and assign our secure LLM to both of them before grouping their specific tasks into a cohesive Crew.

When you trigger the execution via crew.kickoff(), the Researcher analyzes the data and seamlessly passes its internal notes to the Writer to draft the final summary, ensuring that every single interaction remains safely contained within the EU boundary.

2. AutoGen: The Debating Agents

AutoGen focuses on orchestrating complex, multi-turn conversations between agents that often include automated code execution. Instead of relying on a strictly linear pipeline, AutoGen agents talk to each other organically to solve a problem collaboratively through iterative debate.

import autogen
import os

# Configure AutoGen to use Regolo.ai
config_list = [
    {
        "model": "meta-llama/Meta-Llama-3.1-70B-Instruct",
        "api_key": os.environ.get("REGOLO_API_KEY"),
        "base_url": "https://api.regolo.ai/v1",
    }
]

llm_config = {"config_list": config_list, "seed": 42}

# Create agents
assistant = autogen.AssistantAgent(
    name="assistant",
    llm_config=llm_config,
    system_message="You are a helpful assistant. You solve problems securely without storing data."
)

user_proxy = autogen.UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=2,
    code_execution_config=False
)

# Start the multi-agent debate
user_proxy.initiate_chat(
    assistant,
    message="Write a Python script to parse our internal server logs securely."
)Code language: Python (python)

How this example works

We start by defining a config_list that contains our chosen model, API key, and the custom base_url to route requests correctly. Next, we set up an AssistantAgent that handles the cognitive workload alongside a UserProxyAgent that acts autonomously on behalf of the human user. When we trigger the initiate_chat method, the proxy instructs the assistant to write a script, sparking a continuous back-and-forth dialogue where the assistant can ask for clarification as needed.

Because this collaborative ping-pong generates a tremendous amount of chatty API traffic, redirecting it to a zero data retention endpoint is absolutely essential to prevent your internal server log structures from being broadcast to external providers.

3. MetaGPT: The Virtual Software Company

MetaGPT takes orchestration to the extreme by modeling an entire software company that automatically assigns roles like Product Manager, Architect, and Engineer to tackle a project from inception to delivery. Rather than writing Python objects manually, you typically configure MetaGPT globally via its central config2.yaml file.

# MetaGPT config2.yaml
llm:
  api_type: "openai"
  base_url: "https://api.regolo.ai/v1"
  api_key: "your-regolo-api-key"
  model: "meta-llama/Meta-Llama-3.1-70B-Instruct"Code language: YAML (yaml)

How this example works

Adapting this framework requires nothing more than a simple configuration file edit where you instruct MetaGPT to format its requests for OpenAI while seamlessly rerouting the actual traffic to Regolo.ai.

Once this configuration is in place, you can run MetaGPT exactly as you normally would, allowing the system to handle all internal architecture debates, product requirement documents, and code generation requests securely through open-weight models. Ultimately, achieving enterprise-grade compliance does not require overhauling your entire stack when you can simply shift the underlying compute infrastructure.


FAQs

Why do multi-agent systems consume so many tokens?

These systems generate high token volumes because agents continuously summarize and pass their entire conversational histories to one another, meaning an initial short request can easily expand into thousands of input tokens as agents iterate and debate the solution.

Can I use local models instead of an API provider?

While running local models is technically possible, managing the local GPU infrastructure required for a highly capable 70B parameter model is extremely difficult and resource-intensive, which is why most teams find it significantly cheaper to use a secure EU endpoint rather than provisioning their own bare metal servers.

Is zero data retention really guaranteed?

Standard consumer APIs do not typically guarantee zero data retention, but a dedicated B2B infrastructure like Regolo.ai explicitly guarantees European data residency through legally binding Data Processing Agreements that ensure your prompts are never stored or used for model training.


Articles about Multi Agent systems


Start your free 30-day trial at regolo.ai and deploy LLMs with complete privacy by design.

👉 Talk with our Engineers or Start your 30 days free →



Built with ❤️ by the Regolo team. Questions? regolo.ai/contact or chat with us on Discord