
Welcome to AI Agent Swarms: Architecture, Security and Governance. This course is about the next stage of applied AI, in which several autonomous agents work together, share information, delegate tasks and make decisions as a team. In this opening lesson you will see what the course covers and why it matters.
You will begin with the shift that motivates it. Many organisations have tried a single chatbot or assistant. The next step is a group of specialised agents, such as a researcher, an analyst and a reviewer, coordinated so that they can tackle work that is too large or varied for one model. This brings new power and also new risks, because every added agent adds communication paths, permissions and ways to fail.
Next you will get an overview of the three themes in the title. Architecture is how swarms are structured and orchestrated. Security is how you protect them against threats such as prompt injection, impersonation and tool misuse. Governance is how you keep them accountable, with inventories, risk controls, audit trails and human oversight.
You will learn how the course is organised, moving from foundations and design patterns through hands-on building with Python and common frameworks, to communication protocols, identity, threats, defences, reliability, observability, cost, governance, deployment and a final capstone project.
You will also learn how to work through the course. Labs can run on local tools, you are encouraged to build as you watch and every security topic is taught from a defensive point of view.
By the end of this lesson you will be able to describe what the course teaches and how its sections fit together.
The words agent, multi-agent system and swarm are used loosely, and clear definitions make everything later easier. In this lesson you will learn what AI agent swarms are and why they matter to organisations.
You will begin with the building block. An AI agent is a program that uses a language model to pursue a goal, deciding on its own which steps to take, using tools such as search or code and observing the results. You will see what separates an agent from a simple prompt and response, which is the loop of reasoning, acting and checking.
Next you will move to groups. A swarm is a collection of agents that coordinate to complete work, often with different roles and some shared memory or messaging. You will look at the ideas borrowed from nature, such as ants or bees, in which simple members and local rules produce useful collective behaviour, and see where that analogy helps and where it misleads for enterprise software, which needs predictability and control.
You will study why swarms matter. Specialisation can improve quality, parallel work can improve speed, independent review can catch errors and the same pattern can be applied to research, customer operations, software delivery and security operations. You will see a few high-level examples.
You will also meet the cost of the approach, including more complexity, more spend and a larger attack surface, which is why the course pairs capability with security and governance.
By the end of this lesson you will be able to define agents, swarms and their value in clear terms.
To understand where swarms fit, it helps to see how we got here. In this lesson you will follow the evolution from chatbots to autonomous agent swarms, and see what changed at each step.
You will begin with rule-based chatbots, which followed fixed scripts and could only answer questions that their designers had anticipated. You will then see how large language models changed this, allowing free-form conversation and general knowledge, but still in a simple pattern of one prompt and one reply, with no memory of actions and no way to affect other systems.
Next you will look at the move to tool use. Models were given the ability to call functions, search the web, query databases and run code, so that they could act and not only talk. You will see how this led to single agents that plan multi-step tasks, observe results and adjust, using loops such as reason, act and observe.
You will then examine the step beyond a single agent. As tasks grew, one agent struggled with long context, mixed responsibilities and unreliable self-checking. Teams of agents emerged, each with a defined role, and with an orchestrator or a protocol to coordinate them. You will discuss the standards that are appearing to connect agents and tools.
You will reflect on what each stage added in capability and in risk, particularly around autonomy and trust.
By the end of this lesson you will be able to describe the progression from chatbots to swarms and the trade-offs of each stage.
Organisations are excited about agent swarms, and they are right to be cautious as well. In this lesson you will study the enterprise opportunities and challenges, so that you approach swarms with realistic expectations.
You will begin with the opportunities. Swarms can automate multi-step knowledge work, such as research and reporting, triage of support tickets, code review, compliance checks and incident investigation. They can run work in parallel, apply specialised roles and provide a second opinion through independent verification. They can also connect to existing systems through APIs and standard protocols.
Next you will study the challenges. Autonomy means that an agent may take actions that no one explicitly approved. Agents read untrusted content, so they can be manipulated. They hold credentials, so a compromise can have a wide impact. Errors can spread from one agent to another. Costs can grow quickly because every agent call uses tokens. It can be hard to explain why a swarm reached a decision, which complicates audit and compliance.
You will connect each challenge to a part of the course that addresses it, such as identity and authorisation, defensive architecture, reliability, observability, cost control and governance. You will see that these are engineering problems with known techniques and not reasons to avoid the technology.
You will build a simple opportunity and risk table for a business scenario of your choice, and consider what controls it would need before production.
By the end of this lesson you will be able to weigh the benefits and risks of enterprise agent swarms.
A clear map makes a long course easier to follow. In this lesson you will go through the course roadmap, the tools, the labs and the final project, so that you know what to expect and how to prepare.
You will begin with the structure. The course moves through foundations, architecture and design patterns, environment setup, building your first swarm, comparing frameworks, coordination and collective decision-making, communication with MCP and A2A, identity and authorisation, threats, defences, reliability, observability, cost, governance, human oversight and deployment, and a capstone. You will see how each section builds on the previous one and ends with a hands-on lab.
Next you will look at the technology stack. You will use Python, with LangGraph, CrewAI and AutoGen for building agents, Ollama to run language models locally, and common tools for APIs, testing and tracing. The aim is that core labs can run on your own computer without paid model subscriptions, though you may choose to use hosted models if you wish.
You will learn how the labs work. Each gives you a goal, starter material and checks, and asks you to build, test and reflect. You will be encouraged to keep a notebook of design decisions and security observations.
You will preview the capstone, in which you design and build a secure, observable and governed enterprise swarm that brings together every skill.
You will also set up your study approach, with a pace, a folder structure and a way to record what you learn.
By the end of this lesson you will be able to navigate the course and prepare for its labs and final project.
This knowledge check helps you turn the ideas of the introduction into practical judgement. In this lesson you will identify real-world agent swarm use cases and decide which are strong candidates for the approach.
You will begin with a set of short business scenarios. They include a research team that must gather and summarise market information, a support operation that must triage and route tickets, a software team that wants automated code review, a security operations centre that wants help investigating alerts and a finance team that wants help with report preparation. For each, you will be asked to think about what the task involves.
Next you will apply a few simple questions. Does the work divide naturally into specialised roles? Can parts run in parallel? Would independent review improve quality? How costly is a mistake, and can it be undone? Does the work involve sensitive data or actions with real-world impact? You will use the answers to rate each scenario as a strong fit, a possible fit with safeguards or a poor fit.
You will then explain your reasoning in a sentence or two, naming the roles you would create and the risks you would want to control. You will compare your answers with the suggested ones, and note where your judgement differed.
You will see that some tasks are better served by a single agent, a simple script or a human, which prepares you for the lesson on when to avoid swarms.
By the end of this lesson you will be able to evaluate a use case and justify whether a swarm is appropriate.
Precise vocabulary is the foundation of good design. In this lesson you will learn to distinguish AI agents, multi-agent systems and swarms, and understand how they relate.
You will begin with the agent. You will break it down into its parts: a language model that reasons, instructions that define its role and rules, tools that let it act, memory that holds context and a loop that lets it plan, act and observe. You will see how each part can be configured and how each can fail.
Next you will study multi-agent systems. These are systems in which several agents interact, and the interaction can be structured in many ways: one agent can supervise others, agents can pass work along a pipeline, they can debate or vote or they can communicate freely. You will see that the key design questions are who decides, who can talk to whom and who can use which tools.
You will then define a swarm. In this course, a swarm is a multi-agent system that emphasises collective behaviour, such as dynamic allocation of work, many agents contributing in parallel and results emerging from coordination and not from a single controller. You will discuss that, in enterprise settings, swarms usually need guardrails to remain predictable.
You will compare the three with a simple table and a diagram, and practise classifying example systems.
You will also introduce the terms that appear throughout the course, such as orchestrator, handoff, shared state and termination condition.
By the end of this lesson you will be able to classify a system correctly and use the terminology precisely.
One of the first design decisions is how many agents to use and how to arrange them. In this lesson you will compare single-agent, multi-agent and swarm architectures, and learn what each is best at.
You will begin with the single agent. It is simple to build, easy to debug and cheap to run, and it keeps all context in one place. Its limits appear when the task needs several kinds of expertise, a very long context, parallel work or an independent check on the answer. You will see examples where one agent becomes confused by too many instructions or tools.
Next you will look at multi-agent architectures. Splitting the work among agents with narrow roles can improve focus and quality, and allows different models or tool sets for different jobs. The cost is more communication, more places for errors to arise and more complexity in the control flow. You will study a pipeline of agents and a supervisor with workers.
You will then examine swarm-style architectures, in which many agents act with considerable autonomy, tasks are allocated dynamically and coordination happens through messages or shared memory. You will see why they can scale and adapt well, and why they are harder to predict, test and govern.
You will compare the three on criteria such as complexity, cost, latency, reliability, security exposure and explainability, and use a decision guide to choose between them.
You will apply the guide to three scenarios and justify each choice.
By the end of this lesson you will be able to choose between single-agent, multi-agent and swarm designs.
How much freedom should an agent have? The answer shapes the value and the risk of the whole system. In this lesson you will study agent autonomy, intelligence and decision-making.
You will begin with autonomy as a spectrum. At one end, an agent only suggests, and a human does everything. In the middle, the agent acts within limits and asks for approval for important steps. At the other end, it acts independently with only monitoring. You will place familiar examples on the spectrum and learn that autonomy should be granted in proportion to the impact of an error and the reliability of the agent.
Next you will examine how agents decide. You will see the common loop of observing the situation, reasoning about it, choosing an action, executing it and checking the result. You will look at planning approaches, such as breaking a goal into steps, and at reflection, in which an agent critiques its own output. You will discuss the limits of language model reasoning, including errors, inconsistency and sensitivity to the wording of inputs.
You will think about what intelligence means for agents in practice. It is not general wisdom, but the ability to use context, tools and instructions to complete tasks of a particular kind. You will explore how clear goals, constraints and success criteria improve decisions.
You will consider the safety questions that follow, such as what an agent must never do on its own, how to give it a way to say that it is unsure and how to make its reasoning visible for review.
By the end of this lesson you will be able to set a sensible level of autonomy for an agent and explain how it decides.
Agents in a swarm must work together, and that takes more than simply connecting them. In this lesson you will study collaboration, delegation, negotiation and consensus, which are the core behaviours of multi-agent systems.
You will begin with collaboration. Agents can share information, build on each other's output or divide a problem into parts. You will see the simplest forms, such as passing a result along a chain, and more active ones, such as agents asking each other for help or critique.
Next you will look at delegation. An agent that receives a large task may break it down and assign the parts to others, based on their roles and capabilities. You will study what a good delegation includes, such as a clear goal, the context needed, the constraints, the expected output format and a deadline or budget. You will see how poor delegation leads to misunderstandings and wasted work.
You will then study negotiation and consensus. When agents disagree, or when several candidates could do a task, the system needs a way to decide. You will compare approaches such as a supervisor making the call, voting, scoring proposals against criteria and requiring agreement from a quorum. You will discuss the risk of agents simply agreeing with each other without good reason.
You will learn how to design these interactions so that they are bounded, with limits on the number of exchanges and clear rules for when to stop and escalate to a human.
By the end of this lesson you will be able to describe the main collaboration behaviours and design them with limits.
A swarm is only as clear as the roles of its agents. When roles are vague, agents duplicate work, contradict each other or leave gaps. In this lesson you will define agent roles, capabilities, goals and responsibilities.
You will begin with the role. A role describes what an agent is for, such as researcher, analyst, reviewer or supervisor. You will learn how to write a role that is specific and bounded, with a short statement of purpose and a list of what the agent should and should not do. You will see why narrow roles improve reliability and make testing easier.
Next you will look at capabilities. These are the tools, data sources and skills that the agent has access to. You will apply the principle that each agent should receive only what its role needs. A reviewer, for example, may need to read a draft but not to send email. You will see how capabilities connect to the security topics that follow.
You will then define goals and success criteria, so that each agent knows what a good result looks like, and responsibilities, so that it is clear who is accountable for each decision and output. You will study the handoff points, where one agent's output becomes another's input, and write a short contract for each.
You will use a role card template, with fields for purpose, inputs, outputs, tools, constraints, escalation rules and the human owner, and fill it in for a sample team.
You will review the cards for overlaps and gaps.
By the end of this lesson you will be able to write clear role definitions for each agent in a swarm.
The most valuable design skill with swarms is knowing when not to use one. In this lesson you will learn when to use agent swarms and when to avoid them, using a practical decision framework.
You will begin with the signs that a swarm may help. The work divides into distinct roles. Parts of it can be done in parallel. Independent review would raise quality. The task is too long or varied for one context. The value of the result justifies the extra cost and complexity. There are clear ways to evaluate the output.
Next you will study the signs that you should avoid one. The task is simple and a single prompt or workflow would work. The task requires deterministic and auditable steps, which a conventional program does better. Mistakes would be costly, hard to reverse or affect people's rights. The data is highly sensitive and the controls are not ready. Latency or cost limits are strict. No one can say how the results will be verified.
You will learn about the middle ground. Often a fixed workflow with a few model calls, or a single agent with tools, gives most of the benefit with much less risk. You will see how to start simple and add agents only when you can show a measurable gain.
You will apply the framework to several proposals and write a short recommendation for each, including the risks and the controls that you would require before building.
You will practise explaining the decision to a non-technical stakeholder.
By the end of this lesson you will be able to make and defend a sound decision about whether to use a swarm.
This practical exercise lets you apply the foundations by designing a team of five agents for an enterprise task, on paper, before you write any code. The aim is to practise thinking in roles, interfaces and controls.
You will begin by choosing a scenario, such as producing a weekly competitive intelligence report, handling inbound customer escalations or reviewing a set of contracts for standard clauses. You will write a short statement of the goal, the inputs, the outputs and what a good result looks like.
Next you will design the team. You will define five agents, for example a coordinator, a researcher, an analyst, a writer and a reviewer. For each, you will complete a role card with the purpose, the inputs and outputs, the tools it may use, the constraints and the conditions under which it must stop and ask for help. You will check that the roles do not overlap and that nothing is missing.
You will then draw the interactions. You will sketch who sends work to whom, where results are combined and where a review happens, and mark the points at which a human should approve something. You will note where untrusted content enters the system, since these points will matter in the security sections.
You will estimate the cost and the risks in a few lines, and identify the three things most likely to go wrong.
You will review your design against the question of whether a simpler approach would do, and revise it.
By the end of this exercise you will be able to produce a clear, reviewed design for a small enterprise agent team.
Before you choose patterns, you need to know what an enterprise swarm is made of. In this lesson you will study the core components of an enterprise agent swarm and how they fit together.
You will begin with the agents themselves, each defined by a model, instructions, tools and memory. You will then see the orchestration layer, which decides which agent runs next, passes tasks and results, and applies rules such as limits on the number of steps. You will learn that this layer can be a dedicated supervisor agent, a graph of steps or a separate piece of code.
Next you will look at the supporting components. Tools and connectors let agents reach systems and data. Memory and shared state hold context and intermediate results. A messaging or event layer carries communication. An identity and access layer decides who may do what. A policy layer enforces rules on actions. Observability records what happened. A control interface lets humans monitor, approve and stop the system.
You will draw a reference architecture that shows these components and the data flows between them, and mark the trust boundaries, where data or instructions cross from one zone to another, such as from the outside world into an agent.
You will discuss how each component maps to a part of this course, and how the quality of the whole depends on the weakest part.
You will annotate the diagram for a sample use case.
By the end of this lesson you will be able to describe the components of an enterprise swarm and the role of each.
The simplest and most common way to organise a swarm is to have one agent in charge. In this lesson you will study centralised orchestration and the supervisor-worker pattern.
You will begin with the pattern. A supervisor receives the goal, breaks it into tasks, assigns each to a worker agent with a specific role, collects the results, checks them and decides the next step or the final answer. The workers do not usually talk to each other, and all control passes through the supervisor.
Next you will study the strengths. Control is clear, the flow is easy to understand and to log, limits and policies can be applied in one place, and a human can supervise through a single point. It is a good fit for enterprise settings where predictability and audit matter. You will see how it maps onto frameworks that represent the flow as a graph.
You will then examine the weaknesses. The supervisor can become a bottleneck for speed and for context size. It is a single point of failure, and a compromised or confused supervisor can misdirect every worker. Its prompts can become large and fragile as roles are added.
You will learn techniques to mitigate these issues, such as keeping the supervisor's job narrow, giving it structured summaries and not raw outputs, adding a deterministic checker and setting limits on the number of delegations.
You will sketch the supervisor-worker design for a sample task and list its failure modes.
By the end of this lesson you will be able to design and critique a supervisor-worker swarm.
At the other end of the spectrum from central control are swarms in which agents communicate directly with one another. In this lesson you will study decentralised and peer-to-peer agent swarms.
You will begin with the idea. In a peer-to-peer design, there is no single supervisor. Agents discover each other, advertise what they can do, send requests directly and decide for themselves whom to contact. Coordination emerges from the protocol and the rules that each agent follows.
Next you will explore the benefits. There is no central bottleneck or single point of failure, the system can scale by adding agents and it can adapt, since agents can take on work as it appears. It suits open ecosystems in which agents are built by different teams or organisations and must interoperate through standard protocols.
You will then study the costs. Behaviour is harder to predict and to test. It is harder to know who did what, which complicates audit. Trust is more difficult, because any agent might be wrong, compromised or malicious. Loops and message storms are more likely. Policy enforcement has to be distributed, which is more demanding.
You will learn what a decentralised design needs in order to be safe: strong identity for each agent, authenticated and authorised messages, limits on rates and hops, a shared log of interactions and clear rules about what an agent may ask of another.
You will compare it with the supervisor design for the same problem and decide which one you would deploy and why.
By the end of this lesson you will be able to explain when peer-to-peer swarms are appropriate and what they require.
Many real systems combine control and flexibility by arranging agents in layers. In this lesson you will study hierarchical agent teams and dynamic delegation.
You will begin with the structure. In a hierarchy, a top-level agent manages several team leads, and each lead manages its own group of specialists. This mirrors an organisation chart and keeps each agent's scope and context small. Instead of one supervisor handling a hundred tasks, each level handles a manageable number and passes summaries upward.
Next you will study dynamic delegation. Rather than hard-coding which agent does what, a manager agent can inspect the task, look at the available agents and their capabilities and choose who should do the work, or even create a temporary sub-team. You will see how this adds flexibility and also how it needs limits, because unrestricted delegation can lead to runaway chains and to agents acquiring more authority than intended.
You will learn the rules that keep delegation safe. A delegate should never receive more permission than the delegator holds. The depth of the hierarchy and the number of sub-tasks should be capped. Each delegation should carry its purpose, its constraints and a budget. Results should be validated before they are passed up.
You will draw a hierarchical design for a larger task and mark where each rule applies.
You will consider how to trace a request through the layers, which is important for debugging and audit.
By the end of this lesson you will be able to design a hierarchy with bounded dynamic delegation.
Agents need a way to share information, and the way you choose affects coupling, scale and traceability. In this lesson you will study blackboard, shared-memory and event-driven architectures.
You will begin with the blackboard pattern. A blackboard is a shared space where agents post partial results, observations and questions, and where other agents read them and contribute. There is no direct messaging. Agents act when they see something relevant that they can improve. You will see that this suits problems that need many perspectives, such as analysis or diagnosis.
Next you will look at shared memory more generally. This can be a key-value store, a database or a vector store that holds facts, plans and history. You will study the design questions: who can read and write, how entries are validated and versioned, how stale data is handled and how conflicting updates are resolved. You will see why shared memory is both useful and a target for manipulation.
You will then study event-driven designs. Agents subscribe to events on a message bus, such as a document received or a task completed, and publish new events when they finish. This decouples the agents, supports scale and makes it natural to add new ones, but it also makes the overall flow harder to see.
You will compare the three with their trade-offs in coupling, ordering, consistency and observability.
You will sketch an event-driven swarm for a sample workflow and describe how you would trace it.
By the end of this lesson you will be able to choose a shared-state or event-based architecture and explain its trade-offs.
The order in which agents work has a large effect on speed, cost and complexity. In this lesson you will compare parallel, sequential and hybrid execution patterns.
You will begin with sequential execution. Each agent works in turn, and the output of one becomes the input of the next. It is simple, easy to reason about and easy to debug, and it suits tasks with strong dependencies, such as draft, review and finalise. Its limit is the total time, which is the sum of every step.
Next you will study parallel execution. Independent tasks run at the same time, for example several researchers each covering a different source, and their results are combined later. This reduces the elapsed time and can improve coverage. You will learn about the extra needs it brings, such as splitting the work cleanly, handling partial failures, limiting concurrency to control cost and rate limits, and combining results without conflicts.
You will then look at hybrid patterns, which are common in practice. A workflow may fan out into parallel branches, wait for them to complete, aggregate and then proceed sequentially to review and approval. You will see how graphs and workflow engines represent such patterns.
You will learn how to decide, by identifying the true dependencies between tasks, and measure the gains against the added complexity.
You will redraw a sequential design as a hybrid one and list what changes in cost, latency and failure handling.
By the end of this lesson you will be able to select and combine execution patterns to fit a workload.
Every architecture involves trade-offs, and professionals need to be able to name them. In this lesson you will study architectural trade-offs, bottlenecks and failure domains in agent swarms.
You will begin with the main trade-offs. Centralised control gives predictability but concentrates risk. Decentralisation gives resilience and scale but reduces visibility. More agents give specialisation but cost more and increase communication. Parallelism reduces time but raises concurrency and cost peaks. Shared memory improves context but creates a target for corruption. You will see how each choice moves the system along these dimensions.
Next you will study bottlenecks. These include a supervisor that every message passes through, a single model endpoint with rate limits, a shared database or a human approval step that holds up everything. You will learn to find them by tracing the flow of work, and to relieve them with batching, queues, caching and parallelism, where it is safe.
You will then study failure domains. A failure domain is the set of things that fail together. If all agents share one credential, one model provider or one memory store, then one problem can stop or compromise everything. You will see how to limit the blast radius through separation, with distinct identities, isolated resources and independent fallbacks.
You will analyse a sample architecture for its single points of failure, and propose changes that reduce the impact of each.
You will practise documenting the decisions and the reasons in a short architecture decision record.
By the end of this lesson you will be able to evaluate a swarm design for its trade-offs, bottlenecks and failure domains.
In this lab you will apply the patterns of the section by designing three enterprise swarm architectures for the same business problem, and compare them. It is a design exercise that prepares you for the building labs that follow.
You will begin with a problem statement, such as processing inbound vendor security questionnaires, which requires reading documents, finding answers in internal knowledge, drafting responses, reviewing them and obtaining sign-off. You will list the inputs, the outputs, the constraints on data and the quality expectations.
Next you will produce three designs. The first uses a supervisor with workers. The second uses a hierarchical team with leads for different parts of the questionnaire. The third uses an event-driven design with agents that react to events on a message bus. For each, you will draw the components, label the data flows and mark where untrusted content enters and where a human approves.
You will then evaluate the designs against a set of criteria: complexity, latency, cost, scalability, reliability, security exposure, explainability and ease of audit. You will score each and write a short justification, being specific about the weak points of your preferred option.
You will write an architecture decision record for the design that you would choose, recording the options, the decision, the reasons and the risks that remain, and a list of the controls that the later sections will add.
You will present the comparison in a one-page summary.
By the end of this lab you will be able to design, compare and justify alternative swarm architectures.
Before you build anything, you should know what tools you will use and why. In this lesson you will be introduced to the course technology stack, and see how each piece contributes to building, running and securing agent swarms.
You will begin with the language. Python is the main language of the course, because the agent frameworks, the model libraries and the data and web tooling are all well supported in it. You will use virtual environments to keep each project's packages separate and repeatable.
Next you will meet the model layer. Ollama lets you run open language models on your own computer, so that the core labs do not need paid accounts or an internet connection once the models are downloaded. You will learn that the code you write can also be pointed at hosted models by changing configuration, and that the choice affects cost, privacy and quality.
You will then see the orchestration frameworks. LangGraph represents a swarm as a graph of steps with shared state. CrewAI organises agents into role-based teams with tasks. AutoGen focuses on conversations between agents. You will see a short example of each, and understand that Section 6 compares them in depth.
You will look at the supporting tools, such as libraries for validating structured data, building API services with FastAPI, testing with pytest, tracing with OpenTelemetry and containerising with Docker. You will also see how MCP and A2A fit in as protocols.
You will check the hardware that you need and plan how to keep your setup tidy.
By the end of this lesson you will be able to describe the tools in the stack and the purpose of each.
A reliable setup saves hours later, and this lesson walks you through it. You will set up Python, virtual environments and development tools so that the labs run the same way on your machine as in the lessons.
You will begin by checking the Python version and installing a recent, supported release if needed, following the steps for Windows, macOS or Linux. You will confirm that the python and pip commands point to the version you expect, a common source of confusion.
Next you will create a virtual environment for the course with the venv module, activate it and confirm that the prompt and the interpreter path have changed. You will see why you should not install packages globally and how to recreate the environment from a requirements file. You will install a first set of packages and pin their versions so that the results can be repeated.
You will set up a code editor, such as Visual Studio Code, with the Python extension, a formatter and a linter, and configure it to use your virtual environment. You will install Git, create a repository for your projects and add an ignore file that excludes the environment folder and any files that hold secrets.
You will learn the habit of keeping settings and keys in environment variables or a local environment file that is never committed, and create a template file with placeholders.
You will finish by running a short script that imports the main libraries to prove that the setup works.
By the end of this lesson you will be able to create a clean, repeatable Python development environment.
Running language models locally lets you build and test agent swarms without paying for each call and without sending data off your computer. In this lesson you will run local language models with Ollama.
You will begin with what Ollama is. It is a tool that downloads open language models and serves them on your machine through a simple local interface. You will install it, start the service and check that it is running. You will learn about the sizes of models, the memory they need and how to choose one that suits your computer, noting that larger models are generally more capable but slower and more demanding.
Next you will pull a model and chat with it from the command line, then list, run and remove models. You will see how a model is referred to by name and tag, and how to check what is installed.
You will then call the model from Python. You will use the local HTTP interface or a client library to send a prompt and read the reply, set parameters such as temperature and the maximum length, and use a system prompt. You will see how to ask for structured output and parse it, and how to stream tokens.
You will discuss the limits of small local models, such as weaker reasoning and less reliable tool use, and how this affects the design of your agents, for example by keeping tasks simple and adding validation.
You will write a small wrapper function that will be reused in later labs so that you can switch models easily.
By the end of this lesson you will be able to install Ollama and use local models from Python.
Several frameworks help you build agent swarms, and each takes a different approach. In this lesson you will be introduced to LangGraph, CrewAI and AutoGen, so that you understand the main ideas before you build with them.
You will begin with LangGraph. It models a workflow as a graph in which nodes are steps, such as calling an agent or a tool, and edges define the order and conditions. A shared state object flows through the graph, and the framework supports branching, loops, parallel steps and checkpoints. You will see a minimal graph with two nodes and a conditional edge, and run it.
Next you will look at CrewAI. It focuses on teams. You define agents with a role, a goal and a backstory, define tasks that are assigned to the agents and run them as a crew, in sequence or under a manager. You will see a small crew with two agents and two tasks. You will notice how readable the definition is.
You will then meet AutoGen. It is built around conversations between agents, in which messages are exchanged and a group chat manager can decide who speaks next. You will see a short example of two agents conversing to solve a task, and a team arrangement.
You will compare the three at a high level, on the control they give you, how easy they are to start with, how they handle state and how well they fit audit and governance needs. You will be reminded that these libraries change quickly, so you should check the current documentation for the exact syntax.
By the end of this lesson you will be able to describe the core idea of each framework and recognise a simple example of each.
An agent becomes useful when it can act, and acting means using tools and exchanging data in reliable formats. In this lesson you will create agent tools, structured outputs and API interfaces.
You will begin with tools. A tool is a function that the agent may call, such as a search, a calculation or a database lookup. You will write a few small Python functions with type hints and docstrings, and learn how the framework turns them into a description that the model can read. You will see why each tool should do one thing, validate its inputs and return predictable results.
Next you will study structured outputs. Free-form text is hard for other agents and programs to use, so you will define the expected shape of an agent's answer with a schema, using a validation library such as Pydantic. You will ask the model for output in that shape, parse it, validate it and handle the cases in which it fails, by retrying with the error message or by returning a clear failure.
You will then expose your agent through an API interface. You will use FastAPI to create an endpoint that accepts a task, runs the agent and returns a validated result, with input validation, timeouts and clear error responses. You will see how this prepares you for later work on deployment and security.
You will consider safety from the start. Tools should have the least power they need, and anything that changes data or contacts the outside world should be limited and logged.
You will build and test a small tool set.
By the end of this lesson you will be able to give agents safe tools and well-defined inputs and outputs.
As projects grow, their structure determines whether they stay manageable. In this lesson you will build a reusable agent development project structure that you can use for every lab and for the capstone.
You will begin with the principles. Code should be organised by responsibility, so that agents, tools, prompts, configuration, tests and scripts each have their own place. Configuration should be separate from code, secrets should never be in the repository and every component should be testable on its own.
Next you will create the layout. You will make a package with folders for agents, tools, workflows, schemas, prompts and utilities, a configuration module that reads settings from environment variables, a folder for tests and another for scripts and sample data. You will add a project definition file that lists dependencies and a readme that explains how to set it up and run it.
You will write the shared pieces. These include a model client wrapper that hides the choice of model behind one interface, a logging setup that produces structured logs, a base class or pattern for agents and a small set of schemas for messages and results. You will keep each file short and focused.
You will add a first test that checks that the configuration loads and that a fake model client can be substituted, which lets you test agent logic without calling a real model. You will run the tests from the command line.
You will also set up a pre-commit check for formatting and a scan that looks for accidentally committed secrets.
By the end of this lesson you will be able to set up a clean, testable foundation for agent projects.
This lab puts the setup into practice. You will build and test your first local AI agent using Python, Ollama and the project structure from the previous lessons, and see the whole loop in action on your own machine.
You will begin by confirming that your environment and a local model are ready. You will create a new folder in your project for the lab, and import your model client wrapper. You will check that a simple prompt returns a reply.
Next you will define the agent. You will write a clear role and instructions, a small set of tools, for example a function that looks up information in a local file and a calculator, and an output schema for the answer. You will build the loop in which the agent decides whether to call a tool or to answer, runs the tool, observes the result and continues until it is finished or a step limit is reached.
You will run it on a few tasks. You will print each step so that you can see the reasoning, the tool calls and the results, and you will note where the local model makes mistakes, such as choosing the wrong tool or producing output that does not match the schema. You will add validation and a retry, and observe the improvement.
You will write tests that use a fake model to check the loop, the limits and the handling of errors, and a small set of real runs to check the behaviour.
You will record what you learned about the limits of small models and the value of structure and validation.
By the end of this lab you will be able to build, run and test a simple local agent with tools and a step limit.
Building a swarm starts with design, and a clear process prevents the common problem of agents that overlap or leave gaps. In this lesson you will design a multi-agent application from scratch.
You will begin with the problem. You will take a use case, such as researching a topic and producing a reviewed briefing, and write down the goal, the inputs, the outputs and the quality criteria. You will decide what the application should not do, to keep it bounded.
Next you will decompose the work. You will break the task into stages, such as gathering sources, extracting key facts, analysing them, writing a draft and reviewing it. You will decide which stages become agents and which are simply functions or fixed steps, since not everything needs a model. You will group the stages so that each agent has a coherent responsibility.
You will then define the interfaces. For each handoff, you will specify the data that is passed, using a schema, and what happens if it is invalid. You will decide how the agents will share state and where checkpoints will be saved.
You will choose the control flow, sequential, parallel or a mix, and set the limits, such as the maximum number of steps, the time and the budget. You will mark where a human could review.
You will write a short design document with a diagram, the role cards, the schemas and the risks, and review it for simpler alternatives.
By the end of this lesson you will be able to produce a clear, bounded design for a multi-agent application.
With the design ready, you can create the agents. In this lesson you will create specialised research, analysis and review agents, and learn what makes each one effective.
You will begin with the research agent. Its role is to gather relevant information from the allowed sources and return it in a structured form with the source for every item. You will write its instructions, give it a search tool or a local document reader and require it to say what it could not find. You will limit its scope so that it does not drift.
Next you will build the analysis agent. It receives the research output and produces findings, comparisons or recommendations. You will write instructions that stress the use of only the supplied material, a clear separation of facts and interpretation and an explicit statement of uncertainty. You will define its output schema.
You will then create the review agent. It acts as an independent critic, checking the analysis against the sources, looking for unsupported claims, gaps and inconsistencies, and returning a verdict with specific issues. You will see why it should have different instructions, and ideally a different model or settings, from the agents it reviews.
You will test each agent on its own with sample inputs and a fake model for the logic, and with the local model for quality. You will check the outputs against their schemas.
You will compare the effect of vague and precise instructions.
By the end of this lesson you will be able to build specialised agents with clear roles, bounded tools and validated outputs.
Individual agents become a swarm when you connect them, and LangGraph provides a clear way to do it. In this lesson you will connect agents with LangGraph and run them as a workflow.
You will begin with the state. You will define a state schema that holds the task, the research results, the analysis, the review verdict and counters such as the number of revisions. This object is passed through the graph, and each node reads from it and writes updates to it.
Next you will create the nodes. Each node is a function that wraps an agent, takes the state, calls the agent and returns the updated fields. You will add small nodes for non-agent work, such as validating a result or formatting the final output.
You will then define the edges. You will connect research to analysis and analysis to review, and add a conditional edge after the review, so that a failed review sends the work back to analysis for a revision, while a pass leads to the end. You will set a limit on the number of revision loops, which is essential to prevent endless cycles.
You will compile the graph and run it on a sample task, printing the state after each step. You will use the framework's tools to draw the graph, which helps with documentation and review. You will test the paths with fake agents.
You will discuss how the graph form supports audit and control, since the possible paths are explicit.
By the end of this lesson you will be able to build and run a multi-agent workflow as a LangGraph graph.
In a swarm, work passes from one agent to another, and the handoff is where many problems arise. In this lesson you will implement agent-to-agent task handoffs that are clear, validated and traceable.
You will begin with what a handoff must contain. It should state the task, the context that the next agent needs, the constraints, the expected output format, the identifier of the overall job and the identity of the sender. You will see how missing information leads the receiving agent to guess.
Next you will define a handoff schema and write code that creates and validates handoff messages. The sender builds the message, the framework or your code checks it against the schema and the receiver gets only valid input. You will handle invalid handoffs by returning an error to the sender or escalating.
You will implement different kinds of handoff. In a sequential flow, an agent passes its result to the next. In a supervisor flow, the supervisor assigns a task and receives a result. In some frameworks, an agent can transfer control to another agent through a handoff function, and you will see how to use this where it is available.
You will add tracing information to each handoff, such as the job identifier, the step number and the timestamps, so that you can reconstruct what happened.
You will also limit what is passed. Sending the full history to every agent increases cost and exposes data unnecessarily, so you will pass summaries and references where possible.
You will test the handoffs with valid, incomplete and oversized messages.
By the end of this lesson you will be able to implement reliable, auditable handoffs between agents.
Some parts of a workflow can run at the same time, and doing so can save a great deal of time. In this lesson you will implement parallel task execution and the aggregation of results.
You will begin by finding the parallelism. You will look at a research task that needs information from several independent sources, and see that the lookups do not depend on each other. You will define a fan-out step that creates a task for each source and a fan-in step that waits for all of them.
Next you will implement it. You will use the parallel features of the framework, or Python's asynchronous tools, to launch several agent calls together, with a limit on concurrency so that you do not overwhelm the local model or exceed rate limits. You will set a timeout for each task.
You will then handle the results. You will collect them in a consistent structure, deal with tasks that fail or time out by recording the failure and continuing, and decide whether the workflow can proceed with partial results. You will write an aggregation step, which may be an agent or a plain function, that merges the results, removes duplicates and notes conflicts.
You will measure the effect. You will compare the elapsed time and the cost of the parallel and the sequential versions, and see that parallel work reduces the time but not the total number of calls.
You will think about the risks, such as inconsistent state and conflicting writes, and avoid them by giving each task its own output and combining them in one place.
By the end of this lesson you will be able to run agents in parallel and merge their results safely.
Agents need context to do their work, and in a multi-step workflow that context must be stored somewhere. In this lesson you will manage shared state, checkpoints and agent context.
You will begin with state. You will review what belongs in the shared state of a workflow, such as the task, the intermediate results, the decisions made and the counters, and what does not belong there, such as secrets and unnecessary raw data. You will define a clear schema and make updates explicit, so that you know which agent changed what.
Next you will study checkpoints. A checkpoint is a saved copy of the state at a point in the workflow. You will use the persistence features of the framework to save the state after each step, to a file or a database, so that a failed or interrupted run can resume from the last good point instead of starting over. You will also see how checkpoints support review and debugging, since you can inspect or replay a run.
You will then consider context management for the agents. Language models have limited context windows, and long histories cost more and can confuse them. You will use techniques such as passing only the relevant fields, summarising earlier steps and keeping references to larger documents.
You will implement a simple pause and resume, stop a run midway, and restart it from the checkpoint.
You will discuss data protection, including limiting what is stored, expiring old checkpoints and protecting them from unauthorised access.
By the end of this lesson you will be able to design and implement shared state, checkpointing and context control.
A workflow that cannot finish properly is a risk to cost and reliability. Agents can loop, wait for each other or continue long after the task is done. In this lesson you will implement task completion and termination conditions.
You will begin with the kinds of ending. A run can end successfully, when the goal is met and the output passes its checks. It can end in failure, when it cannot proceed. It can end by escalation, when it hands over to a human. It can also end by limit, when it reaches a maximum on steps, time or cost. You will make sure that every path in your workflow leads to one of these.
Next you will define success criteria that the system can check. For a briefing task, these might be that the output matches the schema, that every claim has a source and that the review agent returned a pass. You will write them as a function that examines the state, so that completion is decided by code and not only by an agent's opinion that it is done.
You will then implement the limits. You will add a maximum number of steps, a maximum number of revision loops, a time limit and a budget on the tokens used. When a limit is reached, the workflow stops cleanly, records the reason and returns the best partial result with a clear flag.
You will add detection of lack of progress, for example when the same output repeats, and stop the run.
You will test with fake agents that never finish and confirm that each limit works.
By the end of this lesson you will be able to build workflows that always terminate in a defined and recorded way.
This lab brings together the whole section. You will build a research and analysis agent swarm that takes a question, gathers information in parallel, analyses it, reviews it and produces a validated report, using LangGraph and a local model.
You will begin with the design. You will confirm the roles of the coordinator, the researchers, the analyst and the reviewer, the state schema, the handoff schemas, the limits and the checkpoint approach. You will prepare a small set of local documents to act as the knowledge sources, so that the lab works offline.
Next you will build it step by step. You will implement the researcher agents and the parallel fan-out, with a concurrency limit and timeouts. You will implement the aggregation, the analyst and the reviewer. You will connect them in a graph, with a revision loop that is capped, and the completion check. You will save checkpoints after each step.
You will run the swarm on several questions. You will print the trace of steps and look at the quality of the output and the handling of problems. You will deliberately make one source unavailable and check that the workflow continues with a partial result and notes the gap.
You will write tests with fake agents for the control flow, the limits and the failure paths, and a few runs with the local model.
You will review the cost and the time, and note two improvements that you would make.
By the end of this lab you will be able to build and test a working multi-agent workflow with parallelism, review and safe termination.
Choosing a framework is a major decision, and each of the main options reflects a different philosophy. In this lesson you will compare LangGraph, CrewAI, AutoGen and custom orchestrators in a structured way.
You will begin with the criteria that matter in an enterprise setting. These include the control you have over the flow, how state and persistence are handled, how easy it is to add limits and approvals, how well the tool supports tracing and testing, how fast you can build a prototype, how mature and well documented the project is and how portable your design remains.
Next you will assess each option. LangGraph gives explicit, graph-based control and strong state handling, with more setup. CrewAI offers a quick way to define role-based teams, with less low-level control. AutoGen is strong for conversational collaboration among agents and for research-style experimentation. A custom orchestrator, written in plain Python, gives complete control and no external dependency, at the cost of building and maintaining the features yourself.
You will build a comparison table and score each option for the same sample requirements. You will see that there is no winner in every case, and that the better choice depends on the team, the risk level and the need for audit.
You will discuss the risk of rapid change in these libraries, with advice on pinning versions, isolating the framework behind your own interfaces and keeping the business logic separate.
You will write a short recommendation for a given scenario.
By the end of this lesson you will be able to compare the main orchestration options against enterprise criteria.
CrewAI makes it easy to define teams in terms that business people understand: roles, goals and tasks. In this lesson you will build role-based agent teams with CrewAI.
You will begin with the concepts. An agent in CrewAI has a role, a goal and a backstory, and may have tools. A task describes the work, the expected output and which agent performs it, and may depend on the output of other tasks. A crew brings agents and tasks together and runs them under a process, such as sequential, or hierarchical with a manager.
Next you will build a crew. You will define a researcher, an analyst and an editor, write the tasks with clear descriptions and expected outputs, connect them through the context mechanism so that each task receives earlier results and run the crew with a local model. You will print the output of each task and the final result.
You will then add control. You will set limits on iterations, add a guardrail or validation step on the output of a task and pass structured outputs through a schema. You will try the hierarchical process and see how a manager agent delegates, and discuss how this affects predictability and cost.
You will examine how to add logging and where to place checks, and note the aspects that may be harder in this framework, such as fine-grained control of the flow and persistence.
You will compare the result with your LangGraph version of a similar workflow.
You will be reminded to check the current CrewAI documentation, since the interfaces change.
By the end of this lesson you will be able to define and run a role-based team with CrewAI and add basic controls.
AutoGen approaches multi-agent work as a conversation. In this lesson you will understand AutoGen teams and group conversations, and see how they differ from graph-based and role-based designs.
You will begin with the concept. In AutoGen, agents are participants in a conversation. They exchange messages, and each decides how to respond, perhaps by calling a tool or by replying to another agent. A team groups agents and defines how turns are taken and when the conversation ends.
Next you will study the team patterns. In a round-robin team, agents speak in a fixed order. In a selector-based group chat, a manager, which is often a model, picks the next speaker according to the state of the conversation. You will see how termination conditions, such as a maximum number of messages or a keyword, stop the conversation, and why these are essential.
You will build a small team of a writer, a critic and a user proxy that represents a human or a checker. You will run a conversation in which the writer proposes, the critic reviews and they iterate until the critic approves or the limit is reached, using a local model. You will read the conversation log to follow the reasoning.
You will analyse the strengths and risks. Conversations are flexible and natural for brainstorming and review, but they can be harder to predict, can wander and may use many tokens. You will think about controls such as strict termination, message size limits and human checkpoints.
You will note that the interfaces change quickly, so you should consult the current documentation.
By the end of this lesson you will be able to build and control a simple AutoGen team conversation.
If your swarm is tied closely to one framework, changing it later is painful. A better approach is to define your own interfaces and contracts, and to treat the framework as a replaceable detail. In this lesson you will create framework-independent agent interfaces and contracts.
You will begin with the problem. Frameworks evolve, may be abandoned or may not suit a future requirement, and teams often want to compare them. If business logic, prompts and schemas are spread through framework-specific code, a change means a rewrite.
Next you will design the interfaces. You will define an abstract agent interface with a simple method that takes a validated input message and returns a validated output message, with metadata such as identifiers and usage. You will define message and result schemas that are independent of any framework, and a tool interface in the same way.
You will then write adapters. Each adapter wraps a framework's agent or crew so that it conforms to your interface, for example one for LangGraph and one for CrewAI. The orchestration code, the tests and the governance controls then work with your interface only. You will implement a fake adapter for testing.
You will define contracts for behaviour. These are checks that every agent must satisfy, such as returning output that matches the schema, respecting the step limits and reporting its token use, and you will write contract tests that can run against any adapter.
You will see how this approach supports security and audit, because policy and logging can be applied at the interface.
By the end of this lesson you will be able to design portable agents behind clear interfaces and contract tests.
After comparing the options, you need a way to choose for your own situation. In this lesson you will choose the right framework for enterprise requirements, using a method that you can reuse and explain to others.
You will begin by gathering requirements. You will list the functional needs, such as the patterns the system needs, the tools and protocols it must use and the models it must support. You will list the non-functional needs, such as security controls, audit, human approval, observability, scale, the skills of the team and the support expectations. You will rank them by importance.
Next you will build a weighted decision matrix. You will give each requirement a weight and each option a score, based on your hands-on experience in the previous lessons, and calculate the totals. You will check the result against your intuition and look at the closeness of the scores, since a narrow margin suggests that other factors, such as team familiarity, should decide.
You will think about risk. You will assess the maturity of each project, the pace of breaking changes, the community, the licence and the availability of support, and consider how to reduce the risk, for example with a thin abstraction layer and pinned versions.
You will study a few typical profiles, such as a regulated company that needs strict control and audit, a start-up that needs speed and a research team that wants to experiment, and see how the answer differs.
You will write a one-page recommendation with the reasoning and the conditions under which you would revisit it.
By the end of this lesson you will be able to select and justify a framework for a given set of requirements.
This lab makes the comparison concrete. You will implement the same workflow with two different agent frameworks, behind the same interface, and compare the results, the effort and the control that each gives.
You will begin by choosing the workflow. A good candidate is a short pipeline with a researcher, a writer and a reviewer, with a loop that sends a rejected draft back for revision. You will write the specification, the schemas for the messages and the success criteria, independent of any framework.
Next you will implement it twice. In the first version, you will use LangGraph, with a state, nodes and a conditional edge. In the second, you will use CrewAI or AutoGen, with agents, tasks or a team. In both cases, you will wrap the implementation in the framework-independent interface from the previous lesson, so that the same test code can run against either.
You will run the contract tests and the scenario tests against both. You will compare the quality of the outputs, the number of model calls and tokens, the time, the amount of code, how easy it was to enforce limits and approvals and how easy it was to trace what happened.
You will record the observations in a comparison report, including the places in which the frameworks behaved differently, and the problems that you met. You will discuss what you would choose for different kinds of projects.
You will note any workarounds that depend on specific library versions.
By the end of this lab you will be able to implement a portable workflow and evaluate frameworks with evidence.
A swarm can only work on a task that it understands, and understanding starts with breaking the task into parts. In this lesson you will study task decomposition and intelligent agent selection, which are the first steps of any coordinated effort.
You will begin with decomposition. A large goal, such as preparing a market analysis, is divided into smaller tasks that can be assigned, checked and combined. You will learn the characteristics of a good decomposition: each task has a clear purpose, a defined input and output, a way to verify it and a manageable size. You will see the common mistakes, such as tasks that are too large to check, tasks that overlap and hidden dependencies between them.
Next you will study how a planner agent can perform the decomposition, and how to make its output structured, with a list of tasks, their dependencies and the capability needed for each. You will validate the plan with code, checking for cycles in the dependencies, missing fields and an excessive number of tasks.
You will then look at agent selection. Given a task, the system must choose which agent should do it. You will compare simple approaches, such as a fixed mapping from task type to agent, with capability matching, in which agents advertise what they can do and the orchestrator picks the best fit, and with a model-based selector. You will discuss the trade-offs in predictability and in cost.
You will consider safety, such as ensuring that the selected agent is authorised to do the task, and that a plan cannot be manipulated by untrusted input to include actions that were not intended.
You will implement a decomposer and a selector for a sample goal.
By the end of this lesson you will be able to break goals into verifiable tasks and match them to suitable agents.
In a swarm, the amount of work and the availability of agents change from moment to moment. Allocation that is decided once at the start may not be the best. In this lesson you will study dynamic task allocation and work distribution.
You will begin with the idea of a task queue. Tasks are placed in a queue with their priority, their requirements and their status, and agents or an allocator take tasks from it. You will compare a push model, in which a coordinator assigns each task, with a pull model, in which idle agents claim the next suitable task, and see the benefits of each for load balancing and control.
Next you will study the allocation criteria. These include the capability of the agent, its current load, the cost of the model that it uses, the priority and deadline of the task and the sensitivity of the data involved, since some tasks should be handled only by agents with the right clearance. You will implement a scoring function that combines these factors, and see how to keep it transparent and testable.
You will then learn how to handle the practical problems. A task can be claimed by two agents at once, an agent can fail while holding a task or a task can be sent back repeatedly. You will use claims with timeouts, retries with limits and a dead-letter queue for tasks that cannot be completed, which are reviewed by a human.
You will add fairness and limits, such as preventing one agent from taking all the work and capping the number of tasks in flight.
You will build a small allocator and test it under different loads.
By the end of this lesson you will be able to distribute work among agents dynamically and safely.
Agents will sometimes disagree, compete for the same resource or produce conflicting results. A swarm must have a way to handle this that is productive and bounded. In this lesson you will study agent collaboration, negotiation and conflict resolution.
You will begin with the types of conflict. Two agents may produce different answers to the same question. They may recommend incompatible actions. They may try to change the same piece of shared state. They may have goals that pull in different directions, such as one optimising for speed and another for accuracy.
Next you will study the resolution methods. A supervisor can decide, based on defined criteria. Agents can exchange arguments in a structured way, for example a proposal, a critique and a revision, for a limited number of rounds. Scoring against explicit rubrics can rank the options. Priority rules can decide which agent wins in a particular category. Some conflicts should be escalated to a human, especially when the stakes are high.
You will then implement a bounded negotiation. Two agents propose solutions, each critiques the other's, and a judge applies a rubric, with a hard limit on the rounds. You will log the arguments and the decision so that the outcome can be explained.
You will look at the failure modes, such as agents that always defer to each other, agents that repeat their positions and agents that are persuaded by confident but wrong claims. You will see how structure, evidence requirements and independent checking reduce these risks.
By the end of this lesson you will be able to design conflict resolution that is bounded, explainable and safe.
When one agent's answer is not enough, several can be asked, and their results compared. In this lesson you will study voting, consensus and multi-agent verification, which are practical ways to improve reliability.
You will begin with voting. Several agents, or several runs of the same agent, answer the same question, and the most common answer is chosen. You will see why this can reduce random errors, and how to apply it to classification, extraction and decisions with a limited set of answers. You will learn about weighted voting, where more reliable agents count for more, and about thresholds, such as requiring a clear majority and escalating when there is none.
Next you will study consensus. This asks for agreement, perhaps through several rounds of discussion, and is more suitable for open-ended tasks. You will see its risks, which include groupthink, in which agents reinforce one another's mistakes, and the cost of many rounds.
You will then study verification. A verifier agent, or a deterministic check, tests the output of another agent against the sources, the rules or the schema. You will implement checks such as confirming that each claim cites a source, recalculating numbers with code and testing that the output satisfies the constraints. You will see why independence matters, using different prompts, different models or different data.
You will measure the benefit. You will run a test set with and without voting and compare the accuracy and the cost.
You will decide when the extra cost is justified.
By the end of this lesson you will be able to apply voting, consensus and verification to increase reliability.
Agents need shared understanding to collaborate, and that understanding lives in memory and context. In this lesson you will study shared memory, context propagation and knowledge management in swarms.
You will begin with the kinds of memory. Short-term memory is the context of a current run. Long-term memory persists across runs, and may be stored in a database or a vector store. Shared memory is visible to several agents, and private memory belongs to one. You will see examples of each, and consider what should be stored.
Next you will study context propagation. When a task passes through several agents, the relevant context must travel with it, without growing without limit. You will learn to pass the goal, the constraints and the decisions made so far, and to summarise or reference the rest. You will see how to carry identifiers and provenance, so that every piece of information can be traced to its source.
You will then examine knowledge management. You will look at how to organise facts, how to attach metadata such as source, date and confidence, how to update or retire outdated entries and how to resolve conflicts between entries. You will implement a simple shared memory with typed entries, access rules and timestamps.
You will consider the risks. Shared memory is a place where mistakes, and malicious content, can persist and spread, which you will study in the security sections. You will begin to apply controls, such as validating what is written, recording who wrote it and limiting who can read it.
By the end of this lesson you will be able to design shared memory and context flow that are useful and controlled.
Multi-agent systems can fail in ways that individual agents do not. Agents can bounce a task between each other, wait on one another forever or repeat the same exchange without progress. In this lesson you will learn to detect agent loops, deadlocks and coordination failures.
You will begin with the failure types. A loop is a repeated sequence of actions or messages that does not progress. A deadlock occurs when agents each wait for another to act first. A livelock occurs when they keep responding to one another without making progress. Task flooding occurs when agents create so many sub-tasks that the system is overwhelmed. Coordination failures also include duplicated work and lost handoffs.
Next you will study how to detect them. You will track the sequence of messages and actions, compute fingerprints of recent outputs and flag repetition, measure progress against the plan and watch the depth of delegation and the length of queues. You will set time limits on waiting and keep a graph of who is waiting for whom, which lets you find cycles.
You will then implement the responses. You will break loops with limits on repetition, force a decision or an escalation after a number of rounds, time out waits and cancel work that has no owner. You will record every intervention in the log.
You will build a monitor that watches a running swarm and raises an alert, and test it with fake agents that are programmed to loop and to deadlock.
You will discuss prevention through design, such as acyclic flows and clear ownership.
By the end of this lesson you will be able to detect and stop coordination failures in a swarm.
In this lab you will build a collaborative decision-making swarm that combines the techniques of the section. Several agents will analyse a decision, vote and verify one another, and the system will produce a recommendation with its reasoning and its level of confidence.
You will begin with the scenario, such as choosing between vendors for a service, with a set of criteria and sample data. You will define the agents, which include specialists for cost, risk and quality, a moderator and a verifier, and define the schemas for their assessments.
Next you will build the workflow. A decomposition step splits the decision into the criteria. The specialists each score the options in parallel, citing the evidence. The moderator combines the scores using weights and identifies disagreements. Where agents disagree significantly, a bounded negotiation round takes place. The verifier checks the numbers and citations, and a final vote or rule yields the recommendation.
You will add the safeguards. These include a limit on the rounds, a loop and deadlock monitor, a rule that escalates to a human when confidence is low or the agents are split and logging of every assessment and decision.
You will run the swarm on several cases, including one with conflicting evidence and one with missing data, and check how it behaves. You will compare the outcome with a single-agent baseline for quality and cost.
You will write tests for the control flow and the monitors using fake agents.
By the end of this lab you will be able to build and evaluate a collaborative decision-making swarm with safeguards.
Agents need to exchange information in organised ways, and the choice of communication model shapes the whole system. In this lesson you will study agent communication models and messaging patterns.
You will begin with the basic models. In direct messaging, one agent sends a message to another and may wait for a reply. In publish and subscribe, agents publish messages to topics and others subscribe to those that interest them. In a shared workspace, agents read and write a common store. In a request and response pattern, one agent asks and another answers, and in streaming, results flow continuously.
Next you will study the messaging patterns. You will see synchronous and asynchronous communication, with the effect on latency and coupling, queues that buffer work, broadcast and targeted messages, acknowledgements and retries, and correlation identifiers that tie replies to requests. You will learn why every message should carry the sender, the recipient, a unique identifier, a timestamp and the identifier of the overall job.
You will then look at the properties that matter in an enterprise. These are reliability, such as whether a message can be lost or processed twice, ordering, size limits, schema validation, authentication of the sender and the ability to record and replay messages for audit.
You will implement a small in-memory message bus with topics, subscriptions and structured messages, and use it to connect three agents. You will add a log of all messages.
You will discuss which model suits which kind of swarm.
By the end of this lesson you will be able to choose and implement communication patterns for a swarm.
As agents come from different teams and vendors, they need a common language for working together. The Agent2Agent protocol, known as A2A, is an open effort to provide one. In this lesson you will understand the Agent2Agent protocol and what it standardises.
You will begin with the problem. Without a standard, every pair of agent systems needs a custom integration, and agents built with different frameworks cannot easily collaborate. A2A defines how one agent can discover another, describe a task, exchange messages and receive results, regardless of how each was built.
Next you will study the main concepts. A client agent sends a task to a remote agent, which acts as a server. A task has an identifier and a lifecycle, with states such as submitted, working, input required, completed and failed. Messages carry parts, such as text, files or structured data, and the results are returned as artefacts. The protocol runs over common web technologies, with support for long-running tasks and streaming updates.
You will see how it relates to other pieces. MCP connects an agent to tools and data, while A2A connects an agent to other agents. They are complementary, and a real system may use both.
You will look at the security aspects that the protocol expects you to handle, such as authentication, authorisation and the validation of messages, and why you should not trust a remote agent simply because it speaks the protocol.
You will read a sample exchange and trace a task through its states.
You will be reminded to consult the current specification, since it continues to evolve.
By the end of this lesson you will be able to explain what A2A is and describe a basic task exchange.
Before one agent can ask another for help, it must find that agent and learn what it can do. In this lesson you will study agent discovery, agent cards and capability negotiation.
You will begin with discovery. In a small system, the agents are known in advance and configured by hand. In a larger or more open one, agents must be found through a registry or a well-known location. You will see how an agent can publish a description of itself at a standard address, and how a client can retrieve it.
Next you will study agent cards. An agent card is a structured document that describes an agent, with its name, a description, its version, the address of its endpoint, the skills or capabilities that it offers, the input and output formats it supports and the authentication methods it requires. You will read an example and write one for an agent of your own. You will see how the card allows a client to decide whether the agent suits a task.
You will then study capability negotiation. The client compares its needs with the declared capabilities, selects the agent, chooses a supported format and authentication method and starts the task. You will implement a simple registry and matcher.
You will consider trust. A card is a claim, not proof. A malicious agent might describe itself falsely, copy the name of a trusted agent or change its card later. You will learn to verify identity through signatures and certificates where available, to keep an allow list of approved agents and to review changes to cards.
By the end of this lesson you will be able to describe, publish and discover agents with cards, and treat the information with care.
Agents are limited by what they can reach. The Model Context Protocol, known as MCP, is a standard way to connect them to tools, data and other resources. In this lesson you will study MCP for tool and resource access.
You will begin with the idea. Instead of writing custom code for each tool and each agent framework, you run an MCP server that exposes capabilities in a standard form, and any MCP client can use them. The result is a growing ecosystem of servers for files, databases, search, ticketing and many other systems.
Next you will study the main concepts. A server can offer tools, which are actions that the model may call, resources, which are data that can be read, and prompts, which are reusable templates. A client, usually inside an application or agent, discovers what a server provides, passes the descriptions to the model and sends the calls that the model chooses. Communication takes place over a standard transport, locally or over the network.
You will build and use a simple server. You will write a small Python MCP server with a tool and a resource, run it and connect an agent to it, and observe the discovery and the calls.
You will then consider the security issues, which are significant. A server may be untrusted, tool descriptions can contain manipulative text, tools may be over-powerful and credentials must be handled with care. You will learn to use only trusted servers, review tool descriptions, apply least privilege, require approval for sensitive actions and log every call.
You will compare MCP with A2A, and place both in your architecture.
By the end of this lesson you will be able to use MCP to connect agents to tools and resources safely.
Agents that exchange free-form text are fragile. A small change in wording can break the next step, and a malicious or faulty message is hard to detect. In this lesson you will use structured messages, schemas and contract validation to make communication dependable.
You will begin with the case for structure. When messages follow a defined schema, the receiving agent knows where to find each piece of information, tools can check the message automatically and the system can reject anything that does not conform. This turns many vague failures into clear, early errors.
Next you will design schemas. You will define the common envelope of a message, with fields such as identifier, sender, recipient, type, timestamp, correlation identifier and version, and payload schemas for each message type, such as task request, task result, error and approval request. You will use a validation library such as Pydantic or JSON Schema to define and enforce them.
You will then implement validation at the boundaries. Every message is validated when it is sent and again when it is received, with limits on size, allowed values and nested depth. Invalid messages are rejected with a clear error and recorded. You will add schema versions and a plan for changing them without breaking running systems.
You will write contract tests that check that each agent produces and accepts messages according to its declared contract, and use them in your test suite.
You will think about the security value. Validation limits what a hostile message can carry, though it does not guarantee that the content is true or safe.
By the end of this lesson you will be able to define and enforce message contracts in a swarm.
When agents talk to each other and use tools, every connection is a potential path for an attack. In this lesson you will study how to secure inter-agent communication and tool access, from a defensive point of view.
You will begin with the threats at a high level. Messages can be forged or altered, an agent can pretend to be another, a message can contain instructions that manipulate the receiver, a tool can be called by an agent that should not use it and information can leak through messages or logs. You will relate each to a control.
Next you will study the controls. You will require every agent to authenticate and to prove its identity, using mutual TLS, signed tokens or workload identity, so that messages come from known senders. You will encrypt communication in transit. You will sign messages where integrity matters. You will authorise each request against a policy that says which agent may ask which other agent to do what, and which tools it may call.
You will learn to treat content from other agents as untrusted input. You will validate it against its schema, limit its size, separate instructions from data and avoid giving it the authority of a system instruction. You will apply the same approach to tool outputs.
You will then cover limits and visibility. You will add rate limits and hop limits, record every message and tool call with the identity of the caller and monitor for unusual patterns.
You will draw the trust boundaries on an architecture and mark the control at each one, then implement authentication and a policy check on a simple message bus.
By the end of this lesson you will be able to apply layered controls to agent communication and tool access.
This lab joins two protocols and a set of controls. You will connect agents through A2A and MCP interfaces, with structured messages and basic security, so that you can see how they fit together in practice.
You will begin with the architecture. You will plan two agents, a client agent that handles requests and a remote specialist agent that exposes a skill through A2A, and an MCP server that offers a tool and a resource to the specialist. You will draw the flows and mark where authentication and validation are needed.
Next you will build the pieces. You will write the MCP server in Python, with a safe, read-only tool such as a lookup in a local data file, and connect the specialist agent to it. You will give the specialist an agent card and a small A2A-style interface, using the libraries or a simplified implementation, that accepts a task, reports its status and returns an artefact. You will write the client agent that discovers the specialist through its card and sends a task.
You will add the controls. You will validate every message with schemas, require a token for the A2A call, check the caller against an allow list, restrict the MCP tool to specific arguments and log every call with the caller's identity.
You will test the normal path, an unauthorised caller, an invalid message and a tool call that is outside the allowed scope, and check that each is rejected and recorded.
You will review what worked and what you would strengthen for production.
By the end of this lab you will be able to connect agents through standard protocols with validation and access control.
Agents act in systems, which means that they need identities, just as people do. In this lesson you will understand non-human identities in agent swarms, and why they are a central security concern.
You will begin with the concept. A non-human identity is an account, key, token or certificate that represents a program, service or agent and not a person. Organisations already have many of them, and often more than they have people. Each agent in a swarm that calls an API, reads a database or sends a message acts through one.
Next you will study why this matters. Agents are autonomous and act quickly, so a compromised or misdirected identity can do a great deal of harm before anyone notices. Non-human identities are often over-privileged, shared between several agents, long-lived, poorly documented and left in place after a project ends. Credentials are placed in code, in prompts or in logs.
You will learn the principles for managing them. Give every agent its own identity, never share one between agents or with humans. Record the owner and purpose of each identity. Give it only the permissions it needs. Prefer short-lived credentials to long-lived ones. Make it possible to trace every action to an identity. Review and retire identities on a schedule.
You will build an inventory for a sample swarm, listing each agent, its identities, its permissions, its owner and its expiry. You will find the gaps, such as a shared key or an agent with more access than its role needs.
You will connect this to the governance work in later sections.
By the end of this lesson you will be able to describe the risks of non-human identities and the principles for managing them.
An agent has to prove who it is before it is allowed to do anything. In this lesson you will study agent authentication, service identities and workload identity, and the methods that avoid storing secrets in code.
You will begin with the basics of authentication for services. You will compare API keys, which are simple but easy to leak and hard to rotate, with tokens issued by an identity provider, such as those using OAuth 2.0 client credentials, with short lifetimes and defined scopes. You will see how certificates and mutual TLS prove identity at the connection level.
Next you will study workload identity. This approach lets a workload, such as a container or a function, obtain credentials from its platform, based on where and how it runs, so that no long-lived secret has to be stored or distributed. You will see the idea behind standards such as SPIFFE and the equivalent features of cloud platforms, and why they reduce the risk of credential theft.
You will then apply these ideas to swarms. Each agent receives its own identity and obtains short-lived tokens, the tokens identify the agent and carry its permitted scope and the receiving services verify the token. You will implement a simplified token service in Python that issues signed, expiring tokens with scopes, and a verifier that checks the signature, the expiry and the scope.
You will consider what to do when something goes wrong, with revocation and rapid rotation.
You will test the token flow with valid, expired, tampered and out-of-scope tokens, using only local, sample keys.
By the end of this lesson you will be able to implement and reason about strong authentication for agents.
Authentication tells you who an agent is, and authorisation decides what it may do. Two common models are role-based and attribute-based access control. In this lesson you will study how to apply both to agents.
You will begin with role-based access control. Permissions are grouped into roles, such as researcher, reviewer or publisher, and agents are assigned roles. This is simple to understand and to audit, and it works well when responsibilities are stable. You will implement a role table and a check function, and see how roles map to the agent role cards that you wrote earlier.
Next you will study attribute-based access control. Decisions depend on attributes of the agent, the resource, the action and the context, such as the sensitivity of the data, the environment, the time or the task that the agent is working on. This allows finer and more dynamic rules, such as allowing an agent to read only the documents that belong to the customer whose case it is handling. You will implement a small policy that evaluates attributes.
You will learn how to combine the two, using roles for the broad structure and attributes for the fine detail. You will see why decisions should be enforced outside the model, in code or in a policy engine, since a prompt cannot be relied upon to enforce access.
You will test the rules with allowed and denied cases, and log the decisions with their reasons.
You will review common mistakes, such as roles that grow too wide, and rules that are never reviewed.
By the end of this lesson you will be able to design and implement RBAC and ABAC for agents.
The principle of least privilege is especially important for agents, because their behaviour is not fully predictable. In this lesson you will study least privilege and just-in-time authorisation.
You will begin with least privilege. Each agent should hold only the permissions that its role requires, and no more, and for the shortest time necessary. You will review the typical over-grants, such as an administrator role given for convenience, and a broad token reused by several agents, and analyse what damage they could cause.
Next you will study how to find the right level. You will start with no access and add permissions as the agent's tasks require, based on observed needs, and you will review the logs of the denied calls to refine the set. You will separate read access from write access, and separate low-impact from high-impact actions.
You will then learn about just-in-time authorisation. Rather than giving an agent standing access, it requests the permission when it needs it, for a specific task and a limited period. A policy or a human approves the request, a short-lived credential is issued and it expires automatically. You will implement a simple version, in which an agent asks for a scoped token for a task, a policy decides and the token expires after a few minutes.
You will add task binding, so that a token is valid only for the job that it was granted for, which limits the use of a stolen token.
You will test the flow and examine the logs.
You will discuss the balance between security and the speed of the workflow.
By the end of this lesson you will be able to apply least privilege and issue just-in-time permissions to agents.
Agents often act on behalf of others, including users and other agents. If authority is passed along carelessly, it can grow beyond what was intended. In this lesson you will study the secure delegation of authority between agents.
You will begin with the problem. A supervisor receives a request from a user and delegates parts of it to workers. Which permissions should the workers have? If they use the supervisor's full authority, a compromised worker can do far more than its task requires. If they use their own, they may lack the right to act for the user. The design must make the scope clear.
Next you will study the principles. A delegate should never receive more authority than the delegator has. The delegation should be limited in purpose, scope, time and depth. It should be explicit and verifiable, so that every service can see who is acting, on whose behalf and under what restrictions. You will study the approaches, including token exchange, in which a token is swapped for a narrower one, and tokens that carry an actor and a subject.
You will implement delegation in a small example. The supervisor requests a narrowed token for each worker, with the allowed actions and the task identifier, and the resource server checks both the narrow scope and the chain. You will cap the depth, so that a worker cannot delegate indefinitely.
You will consider the audit trail, recording each delegation, and the revocation of delegated authority when a task is cancelled.
You will test with attempts to exceed the delegated scope and check that they are refused.
By the end of this lesson you will be able to design and test delegation that does not widen authority.
Agents need credentials to call services, and credentials are one of the most sensitive parts of any system. In this lesson you will study secrets management, credential rotation and isolation for swarms.
You will begin with the common mistakes. Secrets are written into source code, placed in prompts or in memory that agents can repeat, printed in logs, shared between agents and left unchanged for years. You will see how an agent that can read a secret may also be tricked into revealing it, and why the model should never see credentials it does not need.
Next you will study the safer approach. You will keep secrets in a dedicated secrets manager or a platform facility, and not in files in the repository. The code that makes a call retrieves the secret at the moment of use, and the model sees only the result and never the credential. You will use environment variables or a secrets API in the labs, with sample values only, and see how to apply the same pattern with a managed service.
You will then look at rotation. Credentials should be changed regularly and immediately after a suspected exposure. You will design for rotation by making sure that secrets can be replaced without code changes, using short-lived credentials where possible, and by testing the rotation process.
You will study isolation. Each agent receives its own secrets, access to them is limited and logged, and tool code that uses credentials runs in a separate boundary from the model. You will add redaction to logs and messages, so that secret-like values are masked.
You will implement a small secrets wrapper and test it.
By the end of this lesson you will be able to handle agent credentials safely and plan for rotation.
This lab asks you to bring the identity topics together. You will implement fine-grained permissions for a small swarm, with agent identities, tokens, roles, attributes and delegation, and test that the rules behave as designed.
You will begin with the scenario and the design. A supervisor and three workers handle customer cases, one reading case records, one drafting replies and one issuing refunds up to a limit, all with sample data. You will write the permission model, listing each agent's role, the actions that it may take, the attributes that limit it and the approval it needs for high-impact steps.
Next you will build the pieces. You will create a token service that issues short-lived, scoped tokens for each agent identity, a policy module that combines role and attribute checks, a delegation function that issues narrower tokens for specific tasks and a resource layer that enforces the decisions for every tool call. You will keep secrets out of the code, and load sample keys from the environment.
You will then write tests. They cover the allowed actions, a worker trying an action outside its role, a token that has expired, a token for another task, an attempt to delegate more authority than held, a refund above the limit that must be approved and a request that tries to use a different customer's record. You will check that each denial is logged with a reason.
You will review the logs to confirm that every action can be traced to an identity, a task and a policy decision.
You will list the gaps that remain and how you would close them.
By the end of this lab you will be able to implement and test fine-grained, auditable permissions for agents.
Before a multi-agent system can be defended, its risks must be understood. In this lesson you will build a clear picture of the threat landscape of AI agent swarms, and why it is broader than the landscape of a single chatbot.
You will begin with what changes when agents collaborate. A single model answers a question. A swarm reads documents, calls tools, writes to memory, delegates to other agents and acts on external systems. Each of these capabilities adds an attack surface, and each connection between agents adds a trust relationship that someone may try to abuse.
Next you will map the surfaces of a typical swarm: user inputs, retrieved documents and web content, tool outputs, messages between agents, shared memory, credentials and tokens, the orchestrator itself, and the supply chain of models, libraries and plugins. For each surface you will ask who can influence it, what the agent does with it and what the worst result could be.
You will then learn how to describe threats in a structured way, with an asset, an actor, a capability, an entry point and an impact. You will see why autonomy and delegation amplify impact, since one manipulated message can trigger a chain of actions.
You will also learn the main categories of risk that the rest of this section examines, and how they connect to the defensive controls in the next section. All discussion stays conceptual and defensive, and any exercises use synthetic data in isolated environments.
You will produce a simple surface map of a sample swarm.
By the end of this lesson you will be able to describe the attack surfaces of a multi-agent system and explain why collaboration increases risk.
Security teams need shared vocabulary to talk about agent risks. In this lesson you will study the OWASP list of top risks for agentic applications and learn how to use it as a practical checklist.
You will begin with the purpose of such lists. They are not complete standards, but they collect the most common and most serious problems that practitioners have observed, so that teams can prioritise. You will learn how the agentic list differs from the earlier list for large language model applications, with a stronger focus on autonomy, tools, identity, memory and communication between agents.
Next you will walk through the categories at a conceptual level. These include goal manipulation, misuse of tools, weak identity and privilege control, unsafe handling of memory and context, insecure communication between agents, cascading failures, excessive autonomy, and gaps in oversight and logging. For each category you will learn what it means, a plain example of how it could appear in a swarm and the type of control that reduces it.
You will then learn how to map the list to your own system. You will take a swarm design and, for each category, note whether it applies, what evidence you have that it is handled and what is missing. This produces a gap list that can be turned into work items.
You will also see how the list relates to other frameworks, so that findings can be reported in more than one language.
You will complete a short mapping for a sample swarm.
By the end of this lesson you will be able to use the OWASP agentic risk list to assess a swarm and prioritise defensive work.
Language models follow instructions found in text, and that is the root of prompt injection. In this lesson you will study prompt injection and goal hijacking in agent swarms, with a defensive focus.
You will begin with the basic idea. An agent receives instructions from its operator, but it also reads content from users, documents, web pages and other agents. If that content contains text that looks like instructions, the model may follow it, even though it came from an untrusted source. You will learn the difference between direct injection, where a user supplies the text, and indirect injection, where the text hides inside data the agent retrieves.
Next you will study why swarms magnify the problem. A hijacked agent may pass altered goals or poisoned results to its peers, which treat them as trustworthy. You will see how the goal of a whole workflow can drift from what the user wanted. You will use harmless marker phrases in a sandbox to observe how an agent reacts to embedded instructions, without any real payloads or real systems.
You will then learn the defensive layers. These include separating instructions from data, labelling untrusted content, limiting the tools an agent can reach, validating outputs before action, requiring approval for sensitive steps and monitoring for goal drift. You will understand that no single layer is sufficient, so they are combined.
You will test a sample agent with benign markers and record the results.
By the end of this lesson you will be able to explain prompt injection and goal hijacking and describe layered defences against them.
Agents often trust each other by default, and that trust can be abused. In this lesson you will study malicious agents, impersonation and trust exploitation, and the defensive measures that address them.
You will begin with the trust problem. In many frameworks, any message that arrives in the right format is treated as coming from a legitimate teammate. If an unauthorised agent can join the swarm, or if one agent can claim to be another, then it may be able to influence decisions, request actions or collect information. You will learn the scenarios in concept: a rogue agent added through a compromised plugin, a spoofed sender identity and a compromised agent abusing its reputation.
Next you will study the properties that stop these problems. Strong agent identity, so that each agent has a verifiable credential. Message authentication, so that the receiver can confirm who sent it and that it was not altered. Registration controls, so that only approved agents may join. Least privilege, so that even a legitimate agent can only do limited things. And transitive trust limits, so that one agent's claim does not automatically become another's fact.
You will then learn how to detect suspicious behaviour, such as unusual message patterns, unexpected tool use or an agent acting outside its role, and how to quarantine it.
You will walk through a sandboxed example using synthetic agents and harmless markers to see how missing authentication shows up in the logs.
By the end of this lesson you will be able to describe impersonation and trust risks in swarms and choose controls that limit them.
Tools give agents their power, and they are also where the greatest damage can occur. In this lesson you will study tool misuse, privilege escalation and unauthorised actions, and how to prevent them.
You will begin with how misuse happens. An agent may call a tool with arguments that the designer never expected, because the model misunderstood the task or was manipulated. It may chain tools in a way that reaches further than any one tool allows. Or it may use credentials that are broader than the task requires. You will learn the idea of privilege escalation in a swarm, where an agent with limited rights persuades a more powerful agent to act on its behalf, which is sometimes called the confused deputy problem.
Next you will study the design principles that reduce the risk. Give each agent only the tools its role needs. Scope credentials narrowly and make them short-lived. Validate tool arguments against a schema and against policy before the call runs. Separate read-only tools from tools that change state. Put dangerous actions behind approval. And check the requester's rights, not just the executor's rights, when one agent delegates to another.
You will then learn how to log tool calls with enough detail to investigate later, and how to set rate limits and spending limits as a final safeguard.
You will review a sample tool set and rank its tools by potential impact, using only synthetic, sandboxed tools.
By the end of this lesson you will be able to identify tool misuse and escalation risks and apply least-privilege controls to agent tools.
An agent's memory shapes its future decisions, so corrupting memory can corrupt behaviour over time. In this lesson you will study memory poisoning and cross-agent context manipulation, with a defensive approach.
You will begin with the role of memory in a swarm. Agents store notes, summaries, retrieved facts and shared state so that they do not start from nothing each time. You will learn how an untrusted piece of content, once written into memory, can persist, be retrieved later and be treated as established truth by the same agent or by others.
Next you will study the conceptual patterns. Poisoned entries that influence future tasks, shared context that carries unverified claims between agents, and summaries that gradually lose or distort important caveats. You will see why this kind of problem is hard to notice, since the harm appears later and far from the cause. You will use clearly marked synthetic entries in a sandbox to observe how a stored claim can spread.
You will then learn the defences. Record the source and time of every memory entry. Separate trusted and untrusted memory. Validate or review content before it is stored. Give entries expiry dates and the ability to be removed. Limit which agents can write to shared memory. And monitor for entries that appear suddenly or that contradict established facts.
You will also study how to roll back a contaminated memory to a known good state.
You will implement provenance tags on a small memory store.
By the end of this lesson you will be able to explain memory and context manipulation risks and apply provenance and write controls to reduce them.
Agents handle valuable information, and swarms move it between many components. In this lesson you will study sensitive data exfiltration and supply chain risks, and the defensive practices that address both.
You will begin with data exposure. An agent with access to private documents, databases or credentials might reveal them in an output, send them to an external service through a tool, or write them to a log or to shared memory. You will learn the typical paths for unwanted data flow in a swarm, and why the combination of private data access, exposure to untrusted content and an outbound channel deserves special attention.
Next you will study controls. Classify the data that agents may use and apply access policies. Redact or tokenise sensitive fields. Restrict outbound destinations to an approved list. Scan outputs for patterns of secrets and personal data. Keep secrets out of prompts. And log data access so that unusual volume can be detected. You will use synthetic fake records for any exercise.
You will then look at the supply chain. A swarm depends on models, frameworks, plugins, tool servers, prompts and data sets, any of which could be changed or compromised. You will learn practical measures such as pinning versions, verifying sources, keeping a bill of materials, scanning dependencies, reviewing third-party tools before approval and isolating them when possible.
You will build a short checklist that covers both data and dependency risks.
By the end of this lesson you will be able to identify data leakage paths and supply chain exposures in a swarm and select appropriate controls.
In this hands-on lab you will apply what you have learned about threats by modelling the risks of a local agent swarm and testing its defences in a safe environment.
You will begin with a small swarm running locally with Ollama, containing a researcher, a writer and a tool-using agent. Everything runs on your own machine with synthetic data, so no real systems are involved. You will draw a data flow diagram that shows the inputs, agents, tools, memory and outputs, and mark the trust boundaries.
Next you will perform a structured threat model. For each component and each flow you will list possible threats using the categories from the earlier lessons, and rate them by likelihood and impact. You will write the results into a table that includes the existing controls and the gaps.
You will then run a set of safe tests. You will place harmless marker phrases in a document and observe whether the agent treats them as instructions. You will check whether the tool agent accepts out-of-scope arguments, whether a message from an unknown sender is accepted and whether a synthetic fake secret can leak into output or logs. Each test has a clear expected result and a place to record the observed result.
Finally you will rank the findings, propose mitigations and write a short report that a team could act on. No working attack code is used or produced.
By the end of this lab you will be able to threat-model a swarm and run safe, benign tests that reveal gaps in its defences.
This course contains the use of artificial intelligence.
Master Multi-Agent AI Systems, Agent Orchestration, AI Security, MCP, A2A, and Enterprise AI Governance
The future of Artificial Intelligence (AI) is moving beyond individual chatbots and standalone AI agents toward intelligent, collaborative AI Agent Swarms. Imagine multiple autonomous agents working together, sharing information, delegating responsibilities, making decisions, and solving complex enterprise challenges. This course teaches you how to design, build, orchestrate, secure, and govern these powerful multi-agent AI systems.
AI Agent Swarms: Architecture, Security & Governance is a practical, comprehensive course for AI Engineers, Software Developers, Enterprise Architects, Cybersecurity Professionals, DevSecOps Engineers, and Technology Leaders who want to master the next generation of Agentic AI.
What You'll Learn
Explore the technologies, architectures, and engineering practices behind enterprise-ready AI agent swarms:
AI Agent Swarms & Multi-Agent Systems: Understand autonomous AI agents, swarm intelligence, agent collaboration, task delegation, and distributed decision-making.
Agentic AI Architecture: Design centralized, decentralized, hierarchical, supervisor-worker, and peer-to-peer multi-agent architectures.
AI Agent Frameworks: Build practical applications using Python, LangGraph, CrewAI, AutoGen, Ollama, and Large Language Models (LLMs).
Agent Orchestration: Implement parallel execution, dynamic task allocation, workflow automation, shared memory, and intelligent agent coordination.
MCP & A2A Protocols: Explore Model Context Protocol (MCP), Agent2Agent (A2A) communication, agent discovery, tool integration, and interoperability.
AI Agent Security: Protect systems against Prompt Injection, Agent Hijacking, Tool Misuse, Data Exfiltration, Memory Poisoning, and Privilege Escalation.
Zero Trust & Identity Security: Implement Non-Human Identity (NHI), authentication, authorization, least privilege, secure delegation, and policy enforcement.
Enterprise AI Governance: Apply NIST AI Risk Management Framework, OWASP Agentic AI Security, responsible AI principles, compliance controls, and auditability.
AI Observability & Evaluation: Monitor agent behavior using OpenTelemetry, distributed tracing, performance metrics, and automated evaluation.
Scalability & Cost Optimization: Improve reliability, reduce LLM token consumption, optimize inference costs, and manage resource utilization.
Human-in-the-Loop AI: Implement approval workflows, operational safeguards, and human oversight for autonomous AI systems.
Learn by Building Real AI Systems
This isn't just another theoretical Generative AI course. You'll gain practical experience through hands-on exercises, architectural design activities, security assessments, and implementation projects.
You'll learn how to connect multiple agents, create secure communication channels, enforce governance policies, detect failures, optimize performance, and evaluate the effectiveness of collaborative AI workflows.
The course culminates in a comprehensive Enterprise AI Agent Swarm Capstone Project, where you'll design and implement a secure, observable, governed multi-agent application.
Why Take This Course?
Organizations adopting Enterprise Generative AI, AI Automation, Intelligent Agents, and Autonomous Workflows need professionals who understand both the opportunities and risks of multi-agent architectures.
Learning to build AI agents is only the beginning. Real enterprise value comes from creating systems that are scalable, reliable, secure, cost-efficient, observable, and governed.
Whether you're advancing your career in AI Engineering, Agentic AI Development, AI Architecture, AI Security, or AI Governance, this course provides the practical foundation to confidently design and implement next-generation intelligent systems.
Start building secure, enterprise-ready AI Agent Swarms today!