AIec

Docs

set up everything in one line
$ curl -fsSL https://aiec.gobrowse.dev/quickstart.sh | bash

One line sets up everything: the control plane, a worker, the MCP server, and the Python SDK. It checks prerequisites, clones, builds, writes .env.local (fresh secrets, mode 0600), starts services, and proves the path with a real sandboxed exec. Prefer control? aiec setup does the checks and writes the env file; bash scripts/quickstart.sh --no-mcp --runtime docker picks the pieces.

The full documentation

The reference documents below are the same files the repository ships, rendered here. Everything on this list is written for someone running AIec themselves. If you are here deciding whether to, start with Design and Limitations; if you already have one running, go straight to Guard operations or the page for what you are changing.

Start here

Get a cluster running and drive your first sandbox through it.

Production deployment
Host prerequisites, the systemd units, TLS and credential bindings, and the acceptance checks to run afterwards. 17 min read
REST API
Every route, its status codes and its error body, base path /v1. 13 min read
AIec Local MCP
The local MCP server: how an agent is given a disposable machine, and what it may do with one. 8 min read

How it works

The design decisions behind the interface, and what they promise.

Production architecture
Where control plane, workers, storage and runtimes sit, and the failure each boundary contains. 9 min read
Design
Which mechanisms came from the DSec paper, which are independent engineering, and where AIec deliberately differs. 5 min read
Versioning and compatibility
The six boundaries that version independently, and which changes to each are breaking. 1 min read

Operating it

Governance, images, snapshots and the deployment you are responsible for.

Guard operations
Running the policy broker: approvals, budgets, incidents, quarantine, and what an operator can see. 9 min read
Guard policy reference
The policy format field by field, the templates, and what the verifier will and will not accept. 3 min read
Guard threat model
Who an untrusted agent is assumed to be, the attacks each control answers, and the ones left open. 6 min read
Images
Building, signing and materialising images, and the digest checks a guest must pass before it boots. 8 min read
Snapshots
What a snapshot preserves, what it does not, and the restore and recovery paths. 1 min read
Firecracker guest image
Building the guest the Firecracker runtime boots, and the agent inside it that serves exec requests. 4 min read
Usage and billing foundation
The usage events the control plane emits, where quantities come from, and what production billing still needs. 1 min read

Build on it

Extend Core, or bring a policy format you already run.

Extending AIec Core
Writing a backend or a scheduler behind the Core traits, and the dependency direction that keeps them honest. 2 min read
OpenShell policy compatibility
Importing an OpenShell policy into a Guard policy: what maps, what is refused, and what is left manual. 4 min read

What you need

Compute host

A Linux machine with /dev/kvm, enough RAM and disk for the sandboxes you intend to run, and the Firecracker binary. One host is enough to start; more are a matter of running more workers.

State

PostgreSQL for metadata, scheduling and the usage ledger. S3-compatible object storage for artifacts and workspace snapshots — MinIO, or anything that speaks the S3 API.

Install

  1. Get the code.
    git clone https://github.com/fedoragobrowse-design/AIec.git
    cd AIec
  2. Build the binaries and guest image. The image builder needs Docker, an uncompressed compatible guest kernel and a private guest secret. It writes image digests; configure signed-image admission separately using the deployment guide.
    cargo build --release -p aiec-api -p aiec-cli -p aiec-mcp
    export PATH="$PWD/target/release:$PATH"
    export AIEC_KERNEL=/path/to/vmlinux
    export AIEC_GUEST_SECRET="$(openssl rand -hex 32)"
    ./scripts/build-firecracker-guest.sh
  3. Check the host. aiec doctor validates KVM, the Firecracker binary, the guest artifact and its digest, the database, object storage, networking and TLS, and tells you exactly what is missing.
    aiec doctor
  4. Start the control plane and a worker. The systemd units in deploy/ are templates; follow the deployment guide for database, object storage, TLS, image trust and worker configuration.

Your first sandbox

Create a key against your own control plane, then use the SDK. There is no account to sign up for and no key to request from anyone.

pip install agentforge-sdk
from agentforge import AIec

af = AIec(base_url="https://your-control-plane.example", api_key="af_live_...")

box = af.sandboxes.create(image="aiec-coding:latest")
print(box.exec(["uname", "-a"])["stdout"])
box.destroy()

Set base_url to your deployed endpoint, or set AIEC_URL. The SDK falls back to http://127.0.0.1:8080 for a local control plane; there is no hosted endpoint.

Core concepts

Tenant

Every API key belongs to a tenant. A tenant owns its sandboxes, snapshots, artifacts, usage, quotas and secrets. Possession of a resource ID does not grant access to it.

Sandbox

A disposable computer. It is leased from the scheduler, accounted for while it runs, and destroyed when you are done.

API key

A bearer credential. Stored hashed, shown once, revocable, rotatable, and scoped so a key can be limited to specific operations.

Runtime

Firecracker microVMs for untrusted work. Docker exists for trusted self-hosted and local development, and the control plane refuses to hand a tenant a weaker runtime than its policy allows.

Governing what a run can reach

A run that reaches the internet is governed from outside the machine. Pick a policy template and the worker enforces it, substituting model credentials the guest never holds and recording every decision where the guest cannot rewrite it. No policy selected means no network.

# Only the model endpoint, through the Guard broker
run = af.runs.create(command=["pytest", "-q"], guard="model-only")

A Guard selection replaces network rather than sitting beside it: two descriptions of one egress would be two paths to the internet, and the wider one would be the one that applied. Encrypted tunnels do not give Guard method or path visibility. A CONNECT tunnel to a host requiring those checks is refused, not silently forwarded without governance; TLS interception is not claimed as a validated deployment mode. The four built-in templates are no_network, model_only, model_plus_allowlist and read_only_api. GUARD_POLICY.md has the selection syntax, operator boundary and verifier instructions.

What runs alongside it

Operating a guarded sandbox

aiec guard show <sandbox>         # policy hash, attachment, budgets, incident
aiec guard events <sandbox>       # verified journal entries
aiec guard quarantine <sandbox>   # operator-initiated
aiec guard release <sandbox>      # reopen a held machine
aiec guard proposals <sandbox>    # pending and decided
aiec guard verify policy.yaml       # compile and verify, apply nothing
aiec guard import-openshell policy.yaml --out guard.yaml

The worker needs CAP_NET_ADMIN and CAP_NET_RAW. The packaged deploy/aiec-worker.service grants both; an alternate launcher must grant them explicitly. If the nftables startup probe fails, the worker reports network_policy: false and refuses governed placement. Check the host with aiec doctor, and configure the watchdog and credential bindings before starting governed workloads.

Driving it from an agent

The local MCP server exposes the same lifecycle as tools: create a sandbox, run commands, read and write files, clone a repository, destroy it. It talks only to a control plane you run, so the workload stays on hardware you control.

Engineering records

These stay in the repository and are not rendered here. They are working documents with the dates and run identifiers in them — an audit trail rather than instructions, and much longer than anything you would want in a sidebar.

There is no cloud, no hosted API and no sign-up. Everything runs where you put it.