Configuration Reference#

Configure your agent’s isolated environment. Each setting controls what the container can access — from filesystem mounts to network rules — so you stay in control while your agent works freely.

Overview#

Alcatraz uses TOML format for configuration. The configuration file should be named .alca.toml and placed in your project root.

Project Root Discovery#

All commands except alca init automatically walk up the directory tree to find the nearest .alca.toml. This means you can run alca status, alca up, alca run, etc. from any subdirectory within your project.

For example, given this directory structure:

my-project/
├── .alca.toml
├── src/
│   └── pkg/
│       └── main.go
└── tests/

Running alca status from my-project/src/pkg/ finds and uses my-project/.alca.toml. The project root (the directory containing .alca.toml) is used for state files, container mounts, and all path resolution.

alca init is the exception — it always creates .alca.toml in the current working directory.

Edge cases:

  • If .alca.toml is a symlink to a file, it is treated as a normal config file.
  • If .alca.toml is a directory (not a file), it is skipped and the search continues upward.
  • If no .alca.toml is found all the way to the filesystem root, the command reports the usual “not initialized” error.

Field Reference#

FieldTypeRequiredDefaultDescription
extendsarrayNo[]Config files to extend (declaring file wins)
includesarrayNo[]Config files to include (included files win)
imagestringYes-Container image to use
workdirstringNo"/workspace"Working directory inside container
workdir_excludearrayNo[]Patterns to exclude from workdir mount
runtimestringNo"auto"Runtime selection mode
commands.upstring or objectNo-Setup command (run once on container creation)
commands.enterstring or objectNo"[ -f flake.nix ] && exec nix develop"Entry command (run on each shell entry)
mountsarrayNo[]Additional mount points
resources.memorystringNo-Memory limit (e.g., “4g”, “512m”)
resources.cpusintNo-CPU limit (e.g., 2, 4)
envstableNoSee belowEnvironment variables for the container
network.lan-accessarrayNo[]LAN access configuration
capsarray/tableNoSee belowContainer Linux capabilities configuration
hooks.post_upstringNo""Host command to run after alca up
hooks.pre_downstringNo""Host command to run before alca down

Full Example#

# Container image
image = "nixos/nix"

# Working directory inside container
workdir = "/workspace"

# Runtime selection: auto, docker, or podman
runtime = "auto"

# Lifecycle commands
[commands]
up = "nix-channel --update"
enter = "[ -f flake.nix ] && exec nix develop"

# Additional mounts
mounts = [
  "~/.gitconfig:/root/.gitconfig:ro",
  "~/.ssh:/root/.ssh:ro"
]

# Resource limits
[resources]
memory = "16g"
cpus = 8

# Environment variables
[envs]
NIXPKGS_ALLOW_UNFREE = "1"
EDITOR = { value = "${EDITOR}", override_on_enter = true }

# Network configuration
[network]
# lan-access = ["*"]  # Uncomment to allow LAN access (blocked by default)