File Structure:
autonomy.yaml
This configuration file defines a zone in the Autonomy Computer. Think of a zone as your app’s dedicated infrastructure. The Autonomy Computer provisions everything needed to run it.autonomy.yaml
name: hello- The zone’s name (must be≤ 10characters, using onlya to zor0 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- Create themaincontainer 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. The Autonomy Computer can provision tools in containers right alongside the nodes running your agents:autonomy.yaml
- Share the same network namespace.
- Can communicate via
localhost.
- MCP servers (Model Context Protocol tools).
- Python functions, simple binaries, or any TCP service your agents need.
- Creating private links to enterprise data sources.
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):- Development variant (
ghcr.io/build-trust/autonomy-python-dev) - Containspip,uv, andapkpackage managers plusbash,ash, andshshells. - Minimal variant (
ghcr.io/build-trust/autonomy-python) - Removes shells and package managers for additional security and reduced size.
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 development 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 autonomous agents and services. Each agent can access a dedicated filesystem to save plans, take notes, and record memories.Simple Structure
For a simple application with a single file:images/main/main.py
- Imports modules from the Autonomy Framework - the open-source Python framework provides
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.
- Reuse code across multiple autonomous agents.
- Test components independently.
- Scale your application to thousands of collaborating agents as it grows.
User Interfaces
Autonomy apps can serve web user interfaces in multiple ways: a simple HTML file or a full custom UI.Simple UI with index.html
For a basic interface, place anindex.html directly in your container image directory:
index.html exists in the container image directory, the Autonomy Node
automatically serves it at the root of its HTTP server.
This is perfect for simple applications and prototypes.
Example structure:
images/main/index.html
POST /agents/{agent_name}- Send messages to agents.GET /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.

