Leea Labs
  • 👋Welcome to Leea Labs
  • Intro to Multi-Agent Systems
  • Leea Platform
  • Integration guides
    • SDK and How to Integrate (Your first agent)
    • Use agents through public API
  • Agent Protocol Architecture
  • Data streams & real-time events
  • Limitations and Challenges for Agents solved by Leea
  • F.A.Q.
    • F.A.Q. Multi-Agents AI Systems
    • F.A.Q. Leea Protocol
  • Protocol Architecture
    • Leea Protocol introduction
    • Architecture overview
    • Security
    • Network and Virtualization
    • Node provider requirements
    • How to connect your node
Powered by GitBook
On this page
  • Controller API
  • Leea Node controller
  • Validators
  • Image registry
  • External marketplaces API
  • Agent registration process
  • Configuration file
  • Running Leea Agent app
  • Process of launching User VM
  • Accessing VM from Internet
  • Short FAQ:
  1. Protocol Architecture

Architecture overview

PreviousLeea Protocol introductionNextSecurity

Last updated 7 months ago

The architecture of the Leea Protocol is built around principles of maximum security and usability.

Controller API

The Controller is an operational unit serving multiple purposes:

  • Stores an inventory of nodes

  • Dispatches orders to agents

  • Manages the network peers list

  • Provides an API for the dashboard

Leea Node controller

Node controller manages a specific node, making it accessible within the network.

The Node controller is an application installed on a node and includes both hypervisor and transport functionalities. The hypervisor's role is to launch VMs and make them accessible through the Service VM.

The Service VM starts automatically after node setup, using a small allocation of resources to handle:

  • Network connectivity and dynamic routing

  • Firewalls

  • An external gateway to the network (if the node has a public IP)

  • DHCP

Validators

Validators are crucial for securing the protocol.

They store portions of encryption keys and validate VM integrity to prevent malicious nodes from accessing VM internals.

Image registry

The image registry service provides access to community-created VM images, stores user VM drives, and encrypts them.

External marketplaces API

Users can create their own front-stores on top of the Leea Protocol using the External Marketplace API.

Agent registration process

Configuration file

As shown in the diagram above, users need to generate a new registration key for the agent and create a configuration file on the node.

The configuration file is stored at $HOME/.leea/config with the following structure:

node_key: <node key from dashboard>
resources: # amount of node resources allocated to Leea Protocol
  cpu: 32
  ram: 64gb
  disk: 128gb
  gpus: // list of GPUs allowed to use (leave empty if all GPUs available)
    - XX:YY.0 // PCI address
    - XX:YY.1

Running Leea Agent app

When the Leea Agent starts, it checks the configuration file, scans the node for available hardware, and gathers the node's specifications.

The agent validates the node on each startup to ensure data for the remote attestation process are up-to-date.

Process of launching User VM

This process is designed so that even a malicious node cannot access any data inside the VM.

  1. When a user submits an order, the API finds a suitable node and requests the Image Registry to create an encrypted image with the selected OS and an unencrypted initrd image for the VM.

  2. The API sends the VM specifications and image URLs to the Leea Agent.

  3. When the initrd image is loaded by the VM, it initiates the Remote Attestation process with Validators. Upon success, it fetches the decryption keys from them.

  4. The OS on the decrypted disk is then allowed to boot normally, and post-provisioning tasks are executed automatically.

  5. The Leea Agent detects that the VM is ready and sends a request to the API.

  6. The API creates a GeoDNS record and closes the order.

Accessing VM from Internet

VMs within the Leea Protocol can be accessed from the internet through gateways.

All nodes with public IPs act as gateways to the internal network. These IPs are stored in GeoDNS records, and a mesh topology of network ensures that users worldwide can access services hosted on any VM.

TLS SNI

To access a service using any protocol that supports TLS SNI, the client (e.g., a browser) resolves the domain using GeoDNS to the nearest gateway IP address and connects to it. The gateway extracts the domain name from the TLS SNI hello packet, resolves it to an internal IP address, and then routes the connection to the target VM.

Other protocols

For protocols that don’t support TLS SNI, the internal IP address can be obtained through the API, after which the same process is followed.

Short FAQ:

  • Why don't you use IPv6? We do, but we aim to offer our services to all internet users, not only IPv6 enthusiasts.

  • How can I access a server on port XXX that uses a custom protocol? If the protocol supports TLS SNI, simply access it. If not, an SSH tunnel will be needed.

  • Do you decrypt traffic to get SNI? No, SNI is part of the TLS handshake and isn’t encrypted. We use it purely for routing purposes. All packets are delivered without modification.

The Leea Agent downloads the images and creates the VM according to the specifications. All VMs are created using AMD SEV or Intel TDX technologies, so the RAM is encrypted with keys accessible only to the processor. See for more information.

Security section
Key components of Leea Protocol architecture
Node with installed agent
Sequence diagram of creating new agent
Sequence diagram of user VM launching process
Sequence diagram showing how VMs can be accessed from internet