Skip to main content

Overview

Weavers are ephemeral Kubernetes pods that provide isolated execution environments for Loom agents. Each weaver runs a containerized instance of the Loom CLI with network isolation, resource limits, and audit logging.
Loom uses k3s (lightweight Kubernetes) for weaver provisioning. The server communicates with the k3s API to create, manage, and cleanup weaver pods.

Architecture

k3s Installation

Loom uses k3s for Kubernetes. The NixOS module handles installation and configuration.

NixOS Configuration

configuration.nix

Namespace Setup

The k3s module automatically creates the loom-weavers namespace:
If you need to create it manually:

Image Pull Secrets

For private container registries (e.g., GitHub Container Registry):
1

Generate a GitHub Personal Access Token

  1. Go to GitHub Settings → Developer settings → Personal access tokens
  2. Create a token with read:packages scope
  3. Save the token to a file: /run/secrets/github-token
2

Enable ghcr.io secret in NixOS

configuration.nix
3

Verify the secret exists

Or create manually:

Weaver Configuration

Configure the weaver provisioner in loom-server:
configuration.nix

Environment Variables

Alternatively, configure via environment variables:

Weaver Images

Weavers run container images with the Loom CLI pre-installed.

Building a Weaver Image

Use the provided Dockerfile:
docker/Dockerfile.weaver

Building with Nix

Pushing to Registry

Managing Weavers

CLI Commands

Kubernetes Commands

Troubleshooting

The container image doesn’t exist or is private.Check:
  1. Verify image exists: docker pull ghcr.io/your-org/weaver:latest
  2. Check image pull secret: kubectl get secret ghcr-secret -n loom-weavers
  3. Verify secret is configured in weaver settings
Fix:
The container has no long-running entrypoint.Weaver images must run a persistent process. The default entrypoint script keeps the container alive:
weaver-entrypoint.sh
Verify your entrypoint doesn’t exit immediately.
You need to authenticate first:
This creates a session token in ~/.loom/credentials.json.
The loom-weavers namespace doesn’t exist.Create it:
Or wait for the NixOS service to create it (runs after k3s starts).
The loom-server user needs read access to /etc/rancher/k3s/k3s.yaml.Fix permissions:
The NixOS module handles this automatically via the loom-k3s group.

Audit Sidecar

Weavers include an optional eBPF audit sidecar for monitoring system calls, network activity, and file access.

Configuration

configuration.nix

Viewing Audit Logs

Resource Limits

Set resource limits on weaver pods:
Apply with:

Next Steps

Server Configuration

Complete environment variable reference

Database Migrations

Manage SQLite schema changes