Skip to content

ADR-002: Karo System

StatusProposed
DateDecember 2025
AuthorsCaro Maintainers
SupersedesN/A
RelatedADR-001 (LLM Inference Architecture)
  1. Executive Summary
  2. Context and Problem Statement
  3. Decision Drivers
  4. System Mental Model
  5. Architecture Overview
  6. Node Architecture
  7. Distributed Mesh Architecture
  8. Data Flow and Schemas
  9. Access and Role Model
  10. Trust and Cryptography
  11. Security Considerations
  12. Future Direction
  13. Consequences

This document defines Caro as a distributed terminal intelligence system designed for air-gapped and closed internal networks. Caro evolves from a single-machine CLI tool into a cooperative node network that provides:

  • Individual value: Personal terminal copilot with inference, safety checks, and usage insights
  • Organizational value: Aggregate visibility into terminal behavior, security posture, and operational patterns
  • Zero-egress architecture: No external network communication; all data stays within the trusted network

Core Tenets:

  • Local-first, mesh-optional: Each node is fully functional standalone
  • Air-gap compatible: Zero internet dependencies after deployment
  • Privacy-preserving aggregation: Derived insights, not raw surveillance
  • Cryptographic trust: End-to-end encrypted peer communication
  • Role-aware visibility: Different views for individuals, admins, and security teams

ADR-001 established Caro as a local-first CLI tool for command generation. This ADR extends that vision to address organizational needs:

  1. Individual developers want terminal intelligence without data leaving their machine
  2. Security teams need visibility into terminal behavior patterns across the organization
  3. SRE/Ops teams want to understand operational workflows and detect anomalies
  4. Regulated environments require air-gap compatibility and data sovereignty

Design a system that:

  1. Provides immediate value on a single machine (no network required)
  2. Scales to organization-wide visibility when nodes are connected
  3. Operates entirely within closed networks (no external dependencies)
  4. Preserves individual privacy while enabling aggregate insights
  5. Requires no central infrastructure (no servers, databases, or cloud services)
ApproachWhy Not for Caro?
Centralized logging (Splunk, ELK)Requires infrastructure, not air-gap friendly
Agent-based monitoring (Datadog)Phones home, requires internet
SIEM systemsHeavy infrastructure, not terminal-focused
Shell history syncRaw data, no intelligence, privacy concerns

  1. Air-Gap First: Must work in networks with zero internet connectivity
  2. No Central Infrastructure: No servers, databases, or coordination points required
  3. Privacy Gradient: Individual data stays local; only consented summaries are shared
  4. Standalone Value: Single node must be fully useful without mesh
  5. Cryptographic Security: All inter-node communication encrypted
  • Minimal resource footprint on individual machines
  • Graceful degradation when nodes are unreachable
  • Support for heterogeneous environments (macOS, Linux, various shells)
  • Auditability of what data is shared

Caro operates as four simultaneous identities:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CARO NODE IDENTITY β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ TERMINAL β”‚ β”‚ LOCAL β”‚ β”‚ DISTRIBUTED β”‚ β”‚
β”‚ β”‚ COPILOT β”‚ β”‚ OBSERVABILITY β”‚ β”‚ INTELLIGENCE β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ AGENT β”‚ β”‚ NODE β”‚ β”‚
│ │ ‒ NL→Command │ │ │ │ │ │
β”‚ β”‚ β€’ Safety check β”‚ β”‚ β€’ Shell historyβ”‚ β”‚ β€’ Mesh participant β”‚ β”‚
β”‚ β”‚ β€’ Context help β”‚ β”‚ β€’ Process watchβ”‚ β”‚ β€’ Encrypted relay β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β€’ Usage patternsβ”‚ β”‚ β€’ Aggregate views β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚ β”‚ ZERO-EGRESS SECURITY SYSTEM β”‚β”‚
β”‚ β”‚ β”‚β”‚
β”‚ β”‚ β€’ Never communicates outside internal network β”‚β”‚
β”‚ β”‚ β€’ All external model inference is local β”‚β”‚
β”‚ β”‚ β€’ Cryptographic identity per node β”‚β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PRESENTATION LAYER β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ CLI Interface β”‚ Local Dashboard β”‚ Mesh Dashboard β”‚
β”‚ (Terminal) β”‚ (localhost:9237)β”‚ (Role-Based Views) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ APPLICATION LAYER β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Inference β”‚ Observation β”‚ Aggregation β”‚
β”‚ Engine β”‚ Engine β”‚ Engine β”‚
β”‚ (ADR-001) β”‚ β”‚ β”‚
β”‚ β”‚ β€’ Shell watcher β”‚ β€’ Local summaries β”‚
β”‚ β€’ Command gen β”‚ β€’ Process mon β”‚ β€’ Cross-node queries β”‚
β”‚ β€’ Safety check β”‚ β€’ Context track β”‚ β€’ Pattern detection β”‚
β”‚ β€’ Risk assess β”‚ β€’ Event log β”‚ β€’ Anomaly alerts β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DATA LAYER β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Local Storage β”‚ Mesh Communication β”‚
β”‚ β€’ SQLite event store β”‚ β€’ Peer discovery β”‚
β”‚ β€’ Command history β”‚ β€’ Encrypted channels β”‚
β”‚ β€’ Inference cache β”‚ β€’ Summary exchange β”‚
β”‚ β€’ Configuration β”‚ β€’ Query routing β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PLATFORM LAYER β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Shell integration (bash, zsh, fish) β”‚
β”‚ β€’ Process observation (procfs, sysctl) β”‚
β”‚ β€’ Network stack (TCP/TLS internal only) β”‚
β”‚ β€’ Cryptographic primitives (ring, rustls) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CARO NODE β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ CLI AGENT (Terminal) β”‚ β”‚
β”‚ β”‚ caro "list all files modified today" β”‚ β”‚
β”‚ β”‚ caro --explain "what does this awk command do?" β”‚ β”‚
β”‚ β”‚ caro --history β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ BACKGROUND SERVICE β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚Shell Watcher β”‚ β”‚Process Mon β”‚ β”‚ Event Processor β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”‚β€’ Hook into β”‚ β”‚β€’ Track child β”‚ β”‚β€’ Categorize events β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ shell β”‚ β”‚ processes β”‚ β”‚β€’ Extract patterns β”‚ β”‚ β”‚
β”‚ β”‚ β”‚β€’ Capture β”‚ β”‚β€’ Monitor β”‚ β”‚β€’ Generate summaries β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ commands β”‚ β”‚ resources β”‚ β”‚β€’ Detect anomalies β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ LOCAL WEB SERVER β”‚ β”‚
β”‚ β”‚ http://localhost:9237 β”‚ β”‚
β”‚ β”‚ β€’ Personal dashboard β”‚ β”‚
β”‚ β”‚ β€’ Usage analytics β”‚ β”‚
β”‚ β”‚ β€’ Mesh status (if connected) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ LOCAL DATA STORE β”‚ β”‚
β”‚ β”‚ ~/.local/share/caro/ β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ events.db # SQLite event store β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ config.toml # Node configuration β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ identity.key # Node cryptographic identity β”‚ β”‚
β”‚ β”‚ └── cache/ # Inference & model cache β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

What a Caro node observes on its machine:

CategoryData CollectedPurpose
Shell CommandsCommand text, exit codes, durationUsage patterns, failure analysis
Working Contextcwd, shell type, user, privilegesContext-aware assistance
Process TreeChild processes of terminalUnderstanding command effects
Caro InteractionsGenerated commands, user promptsQuality improvement, usage stats
TimestampsWhen commands executedTemporal patterns

What a Caro node never collects:

  • File contents (only paths if part of command)
  • Network traffic or connections
  • Keystrokes outside of commands
  • Screen contents or clipboard
  • Other applications’ data

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CARO MESH (Internal Network) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Node A │◄───────►│ Node B │◄───────►│ Node C β”‚ β”‚
β”‚ β”‚ (Dev 1) β”‚ β”‚ (Dev 2) β”‚ β”‚ (SRE 1) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚
β”‚ └───►│ Node D β”‚β—„β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β”‚ (Admin) β”‚β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Node E β”‚ β”‚
β”‚ β”‚ (CISO) β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ Aggregate β”‚ β”‚
β”‚ β”‚ Dashboard β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ Legend: β”‚
β”‚ ◄──────► Encrypted peer connection β”‚
β”‚ All connections are bidirectional, E2E encrypted β”‚
β”‚ No central server - any node can query the mesh β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Decentralized: No coordinator, leader, or central server
  2. Eventually Consistent: Summaries propagate through gossip
  3. Partition Tolerant: Nodes work independently if isolated
  4. Encrypted: All inter-node traffic uses TLS 1.3 with mutual auth
  5. Opt-In: Nodes choose what to share via sharing policies

Within closed networks, nodes discover each other via:

MethodHow It WorksConfiguration
Static ConfigExplicit list of peer addressespeers = ["10.0.0.5:9238", "10.0.0.6:9238"]
Subnet ScanProbe known port on subnetdiscovery.subnet = "10.0.0.0/24"
mDNS/BonjourMulticast DNS service discoverydiscovery.mdns = true
DNS-SDDNS service records in internal DNSdiscovery.dns_sd = "_caro._tcp.internal.corp"

Default: Static config + optional mDNS (zero external dependencies).


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DATA CLASSIFICATION β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ LEVEL 0: RAW (Never leaves node) β”‚
β”‚ β”œβ”€β”€ Full command text with arguments β”‚
β”‚ β”œβ”€β”€ File paths and contents β”‚
β”‚ β”œβ”€β”€ Environment variables β”‚
β”‚ └── User prompts to Caro β”‚
β”‚ β”‚
β”‚ LEVEL 1: SUMMARIZED (Shared with explicit consent) β”‚
β”‚ β”œβ”€β”€ Command patterns (e.g., "git operations: 45/day") β”‚
β”‚ β”œβ”€β”€ Tool usage frequencies β”‚
β”‚ β”œβ”€β”€ Temporal patterns (e.g., "peak activity: 10-11am") β”‚
β”‚ └── Risk event counts (e.g., "3 high-risk commands blocked") β”‚
β”‚ β”‚
β”‚ LEVEL 2: AGGREGATED (Mesh-wide visibility) β”‚
β”‚ β”œβ”€β”€ Organization-wide tool adoption β”‚
β”‚ β”œβ”€β”€ Cross-team workflow patterns β”‚
β”‚ β”œβ”€β”€ Anomaly detection signals β”‚
β”‚ └── Security posture metrics β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
/// Cryptographic identity of a Caro node
struct NodeIdentity {
/// Ed25519 public key (32 bytes, base64 encoded)
public_key: String,
/// Human-readable node name (optional)
display_name: Option<String>,
/// Node capabilities and version
capabilities: NodeCapabilities,
/// First seen timestamp (by this node)
first_seen: DateTime<Utc>,
/// Trust level assigned by local policy
trust_level: TrustLevel,
}
struct NodeCapabilities {
/// Protocol version
protocol_version: u32,
/// Caro version
caro_version: String,
/// Supported sharing levels
supports_level1: bool,
supports_level2: bool,
/// Whether node can serve aggregate queries
can_aggregate: bool,
}
enum TrustLevel {
/// Not trusted, no data exchange
Untrusted,
/// Can receive our summaries
ShareTo,
/// Can query our summaries
QueryFrom,
/// Full bidirectional trust
Peer,
/// Can see all mesh data (admin/CISO)
Supervisor,
}
/// A single terminal event (Level 0 - never shared)
struct TerminalEvent {
/// Unique event ID
id: Uuid,
/// When the command was executed
timestamp: DateTime<Utc>,
/// The shell type
shell: ShellType,
/// Full command text
command: String,
/// Working directory
cwd: PathBuf,
/// Exit code (if completed)
exit_code: Option<i32>,
/// Duration in milliseconds
duration_ms: Option<u64>,
/// Was this command generated by Caro?
caro_generated: bool,
/// Safety assessment
risk_level: RiskLevel,
/// Was user confirmation required?
required_confirmation: bool,
}
enum ShellType {
Bash,
Zsh,
Fish,
Sh,
Other(String),
}
enum RiskLevel {
Safe,
Moderate,
High,
Critical,
}
/// Summarized data that can be shared with peers
struct NodeSummary {
/// Summary period
period: SummaryPeriod,
/// Node identity
node_id: String, // Public key fingerprint
/// Command pattern statistics
command_patterns: Vec<PatternStat>,
/// Tool usage frequencies
tool_usage: HashMap<String, u32>,
/// Temporal activity pattern
activity_pattern: ActivityPattern,
/// Safety statistics
safety_stats: SafetyStats,
/// Generated at timestamp
generated_at: DateTime<Utc>,
/// Cryptographic signature
signature: String,
}
struct SummaryPeriod {
start: DateTime<Utc>,
end: DateTime<Utc>,
granularity: Granularity,
}
enum Granularity {
Hourly,
Daily,
Weekly,
}
struct PatternStat {
/// Pattern category (e.g., "git", "docker", "file-ops")
category: String,
/// Count in period
count: u32,
/// Average duration (ms)
avg_duration_ms: u32,
/// Failure rate (0.0 - 1.0)
failure_rate: f32,
}
struct ActivityPattern {
/// Commands per hour bucket (24 entries)
hourly_distribution: [u32; 24],
/// Commands per day of week (7 entries)
daily_distribution: [u32; 7],
/// Total commands in period
total_commands: u32,
/// Unique command count
unique_commands: u32,
}
struct SafetyStats {
/// Commands by risk level
by_risk_level: HashMap<RiskLevel, u32>,
/// Blocked commands count
blocked_count: u32,
/// User-confirmed risky commands
confirmed_risky: u32,
/// Caro-generated commands
caro_generated: u32,
}
/// Query sent to mesh for aggregate data
struct MeshQuery {
/// Query ID for correlation
query_id: Uuid,
/// Requesting node identity
requester: String,
/// Query type
query_type: QueryType,
/// Time range
time_range: TimeRange,
/// Optional filters
filters: Vec<QueryFilter>,
/// Signature proving identity
signature: String,
}
enum QueryType {
/// Get aggregated tool usage across mesh
ToolUsage,
/// Get safety posture metrics
SafetyPosture,
/// Get activity patterns
ActivityPatterns,
/// Get anomaly signals
Anomalies,
/// Get node health status
NodeHealth,
}
struct QueryFilter {
field: String,
operator: FilterOp,
value: String,
}
enum FilterOp {
Equals,
Contains,
GreaterThan,
LessThan,
}
/// Response to a mesh query
struct MeshResponse {
/// Correlation ID
query_id: Uuid,
/// Responding node
responder: String,
/// Response data (varies by query type)
data: ResponseData,
/// Nodes that contributed to this response
contributing_nodes: Vec<String>,
/// Response timestamp
timestamp: DateTime<Utc>,
/// Signature
signature: String,
}
enum ResponseData {
ToolUsage(AggregatedToolUsage),
SafetyPosture(AggregatedSafetyPosture),
ActivityPatterns(AggregatedActivityPatterns),
Anomalies(Vec<AnomalySignal>),
NodeHealth(Vec<NodeHealthStatus>),
}

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROLE HIERARCHY β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ INDIVIDUAL CONTRIBUTOR β”‚ β”‚
β”‚ β”‚ β€’ Full access to own node data (Level 0-2) β”‚ β”‚
β”‚ β”‚ β€’ Personal dashboard β”‚ β”‚
β”‚ β”‚ β€’ Own usage analytics β”‚ β”‚
β”‚ β”‚ β€’ Controls what is shared β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ TEAM LEAD / SYSADMIN β”‚ β”‚
β”‚ β”‚ β€’ Level 1-2 data from team nodes (consented) β”‚ β”‚
β”‚ β”‚ β€’ Team aggregate dashboard β”‚ β”‚
β”‚ β”‚ β€’ Tool adoption metrics β”‚ β”‚
β”‚ β”‚ β€’ Cannot see raw commands β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ SECURITY TEAM / CISO β”‚ β”‚
β”‚ β”‚ β€’ Level 2 data from all nodes (by policy) β”‚ β”‚
β”‚ β”‚ β€’ Organization-wide security posture β”‚ β”‚
β”‚ β”‚ β€’ Anomaly detection dashboard β”‚ β”‚
β”‚ β”‚ β€’ Risk trend analysis β”‚ β”‚
β”‚ β”‚ β€’ Cannot see raw commands (only patterns) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

In a serverless mesh, access is granted by:

  1. Direct Connection: User installs Caro on their machine, connects to mesh
  2. Query Routing: Their node routes queries through the mesh
  3. Policy Enforcement: Each responding node enforces its sharing policy
  4. Result Aggregation: Requesting node aggregates responses
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” Query β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CISO β”‚ ───────────────►│ Node A β”‚
β”‚ Node β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ (checks β”‚
β”‚ β”‚ β”‚ policy: β”‚
β”‚ β”‚ β”‚ CISO=allow) β”‚
β”‚ │◄─────────────── β”‚ β”‚
β”‚ β”‚ Level 2 data β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β”‚ β”‚ Query β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚ ───────────────►│ Node B β”‚
β”‚ β”‚ β”‚ (policy: OK) β”‚
β”‚ │◄─────────────── β”‚ β”‚
β”‚ β”‚ Level 2 data β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β”‚ β”‚ Query β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚ ───────────────►│ Node C β”‚
β”‚ β”‚ β”‚ (policy: β”‚
β”‚ β”‚ β”‚ CISO=deny) β”‚
β”‚ │◄─────────────── β”‚ β”‚
β”‚ β”‚ ACCESS DENIED β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β”‚ Aggregate β”‚
β”‚ A + B β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Each node defines its sharing policy:

~/.local/share/caro/config.toml
[sharing]
# What level of data to share
max_level = 2 # 0=none, 1=summaries, 2=aggregated
# Who can query this node (by public key or role)
[sharing.allow]
peers = ["*"] # Allow all trusted peers
supervisors = ["fingerprint:abc123..."] # Specific CISO key
# What categories to share
[sharing.categories]
tool_usage = true
activity_patterns = true
safety_stats = true
anomalies = true
# Explicit denials override allows
[sharing.deny]
# Don't share with untrusted nodes
untrusted = true

PurposeAlgorithmImplementation
Node IdentityEd25519ring crate
Key ExchangeX25519ring crate
TransportTLS 1.3rustls
Symmetric EncryptionChaCha20-Poly1305ring crate
HashingBLAKE3blake3 crate
Key DerivationHKDF-SHA256ring crate
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ NODE IDENTITY LIFECYCLE β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ 1. GENERATION (First Run) β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Ed25519 keypair generated β”‚ β”‚
β”‚ β”‚ Private key stored: ~/.local/share/caro/identity.key β”‚ β”‚
β”‚ β”‚ Public key = Node ID (base64: "caro:ed25519:Abc123...") β”‚ β”‚
β”‚ β”‚ Fingerprint = BLAKE3(public_key)[0:8] (for display) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ 2. PEER INTRODUCTION β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Node A ──► "Hello, I am caro:ed25519:Abc123" β”‚ β”‚
β”‚ β”‚ Node B ──► "Hello, I am caro:ed25519:Def456" β”‚ β”‚
β”‚ β”‚ Both perform X25519 key agreement for session key β”‚ β”‚
β”‚ β”‚ TLS 1.3 channel established with mutual authentication β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ 3. TRUST ESTABLISHMENT β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Option A: Pre-shared trust (config file) β”‚ β”‚
β”‚ β”‚ [peers.trusted] β”‚ β”‚
β”‚ β”‚ "caro:ed25519:Def456" = { name = "Bob", role = "dev" }β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ Option B: TOFU (Trust On First Use) with confirmation β”‚ β”‚
β”‚ β”‚ "New peer detected: Def456. Trust? [y/N]" β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ Option C: Certificate chain (enterprise deployment) β”‚ β”‚
β”‚ β”‚ Organization root CA signs node certificates β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ 4. KEY ROTATION β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Nodes can rotate keys while maintaining identity β”‚ β”‚
β”‚ β”‚ Old key signs endorsement of new key β”‚ β”‚
β”‚ β”‚ Grace period for peers to learn new key β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

For enterprise deployment, trust can be scoped by domain:

[trust.domains]
# Engineering team
engineering = { subnet = "10.0.1.0/24", role = "peer" }
# Security team (supervisor access)
security = { subnet = "10.0.2.0/24", role = "supervisor" }
# External contractors (no mesh access)
contractors = { subnet = "10.0.3.0/24", role = "untrusted" }

All inter-node messages are signed:

struct SignedMessage<T> {
/// The payload
payload: T,
/// Sender's node ID
sender: String,
/// Timestamp (prevents replay)
timestamp: DateTime<Utc>,
/// Nonce (prevents replay)
nonce: [u8; 16],
/// Ed25519 signature over (payload || sender || timestamp || nonce)
signature: [u8; 64],
}
  1. Timestamps: Messages older than 5 minutes are rejected
  2. Nonces: Recent nonces are cached; duplicates rejected
  3. Sequence Numbers: Long-lived connections use monotonic sequence numbers

ThreatMitigation
Network eavesdroppingTLS 1.3 encryption on all channels
Node impersonationEd25519 signatures on all messages
Replay attacksTimestamps + nonces + sequence numbers
Unauthorized accessRole-based policies, cryptographic identity
Data exfiltrationNo external network access, Level 0 never shared
Compromised nodeCan only share its own data; cannot forge others’
Key compromiseKey rotation supported; revocation via trust removal
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SECURITY LAYERS β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ Layer 1: Network Isolation β”‚
β”‚ └── Caro only binds to internal interfaces β”‚
β”‚ └── Firewall rules can further restrict mesh ports β”‚
β”‚ β”‚
β”‚ Layer 2: Transport Security β”‚
β”‚ └── TLS 1.3 with mutual authentication β”‚
β”‚ └── Certificate pinning for known peers β”‚
β”‚ β”‚
β”‚ Layer 3: Message Security β”‚
β”‚ └── All messages signed by sender β”‚
β”‚ └── Replay protection via timestamp/nonce β”‚
β”‚ β”‚
β”‚ Layer 4: Access Control β”‚
β”‚ └── Role-based query permissions β”‚
β”‚ └── Per-node sharing policies β”‚
β”‚ β”‚
β”‚ Layer 5: Data Classification β”‚
β”‚ └── Level 0 data never leaves node β”‚
β”‚ └── Only derived/summarized data shared β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Every mesh operation is logged locally:

struct AuditEvent {
timestamp: DateTime<Utc>,
event_type: AuditEventType,
peer: Option<String>,
details: String,
success: bool,
}
enum AuditEventType {
PeerConnected,
PeerDisconnected,
QueryReceived,
QueryResponded,
PolicyViolation,
TrustChange,
KeyRotation,
}

  1. Core Implementation: Background service, shell integration, local dashboard
  2. Peer Discovery: Static config, mDNS support
  3. Basic Mesh: Summary exchange between trusted peers
  4. CLI Dashboard: caro dashboard opens local web UI
  1. Aggregate Views: Cross-node query routing and aggregation
  2. Anomaly Detection: Pattern-based unusual activity detection
  3. Policy Engine: Fine-grained sharing controls
  4. Enterprise Deployment: Configuration management, certificate chain trust
  1. Reactive Agents: Real-time intervention for risky commands
  2. Continuous Learning: Organization-specific pattern learning
  3. Policy-Aware Inference: Commands aligned with internal standards
  4. Compliance Reporting: Automated security posture reports

  1. Air-Gap Compatible: Works in most secure environments
  2. No Infrastructure: No servers to deploy or maintain
  3. Privacy Preserving: Raw data never leaves the machine
  4. Individually Useful: Full value even without mesh
  5. Cryptographically Secure: Strong authentication and encryption
  6. Auditable: Complete local audit trail
  1. Complexity: Significant increase over single-node CLI
  2. Resource Usage: Background service consumes memory
  3. Network Configuration: Mesh requires network access between nodes
  4. Trust Management: Peer trust needs initial configuration
  5. Eventual Consistency: No real-time global view
  1. Discovery Reliability: mDNS may not work in all network environments
  2. Key Management: Lost identity keys require re-establishing trust
  3. Policy Drift: Nodes may have inconsistent sharing policies
  4. Query Performance: Large meshes may have slow aggregate queries
  1. Multiple Discovery Methods: Static config as reliable fallback
  2. Key Backup: Optional encrypted key backup
  3. Policy Templates: Organization-wide policy distribution
  4. Query Caching: Cache aggregate results with TTL

Messages between nodes use a simple framed format:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Magic (4 bytes) β”‚ Version (2) β”‚ Length (4) β”‚ Type (2) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Payload (variable) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Signature (64 bytes) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Magic: 0x4B41524F ("CARO")
Version: Protocol version (currently 1)
Length: Payload length in bytes
Type: Message type enum
Payload: MessagePack-encoded message body
Signature: Ed25519 signature over (Version || Length || Type || Payload)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CARO - Personal Terminal Intelligence localhost:9237 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ Today's Activity Command Categories β”‚
β”‚ ───────────────── ────────────────── β”‚
β”‚ Commands: 127 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ git (45) β”‚
β”‚ Caro-generated: 23 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ docker (32) β”‚
β”‚ Risky (blocked): 2 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ kubectl (28) β”‚
β”‚ Avg duration: 1.2s β–ˆβ–ˆβ–ˆ npm (15) β”‚
β”‚ β–ˆβ–ˆ other (7) β”‚
β”‚ β”‚
β”‚ Recent Commands (sanitized) β”‚
β”‚ ─────────────────────────── β”‚
β”‚ 10:32 | git commit -m "..." | βœ“ Safe β”‚
β”‚ 10:31 | docker build . | βœ“ Safe β”‚
β”‚ 10:28 | rm -rf node_modules/ | ⚠ Moderate (confirmed) β”‚
β”‚ 10:25 | kubectl get pods | βœ“ Safe β”‚
β”‚ β”‚
β”‚ Mesh Status: Connected (4 peers) β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CARO - Organization Security Posture β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ Mesh Health Risk Distribution β”‚
β”‚ ─────────── ───────────────── β”‚
β”‚ Nodes Online: 42/45 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Safe (89%) β”‚
β”‚ Last 24h Queries: 1,247 β–ˆβ–ˆβ–ˆ Moderate (8%) β”‚
β”‚ Avg Response: 45ms β–ˆ High (2%) β”‚
β”‚ β–‘ Critical (1%) β”‚
β”‚ β”‚
β”‚ Anomaly Signals (Last 7 Days) β”‚
β”‚ ───────────────────────────── β”‚
β”‚ ⚠ Node eng-042: Unusual rm patterns (3 incidents) β”‚
β”‚ ⚠ Subnet 10.0.3.x: High failure rate (15% vs 2% baseline) β”‚
β”‚ βœ“ No privilege escalation attempts detected β”‚
β”‚ β”‚
β”‚ Tool Adoption Trends β”‚
β”‚ ──────────────────── β”‚
β”‚ kubectl: β–² 23% (security training impact?) β”‚
β”‚ docker: ─ stable β”‚
β”‚ legacy-script.sh: β–Ό 45% (migration successful) β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

This ADR was authored in December 2025 and represents the target architecture for Caro as a distributed terminal intelligence system. Implementation will proceed in phases as defined in the Future Direction section.