Skip to content

AI spaces

An AI space is a DNF host with the ai-space profile, usually a microVM guest. It runs an OpenClaw 🡕 assistant reserved for its members, with its own secrets and its own data.

  1. Declare the host and its members

    A host’s users are its members : DNF creates the Kanidm group space-<hôte> for them.

    etc/config.yaml
    - hostname: "ia-pro"
    zone: "lan:1.40"
    profile: "ai-space"
    features: ["microvm-guest:hyperviseur", "monitoring-node"]
    users: ["alice", "bob"]
    services:
    openclaw: {}

    monitoring-node places the space under the zone’s supervision : without it, neither a space failure nor the assistant stopping triggers an alert.

    The owner is the member whose subscription runs the assistant : they receive validation requests and spontaneous messages (reminders, scheduled tasks). As the only member, they are implicit. With several members, they are declared in usr/machines/ia-pro/configuration.nix (the order of users is not preserved) :

    { darkone.service.openclaw.owner = "alice"; }
  2. Initialize the space

    just space-init ia-pro : host key, secrets (cf. Isolated hosts) and, if the network has Matrix, the bot @ia-pro:<domaine> and its identity. Then commit usr/secrets/ and var/generated/spaces/.

  3. Deploy

    The hypervisor, the zone gateway (vhost, DNS) and the HCS (Kanidm group) : just apply hyperviseur,gw,hcs.

  4. Connect the AI provider

    Once per space, from the host (just enter ia-pro), for each subscription of the owner that serves the space’s models (cf. Models and subscriptions) :

    SubscriptionModelsLogin
    Claude Pro/Max, via the claude CLIanthropic/* (default : anthropic/claude-sonnet-5-5)sudo -u openclaw -H claude auth login
    ChatGPT Plus/Pro, via the codex pluginopenai/*openclaw models auth login --provider openai

    The host’s openclaw command switches to the service user on its own, including from the owner’s account (cf. Access). openclaw models status checks the connection, which stays in /var/lib/openclaw, persistent.

A model goes through the owner’s subscription when its provider appears in subscriptions, otherwise through an API key.

usr/machines/ia-pro/configuration.nix
{
darkone.service.openclaw = {
model = "anthropic/claude-sonnet-5-5";
extraModels = [ "openai/gpt-6-astra" "openrouter/moonshotai/kimi-k3" ];
subscriptions = [ "anthropic" "openai" ]; # défaut
apiKeys = [ "OPENROUTER_API_KEY" ];
};
}
OptionRole
modelMain model, <fournisseur>/<modèle>
extraModelsOther models, chosen in the conversation with /model
subscriptionsOwner subscriptions : anthropic, openai
apiKeysAPI keys, by variable name
providersProviders not in OpenClaw, OpenAI-compatible

Each key (apiKeys, providers.<nom>.apiKey) is stored before deployment in the space’s secrets, under openclaw/<VARIABLE> (just space-sops <hôte>).

A provider not in OpenClaw, such as Nous Portal, is declared with its address, key and models :

usr/machines/ia-pro/configuration.nix
{
darkone.service.openclaw = {
providers.nous = {
baseUrl = "https://inference-api.nousresearch.com/v1";
apiKey = "NOUS_API_KEY";
models = [ "Hermes-4-405B" ];
};
model = "nous/Hermes-4-405B";
};
}
UseAccount
Assistant (web, Matrix, scheduled tasks)The owner’s, quota shared by members
A member’s Claude Code, Codex, OpenCodeTheir own

A personal subscription (ChatGPT, Claude) shared by several members falls outside the terms of use : a team space takes a team plan or API keys (subscriptions = [ ]).

Members write to the bot @<hôte>:<domaine> in a direct, end-to-end encrypted message. The channel only exists if the network declares the matrix service : without it, the space works through its web interface alone.

ElementRule
Who is listened toMembers of the space (@<login>:<domaine>), in DM only ; other accounts are ignored
RoomsIgnored : non-members would read the answers there
SessionsOne per member when there are several, otherwise a single one for all channels
Command validationNone by default (cf. Security) ; any request goes to the owner, in DM
Spontaneous messagesSent to the owner, in DM
Encryption keysIn /var/lib/openclaw, persistent
Name and avatarThose of the identity

darkone.service.openclaw.identity presents the assistant in the web interface and on Matrix, where its name replaces the host’s. Nix enforces it, even with mutableConfig.

usr/machines/ia-pro/configuration.nix
{
darkone.service.openclaw.identity = {
name = "Jarvis";
emoji = "🦉";
avatar = ./jarvis.png; # ou "https://…"
};
}
AvatarWeb interfaceMatrix
png, jpg, gif or webp fileYes (2 MB maximum)Yes
https:// URLYesYes
Path relative to the workspaceYesDrawn emoji
NoneEmojiDrawn emoji

The name follows at deployment. The Matrix avatar is sent by just space-init <hôte>, to be run again after a change (an evaluation warning reminds you of this) ; then commit var/generated/spaces/. A file must be tracked by git.

The mic button in the web interface opens a voice conversation, interruptible, on both PC and phone (Android app). A real-time voice answers (OpenAI GPT-Live or Google Gemini Live) ; the space’s assistant does the work (tools, files, MCP), whatever its model.

usr/machines/ia-pro/configuration.nix
{
darkone.service.openclaw = {
talk.enable = true;
# Gemini Live au lieu de GPT-Live
talk.provider = "google";
apiKeys = [ "GEMINI_API_KEY" ];
};
}
OptionDefaultRole
talk.provideropenaiopenai or google
talk.modeldepends on providerReal-time model
talk.voicedepends on providerVoice
talk.instructionsnoneAdded instructions (language, tone)
ProviderAccessDefault model, voice
openai (GPT-Live)ChatGPT login, otherwise OPENAI_API_KEYgpt-live-1-codex, cove
google (Gemini Live)GEMINI_API_KEY keygemini-3.1-flash-live-preview, Kore

The owner’s ChatGPT login is done with openclaw models auth login --provider openai, even with an assistant running Claude. The Gemini key is created on Google AI Studio 🡕 and stored like the others (see Models and subscriptions). Other GPT-Live voices : arbor, breeze, ember, juniper, maple, sol, spruce, vale ; Gemini Live offers 30 (Puck, Charon, Aoede…).

With mutableConfig, the voice conversation no longer follows Nix after the first start : after changing provider, run openclaw config unset talk on the host (see Editable configuration). At most eight conversations at a time, 30 minutes each.

MCP servers, skills and tools are declared once per space, in usr/machines/<hôte>/configuration.nix. The assistant and each member (Claude Code, Codex, OpenCode) receive the same ones.

{ pkgs, ... }:
{
darkone.host.ai-space = {
mcp.fetch = {
command = "uvx";
args = [ "mcp-server-fetch" ];
};
mcp.github = {
command = "github-mcp-server";
args = [ "stdio" ];
secretEnv = [ "GITHUB_PERSONAL_ACCESS_TOKEN" ];
};
mcp.docs.url = "https://mcp.example.com/mcp";
skills.rapport = ./skills/rapport; # dossier avec SKILL.md
packages = [ pkgs.uv pkgs.pandoc pkgs.github-mcp-server ];
};
darkone.service.openclaw = {
workspace."AGENTS.md" = ./AGENTS.md;
projects.notes = "https://forge.example.com/alice/notes.git";
};
}
OptionRole
darkone.host.ai-space.mcpMCP servers, local (command, args, env, secretEnv) or remote (url, headers)
darkone.host.ai-space.skillsSkills by name : SKILL.md content, file or folder
darkone.host.ai-space.packagesTools in the assistant’s and members’ PATH
darkone.host.ai-space.enableClaude, enableCodex, enableOpenCodeClaude Code, Codex and OpenCode, enabled by default
darkone.host.ai-space.projectsDirShared projects folder (default /var/lib/projects)
darkone.service.openclaw.execCommand policy (cf. Security)
darkone.service.openclaw.identityAssistant name, emoji and avatar (cf. Identity)
darkone.service.openclaw.workspaceAssistant workspace files (AGENTS.md, SOUL.md…)
darkone.service.openclaw.projectsGit repositories cloned once into the projects folder
darkone.service.openclaw.transcriptionVoice note transcription (cf. Transcription)

Voice notes, from Matrix or the web, are transcribed by whisper.cpp, with no external service :

SpaceTranscription
MicroVM guestHypervisor server, large-v3-turbo model
Physical machineOn the space, small model (466 Mo, CPU)

Hypervisor server unreachable or too slow : the space transcribes by itself with small. transcription.backend = "local" always keeps transcription in the guest. The language is detected for each note ; transcription.language = "fr" fixes it.

The projects directory (/var/lib/projects, linked as ~/projects for each member) is shared : any file created by a member or by the assistant remains editable by the others. It is the assistant’s working directory ; its instructions and memory stay in its workspace.

From the conversation (web or Matrix), the assistant hands code to Claude Code, Codex or OpenCode :

ModeUse
/acp spawn claude (or codex, opencode)Coding session tied to the conversation, can be resumed
Background task (coding-agent skill)Long work, completion reported by message

Each tool signs in once, on the host :

ToolSign-in
Claude CodeThe owner’s (see Create a space)
Codex (session)sudo -u openclaw -H codex login --device-auth
Codex (background task)sudo -u openclaw -H env CODEX_HOME=/var/lib/openclaw/.codex-coding-agent codex login --device-auth
OpenCodesudo -u openclaw -H opencode auth login
ToolUse
AutomationsAssistant scheduled tasks (morning briefing, monitoring)
Lobster 🡕Chaining steps with approvals, resume without redoing everything

The assistant and the interface create their own automations ; Nix can also declare some :

usr/machines/ia-pro/configuration.nix
{
darkone.service.openclaw.automations.briefing = {
schedule = "0 7 * * 1-5"; # cron, ou "every 2h"
message = "Résume mon agenda et mes mails non lus.";
};
}
OptionRole
schedule, messageWhen, and the request made to the assistant
announceSends the answer into the conversation (default)
modelModel specific to this task
enablefalse : disabled, then re-enableable from the interface only

Declared automations are resynchronized on each start : a change made in the interface is overwritten, a removed declaration deletes its task. The others are never touched.

Lobster is enabled with lobster = true ; its files go through the workspace (workspace."workflows/tri.lobster" = ./tri.lobster;), and the assistant runs them on demand.

Each member has a Linux account on the space, lightweight:

ItemOn the space
Home Manager profilespace-member (zsh, git, vim, tmux), instead of their own
Space toolsClaude Code, Codex and OpenCode, with the space’s MCP and skills (darkone.home.aiSpace)
Customizationsusr/users/<login>/space.nix (all their spaces), then usr/users/<login>/spaces/<host>.nix (this space), if they exist
usr/users/<login>/default.nixIgnored: reserved for their workstations
Rightsprojects group, no sudo except for the openclaw CLI, whatever their profile

Administration of the space goes through the nix account (just enter <host>).

Each member connects their own subscriptions, once: claude (then /login), codex login --device-auth and opencode auth login. OpenCode accepts a ChatGPT subscription or an API key, not the Claude subscription.

ItemRule
Addresshttps://openclaw.<zone>.<domain>
LoginKanidm SSO, restricted to the space-<host> group
A member’s personal deviceRecognized by the tailnet, without SSO : see Android app
DevicePaired on first visit, without admin or approval rights (owner only, see Editable configuration)
Administrationopenclaw CLI on the host
Assistant portReachable from the zone gateway only

On its own, openclaw opens the assistant terminal (like openclaw tui). It runs under the service user, for the nix account and, through a sudo rule, for darkone.service.openclaw.cliUsers (default : the owner). Other members go through the web interface.

The OpenClaw app 🡕 cannot follow the Kanidm login. The gateway therefore recognizes a member’s personal device by its tailnet identity.

  1. Connect the phone

    Connect the device with the member’s account, subnets accepted. Tailscale must stay active.

  2. Create the pairing code

    On the host :

    Fenêtre de terminal
    openclaw qr --limited

    Without --limited, the phone keeps a permanent admin token.

  3. Pair the app

    Choose Scan QR or setup code. If a request stays pending : openclaw devices list, then openclaw devices approve <requestId>.

Any member’s personal device thus gets through without Kanidm, browser included, with its owner’s rights : admin included if the configuration is editable. Lost device : delete it from Headscale.

By default, Nix locks the assistant configuration : the web interface shows it read-only. darkone.service.openclaw.mutableConfig = true makes it editable, in the interface or via openclaw config set on the host, and gives the owner admin rights.

SettingsWho decides
Access, Matrix channel, plugins, MCP, transcription, identityNix : restored on startup and on each change
Model, commands, voice conversationNix on first start, then the interface
OthersThe interface

By default, the assistant runs its commands without validation, like OpenClaw : the barrier is the space itself (microVM cut off from the LAN, secrets specific to the space). Its service is also confined : it only writes to /var/lib/openclaw and the projects folder, and sees neither the members’ personal folders nor their processes.

darkone.service.openclaw.exec selects the policy :

ValueCommands
full (default)All, without validation
askAllowlisted ones pass, the others are submitted to the owner
autoA model examines those outside the allowlist and submits doubtful cases to the owner
allowlistAllowlisted ones only
denyNone

The allowlist is filled on the host : openclaw approvals allowlist add --agent main <chemin>.