Architecture Decision Records
Key architectural decisions for the MVP.
ADR 0001 — Agent transport
The managed agent initiates outbound HTTPS connections to the central platform. After one-time enrollment it uses mTLS with one client certificate per agent. Tasks are claimed by polling/long-polling (`GET /agent/v1/tasks/next`).
ADR 0002 — Task queue
Use a PostgreSQL-backed task table with row-level locking (`FOR UPDATE SKIP LOCKED`) and leases. No Redis in the first MVP.
ADR 0003 — Privilege boundary
The agent runs as an unprivileged user. Read-only tools execute directly. Any approved write operation (initially `service.restart`) uses a separate, tiny privileged helper with a fixed operation set and strict schema.
ADR 0004 — LLM adapter
Use Ollama running locally on the central server. Keep the model name configurable. Select the model by a repeatable tool-calling evaluation harness rather than hard-coding a name.
ADR 0005 — Selected LLM
Use Ollama with `qwen2.5:7b-instruct` as the default model (configurable via `OLLAMA_MODEL`). Evaluation: 36/36 valid tool names/arguments, 0 forbidden hits, 0 errors, 9.02s average latency.
