System Architecture & Safety Boundaries
Explore Arbiter's domain-driven architecture, single-process execution model, Linux /proc and ss correlation layer, and immutable safety boundaries.
Architecture & Safety
Arbiter is structured to enforce strong safety boundaries while orchestrating local operations. It behaves like a small development-focused SRE operator.
It deliberately avoids unrestricted shell access, arbitrary file editing, and unverified success claims.
Architecture Diagram
Browser UI TUI / CLI REST clients MCP clients A2A clients
│ │ │ │ │
└────────────────┴────────────────┴──────────────────┴─────────────────┘
│
Interface adapters
│
Agent and high-level orchestration
│
┌───────────┬───────────┬───────────┬───────────┐
│ Projects │ Stacks │ Ports │ Docker │
├───────────┼───────────┼───────────┼───────────┤
│ Compose │ Makefiles │ System │ Safety │
└───────────┴───────────┴───────────┴───────────┘
│
Linux /proc + ss Docker SDK SQLite project filesBusiness logic does not live in the UI, TUI, CLI, or API routes. Those layers translate requests into calls to shared domain services. This prevents one interface from bypassing safety rules or implementing behavior differently from another interface.
The application is a single Python process. It does not require Redis, Celery, Kafka, Kubernetes, or another background infrastructure service.
Core Domains
ports: parses Linuxss, resolves processes through/proc, correlates Docker/Compose metadata, finds predictable free ports, and detects duplicate project claims and runtime port collisions.projects: bounded discovery below configured roots and a refreshable SQLite registry. No whole-filesystem scan occurs.stacks: multi-project environment profiles, 1-click context switching with dynamic.envoverride injection, port collision reconciliation, and topological DAG boot order orchestration.topology,system, andevents: generate a live, typed machine graph from Compose/Docker metadata,/proc,ss, and Docker events; runtime state is not persisted as authoritative data.dockerandcompose: typed Docker SDK inspection, Compose label awareness, lifecycle operations, validation, and structured port editing.dockerfile,make,files, andimpact: Dockerfile and Make intelligence, safe registered-project editing with backup/diff/rollback/undo, and deterministic pre-operation impact summaries.config_intelligence: cross-file port drift detection (.envvscompose.yamlvs.env.example), credential-safe missing env variable auditing, and visual diff dry-run time-travel state forecasting.safety,actions, andpersistence: immutable persisted approvals, one typed action dispatcher, history, and mandatory verification outcomes.agent: deterministic intents plus LangChain v1'screate_agentruntime, backed by LangGraph and restricted to the control plane's typed tools.api,cli,tui, andintegrations: thin adapters over the same services.
Safety Model
Every state-changing operation has one of five risk levels:
| Risk | Meaning | Default behavior |
|---|---|---|
READ_ONLY | Inspection and diagnosis | Automatically allowed |
LOW_RISK | Limited reversible operation | Approval required unless configured otherwise |
MEDIUM_RISK | Restart, stop, project start, config change | Approval required |
HIGH_RISK | Container/image removal and broad cleanup | Explicit approval required |
DESTRUCTIVE | Persistent data or volume deletion | Always explicit approval |
An approval is a persisted object with a UUID, request ID, exact action name, exact serialized arguments, summary, risk, creation time, expiration time, and status.
Approving an action executes the stored payload. The agent cannot replace or modify arguments after approval. Expired, rejected, or previously approved requests cannot be reused.
Verification
Execution success and verification success are separate concepts. An action may return verification_failed even if its command completed.
Examples of verification include:
- checking a started/restarted container is running;
- checking a stopped Compose project has stopped containers;
- confirming a removed image or volume no longer exists;
- refreshing project configuration after a port change;
- checking the recreated service is running;
- checking the new host port has the expected owner;
- verifying stack readiness gates (
tcp_port,http_get,docker_health) and checking measured endpoint latency.
Network readiness gates pass through a destination policy before any socket is opened. Connections use the validated resolved IP directly to prevent DNS rebinding. Loopback and registered Compose services are automatic; non-local targets require a persisted, revocable approval scoped to protocol, host, port, and resolved addresses. Redirect hops are independently checked, while link-local and metadata destinations are unconditionally denied.
Security Boundaries
The server binds to 127.0.0.1 by default. Important boundaries include:
- no arbitrary shell API;
- no generic filesystem read or write API;
- bounded automatic project scanning;
- explicit project registration;
- recognized Compose filename validation;
- fixed subprocess argument arrays with no
shell=True; - subprocess timeouts and captured output;
- bounded Docker log retrieval;
- exact container lookup with ambiguity rejection;
- secret-key redaction for names containing
PASSWORD,SECRET,TOKEN,API_KEY,PRIVATE_KEY, orCREDENTIAL; - persisted approval for risky actions;
- no automatic persistent-volume removal.