← arizuko

Arizuko Research

Multi-tenant agent platform architecture, security model, coordination patterns, and skill development

System Model

Folders are agents. Each folder is a tenant: isolated memory, persona, skills, routes. MCP over unix socket. Tool calls go through `gated`; host controls what agents can reach. Defense-in-depth. Container isolation + DNS filtering + per-group MCP sockets + the host-side secret broker.

What brings you here?

Architecture

Tenancy Model

Each folder is a tenant. A folder path is a routing target, a JID prefix, a container home and a web vhost — it carries no authority. Authority is a row in the acl table:

Principal Holds Authority
role:member The twelve messaging verbs Bound to every folder at creation. Reply, send, post, like, edit and the rest — nothing more.
role:operator * on **, WITH GRANT OPTION The root of every delegation chain. Held by a person, invoked with /root.
folder:world/team Whatever was delegated to it Routing, group creation, token issuance, egress — each an explicit row, each bounded by its own scope glob.

routd evaluates every tool call against those rows, deny-wins, with no fallback: an action with no matching allow row is refused. Delegation is bounded by subset-of-held — a principal may pass on only rows it holds, and only those it holds with the grant option — so authority strictly decreases down every chain and no agent can escalate past its granter.

Execution Model

When a message arrives:

Containers are ephemeral. All state is in /home/node/ (volume-mounted) or routd's message store, which is host-side.

Groups, Topics, Sessions

Groups are folders. Topics scope conversations within a group. Sessions are Claude Code's execution context. Fork a topic to branch a conversation while preserving parent context.

Routing

Routes are rows in routes table with seq (priority), match (key=glob predicates), and target (folder or :daemon:).

seq  match                          target
100  platform=telegram room=main    corp/sales
200  platform=slack                 corp/eng
300  chat_jid=web:*                 :daemon:webd

First match wins. gated resolves predicates at message-receive time. Engagement overrides routing for N turns after a reply.

Observable Architecture

Groups can observe other groups' inbound messages without becoming the active agent:

Use for parent monitoring children, sibling awareness, or root aggregation. Observed context is capped per turn (env: OBSERVE_WINDOW_MESSAGES, OBSERVE_WINDOW_CHARS). See spec 5/B.

Security

Threat Model

Arizuko assumes:

  • Agents are untrusted. LLM output can be malicious or compromised.
  • Tool calls are the attack surface. Every MCP tool call is a potential privilege escalation.
  • Network egress is risk. Agents can exfiltrate data if unrestricted.

Defense: isolation at container, network, MCP, and secret layers.

Defense-in-Depth

Primitive Lifecycle Isolation Use
Group Persistent Folder boundary Agent identity, memory, persona, skills
Topic Transient Session ID One conversation thread, forkable
Session Ephemeral Claude Code session LLM context window, reset via /new
Layer Mechanism Threat Mitigated
Container Docker isolation, no --privileged Process escape, host filesystem access
Network Per-spawn proxy on an internal network + host allowlist Exfiltration, C2 communication
MCP Per-group unix socket, grants enforced by gated Cross-tenant tool access, privilege escalation
Secrets AES-256-GCM at rest, env-var injection, no disk persistence Secret theft via disk access or container inspect

Egress filtering

Per-folder allowlist, enforced by a proxy started fresh for each spawn:

The agent reaches only what the operator permitted. Example allowlist: ["api.anthropic.com", "github.com", "pypi.org"]. See egress docs and SECURITY.md.

MCP Socket Isolation

Each group gets its own unix socket (/ipc/<group_id>.sock). gated brokers every tool call, enforces grants, and logs actions. Agents cannot reach other groups' sockets — Docker mounts only the agent's own socket.

Secrets

Secrets are AES-256-GCM encrypted in the secrets table in routd.db. The container env carries model credentials only — the four env-profile keys, taken from the host .env and overlaid with the triggering user's own rows. Every capability credential stays on the host: routd resolves it per tool call, spends it in the outbound request, and returns only the response. No secret is written to /home/node/ or to logs.

Patterns

Agent-to-Agent Coordination

Three MCP tools for hierarchical coordination:

Use delegate for specialist work. Use escalate when authority is needed. Use observe for ambient awareness (sibling monitoring, aggregation).

Topic Forking

fork_topic(parent, child) — create a new topic from another's session state. Child gets a fresh session ID but starts with parent's Claude Code context. Use for:

Dispatch Trigger Design

Skills can specify ALWAYS or NEVER triggers in SKILL.md:

ALWAYS:
- "download this video" → acquire
- "transcribe this" → acquire

NEVER:
- Static pages → do NOT use agent-browser, use acquire instead

Gateway reads these at session start and surfaces them in <skills> block. Agent uses them for fast dispatch without re-reading every SKILL.md.

Stateless Iteration Loops (Ralph)

Pattern for long-running tasks that survive session resets:

Named after "ralph loop" (stateless iteration). Use for multi-page scrapes, batch processing, or any task that takes >1 session.

Resume Tokens

For APIs with pagination or long-running operations:

Fingerprint-Based Change Detection

Detect file changes without storing full content:

Use for monitoring codebases, watching config files, or tracking external resources.

Multi-Agent Pipeline Orchestration

Chain multiple agents for staged processing:

ingest → classify → route → specialist → review → publish

Each stage is a separate group. Use delegate_group or direct message routing. Example: support intake → triage agent → specialist teams → summary agent → publish.

Skills

MCP vs In-Context Skills

Aspect MCP Tools In-Context Skills
Context window Tool name + description only Full SKILL.md in system prompt
Authority Host-enforced grants Agent-enforced (prompt-based)
State Stateless, always available Loaded at session start, persists
Best for Platform operations (routing, groups, tokens) Workflow patterns, domain knowledge, multi-step procedures

Rule: Use MCP for side effects (send message, create group, issue token). Use in-context skills for knowledge and workflow guidance.

Skill Development

Each skill is a directory under ~/.claude/skills/<name>/ with:

Gateway reads SKILL.md at session start, injects into system prompt. Skills compose — agent can invoke multiple skills per turn.

Skill Marketplace Patterns

(Research in progress. Placeholder for skill discovery, versioning, dependencies, and performance evals.)

Performance Improvements

Measurable improvements from skill-based workflows: