autonomy.yaml
This configuration file defines a Zone in Autonomy Computer. Think of a Zone as your app’s dedicated infrastructure. The Autonomy Computer will provision everything needed to run it.autonomy.yaml
name: hello- The zone’s name (must be≤ 10characters, using onlya to zand0 to 9).pods- List of pods to create in this zone (a pod is a group of containers that run together).public: true- Serve the http server on port 8000 of this pod on a public address over HTTPS.containers- List of containers in themain-pod.image: main- Createmaincontainer using the image defined inimages/main.
Environment Variables and Secrets
You can set environment variables in your containers:autonomy.yaml
secrets.yaml for sensitive values:
secrets.yaml
Multiple Containers
Add multiple containers to a pod for tools agents need:autonomy.yaml
- Share the same network namespace.
- Can communicate via
localhost.
- MCP servers (Model Context Protocol tools).
- Any TCP service your agents need.
Multiple Pods
Split your application across pods:autonomy.yaml
clones to run multiple copies of a pod for parallel processing.
Dockerfile
Autonomy provides two base images (both include the Autonomy framework pre-installed):- A variant that contains
pip,uv, andapkpackage managers and thebash,ash, andshshellsghcr.io/build-trust/autonomy-python-dev. - A minimal variant that removes shells and package managers for additional security and reduced size
ghcr.io/build-trust/autonomy-python.
images/main/Dockerfile
Adding Python Dependencies
Use multi-stage builds to install packages usingpip and requirements.txt:
images/main/Dockerfile
requirements.txt:
images/main/requirements.txt
uv with pyproject.toml:
images/main/Dockerfile
pyproject.toml:
images/main/pyproject.toml
Adding System Dependencies
For system packages likeffmpeg use the dev image as your base:
images/main/Dockerfile
When you need system shared libraries, use
ghcr.io/build-trust/autonomy-python-dev as your base image.main.py
Your entry point starts agents and services.Simple Structure
For a simple application with a single file:images/main/main.py
- Imports modules from the Autonomy Framework -
Agent,Model, andNode - Defines an async main function that:
- Starts an agent named “henry”
- Gives it instructions to act as a legal assistant
- Configures it to use Claude Sonnet 4 model
- Starts an Autonomy Node - This creates the actor runtime that hosts your agent. It also starts an http server on port 8000 with a set of built-in APIs to interact with your agent.
Multi-Module Structure
For larger applications, organize code into modules:images/main/main.py
images/main/agents/legal_assistant.py
images/main/tools/document_analyzer.py
- Separate concerns (agents, tools, utilities).
- Reuse code across multiple agents.
- Test components independently.
- Scale your application as it grows.
User Interface Files
Autonomy apps can serve web interfaces in two ways: a simple HTML file or a full custom UI with FastAPI.Simple UI with index.html
For a basic interface, placeindex.html directly in your container image directory:
index.html at the root path / when it exists in the working directory.
This is great for simple applications and prototypes.
Example structure:
images/main/index.html
POST /agents/{agent_name}- Send messages to agentsGET /agents- List all running agents- Add
?stream=truefor streaming responses
Automatic serving:
index.html is served automatically by the Autonomy Node. For custom UIs with multiple files, configure FastAPI with StaticFiles as shown below.Custom UI with ui/ and public/
For sophisticated interfaces using modern frameworks (Next.js, React, Vue, Svelte), you need to manually configure FastAPI to serve static files. Organize your project like this:- Develop - Write your UI code in
ui/using your chosen framework. - Build - Compile the UI to static files (HTML, CSS, JS).
- Copy - Move compiled files from build output to
images/main/public/. - Configure - Set up FastAPI to serve the
public/directory usingStaticFiles. - Deploy - Copy the
public/directory into the container image.
package.json in ui/ for Next.js:
next.config.js for static export:
main.py to serve static files:
images/main/main.py
- You must manually configure FastAPI with
StaticFilesto serve thepublic/directory. - The
ui/directory is not included in the Docker image. - Only the compiled
public/directory goes into the image. - Your UI framework can be anything that outputs static files.
- The FastAPI
StaticFilesmount must be last (after all API routes). - The
html=Trueparameter enables servingindex.htmlfor directory requests.

