Disclaimer: I’m one of the developers of Ailoy, and this post is about the library.
The basic idea behind an AI agent is simple: use an LLM to decide what to do, then give it tools to take action.
So developers design the right tools for each task. Connecting them to an agent isn’t technically difficult, especially now that MCP is a standard way to do it. But here’s the catch: When an agent needs capabilities your tools don’t expose, you have to extend the toolset yourself. Suppose you want an agent to design a small enclosure using CAD software. You could give it tools such as create_box, select_face, cut_hole, fillet_edges, and export_model. When the agent needs another operation, you have to add another tool. Depending on the requirements, you might even have to redesign your tool interface.
Modern AI products offer a simpler way: give the agent a computer of its own. Provide a VM where it can install software and write the code it needs as it works through a task. Major AI products such as ChatGPT and Claude increasingly use this approach for open-ended work.
But what if you want to build such an agent yourself? You have to piece together an LLM API, a sandbox, MCP, and other components, then make them work well together. That’s why I’m introducing Ailoy.
Ailoy is a library for building AI agents with their own computers. Each agent gets an isolated Linux VM, regardless of your host OS, where it can install packages, write code, and run tasks. You control which host resources each VM can access.
Ailoy focuses on helping you build agents rather than providing a hosted sandbox service. Your agents can work with the resources and files you want to share, through libkrun-based isolation technology. This means you don’t have to
- pay for a hosted sandbox service, or
- run a heavyweight daemon (such as Docker) on your machine.
Example
Let’s revisit the CAD design example. With Ailoy, the agent works in a VM with CadQuery installed. It writes and runs a Python script to build a gear bearing, inspects the result, and exports a usable model.
Here’s what that looks like in practice. This is all the setup the agent gets:
// Full example: github.com/brekkylab/ailoy/tree/main/examples/cad
// 1. The agent's computer: a Linux microVM with CadQuery preinstalled
let computer = ConsoleClient::builder()
.image(Recipe::new("python:3.12").step("pip install cadquery"))
.mount("./artifacts", "/artifacts") // the only folder on your real machine it can write to
.build()
.await?;
// 2. Build the agent
let agent = AgentBuilder::new("openai/gpt-6-astra")
.console(computer)
.system_tools() // shell, read, write, edit inside the VM
.skill("/skills/cad") // give a guide for the task: write, render, look, fix
.build()
.await?;
// 3. Ask
agent.run(Message::new(Role::User).with_contents([Part::text(
"Design a gear bearing that prints in one piece, already assembled.",
)]));
Run it, and this is what you get:
$ cargo run --example cad
The idea behind this is simple: instead of requiring you to design new tools, the agent uses its computer to write and test the code it needs for each task.
You provide the environment and guidance. The agent writes and tests the code needed to complete the task.
You can find the full code here:
- Python: https://github.com/brekkylab/ailoy/blob/main/examples/cad/python/main.py
- JS: https://github.com/brekkylab/ailoy/blob/main/examples/cad/node/main.mjs
- Rust: https://github.com/brekkylab/ailoy/blob/main/examples/cad/rust/main.rs
Top comments (0)