---
title: "HIVEMIND: Hierarchical Agent Swarms for Enterprise Knowledge Management — Architecture, Clearance Models, and Coordinated Intelligence"
author: "Oscar Serra"
date: "June 14, 2026"
---

**A Design Paper on Deploying Multi-Agent AI Systems in Corporate Environments with Strict Information Boundaries**

---

## Abstract

Conversational AI assistants have proven effective for individual productivity, but enterprise deployment introduces a fundamentally different class of problem: how do you give every employee a powerful AI assistant while ensuring that the assistant for a junior salesperson cannot, even inadvertently, access salary data, merger plans, or infrastructure credentials? This paper presents **HIVEMIND** — a hierarchical agent swarm architecture designed for corporate deployment on OpenClaw/TinkerClaw infrastructure. We describe a five-tier data classification model mapped to Linux filesystem permissions and formally grounded in the Bell-LaPadula security model, a three-level agent hierarchy (employee, department, executive), and structured inter-agent communication protocols that enforce information flow strictly downward. We ground the architecture in a detailed case study: a mid-sized family business (~50–200 employees) with Sales, IT, HR, Finance, and Production departments, each with distinct clearance requirements. We present the Sales Coordination Model as a worked example of cross-agent collaboration under clearance constraints, including customer ownership routing, redacted summary generation with template-based leakage controls, and competitive intelligence aggregation. We strengthen the declassification boundary with a fresh-context adversarial "doubt reviewer" that, by running across a clearance boundary, turns a quality check into a sound information-flow test for implication-leakage, and we specify a seeded-corpus eval that measures residual leakage directly. We show that clearance-domain memory compaction can be made reversible without breaking the lattice — a Compress-Cache-Retrieve-Under-Clearance variant in which the retrieve step *is* the clearance gate — and we update the enforcement model to reflect that the application layer now has a pre-execution gate that *denies* violating tool-calls rather than merely logging them, giving HIVEMIND two independent enforcing layers. We address privacy and legal considerations (GDPR, EU AI Act, employee transparency, right-to-be-forgotten), compliance architecture (nightly audit cron jobs, communication logging, automated quarantine), and a comprehensive risk model covering curious agents, inter-agent social engineering, memory contamination, and model capability variance. We include performance estimates, failure recovery procedures, a phased deployment strategy, and a sketch-level inter-agent protocol specification. We also distinguish clearly between what is proposed, what is operationally specified, and what remains to be empirically validated, framing HIVEMIND as an architectural design paper rather than a deployment evaluation. We conclude with future directions toward federated enterprise agent networks.

**Keywords:** multi-agent systems, enterprise AI, information security, clearance models, OpenClaw, agent swarms, GDPR, EU AI Act, knowledge management, corporate AI, hierarchical agents, Bell-LaPadula

---

## 1. Introduction — The Enterprise AI Deployment Problem

### 1.1 From Individual Agents to Organizational Deployment

A single neuron is useless. A hundred neurons form a reflex arc. A hundred billion neurons, organized into specialized regions that communicate through defined pathways, produce a mind. The leap from individual capability to collective intelligence is not about adding more units — it is about organizing their communication. The same pattern holds outside the skull: a single ant is nearly blind and incapable of complex behavior, yet a colony builds bridges from its own bodies, farms fungus, and wages coordinated war. The intelligence lives in the structure of the interactions, not in any one participant.

HIVEMIND is our attempt to reproduce that emergence for AI: take individual agents, each capable in isolation, and organize them into a corporate structure where the whole becomes more capable than the sum of its parts — without letting the added connectivity become an added attack surface.

The first generation of practical AI assistants is personal. OpenClaw, TinkerClaw, and comparable platforms are designed around a single operator — one human, one agent, one workspace. The agent accumulates contextual memory, learns preferences, and acts as a trusted extension of that individual's cognition. The individual model is now reasonably mature: persistent memory, curiosity-driven self-improvement, and trust tiers governing tool access have each been worked out for the single-operator case.

But the individual agent paradigm has a ceiling. That ceiling is the organization.

### 1.2 The Organizational Need

Consider a family business with 120 employees — a mid-sized industrial supply distributor operating for thirty years. Its collective knowledge lives in spreadsheets, email threads, the memories of senior employees, and folders on a shared server nobody has reorganized since 2011. Now imagine giving every employee their own AI assistant: María in sales gets LUNA, Pedro in sales gets ATLAS, the IT manager gets CIPHER, the HR director gets ARBOR, the CEO gets STRATEGOS.

The moment these agents operate in the same corporate ecosystem, three problems emerge:

- **Information leakage.** María asks LUNA to "find everything about the González account." LUNA, eager to help, discovers an email thread between the CEO and CFO discussing whether González's margins justify continued service. María now knows something she wasn't supposed to know.

- **Coordination failures.** A new email from a González contact lands in Pedro's inbox — the contact is registered to his territory, though María has been the primary relationship holder for two years. ATLAS drafts a reply from scratch, unaware of the relationship history. Two agents, same customer, divergent responses.

- **Knowledge silos.** Pedro learns in a client meeting that a competitor has launched a new product. ATLAS files this in Pedro's memory. The sales director never hears about it. The intelligence dies in a silo.

These are the daily reality of knowledge management in mid-sized companies.

### 1.3 The Core Tension

The central challenge is a tension between two legitimate needs:

**The need for integration.** The more an agent knows about the company, the better it can help its user. A sales agent that knows the customer's full history — every touchpoint, complaint, and special arrangement — is far more effective than one that only knows its user's portion.

**The need for boundaries.** Salary data, M&A strategy, infrastructure credentials, legal proceedings — these must be protected. An AI agent that leaks this information is worse than having no agent, because the leak is invisible, scalable, and hard to attribute.

HIVEMIND resolves this tension through deep integration with strict clearance-based boundaries enforced at the infrastructure level, not merely at the prompt level.

### 1.4 Architecture Overview

Before presenting the detailed design, we provide a high-level view of the HIVEMIND architecture (Figure 1).

![Figure 1. HIVEMIND three-level agent hierarchy. Employee agents (L1) sit under one department agent (L2) per function; all department agents report to a single executive agent, STRATEGOS (L3). Each level carries a clearance ceiling, and every inter-level edge is gated by the gateway's topology and clearance rules.](images/fig-hierarchy.png)

### 1.5 The Per-Agent Cognitive Stack

Single-agent cognition has, over the past few years, been tackled one problem at a time: persistent memory, fast retrieval, stable identity, self-improvement, multi-model deliberation, and layered security each have well-understood solutions for the one-human-one-agent case. HIVEMIND runs all of them at once, across many agents, and stress-tests their assumptions under concurrency and clearance constraints. Each agent in the swarm is not a thin role wrapper around a model — it is a full cognitive stack of six named subsystems used throughout this paper:

- **Append-only memory (the memory subsystem).** Each agent stores interactions as append-only timestamped events, with older events automatically compressed into lightweight summaries — giving every agent effectively unlimited memory within bounded storage.
- **Personal retrieval index (the retrieval subsystem).** Each agent maintains a retrieval index that maps topic keywords to memory segments, enabling sub-second lookup across its full interaction history.
- **Stable persona (the identity subsystem).** Each agent reads a persona definition at session start and holds a distinct, stable identity — a sales agent behaves differently from an IT agent because their persona files encode different values, communication styles, and domain knowledge.
- **Nightly self-improvement (the reflection subsystem).** Each agent runs a nightly cycle that reviews the day's errors and adjusts its own behavioral rules, so the swarm improves over time without centralized retraining.
- **Multi-model deliberation (the deliberation subsystem).** Complex cross-department decisions trigger several models debating the issue and synthesizing a consensus, so no single model's blind spot drives a critical business decision.
- **Layered security (the security subsystem).** A layered framework enforces clearance levels and defends against prompt-injection that could compromise one agent and cascade through the swarm.

For brevity, the rest of the paper refers to these subsystems by short names — ENGRAM (memory), HIPPOCAMPUS (retrieval), CORTEX (identity), CEREBELLUM (reflection), SYNAPSE (deliberation), and AEGIS (security) — purely as labels for the six functions just defined.

Running the full stack on every one of 85+ agents would be wasteful, so HIVEMIND tiers it (Table 1). The principle is that cognitive cost should track decision consequence: an agent that only drafts emails does not need multi-model deliberation, and an agent that never coordinates does not need its own retrieval index over shared knowledge.

**Table 1. Cognitive stack by agent tier.**

| Capability | Employee (L1) | Department (L2) | Executive (L3) |
| ----------------------------- | ------------------------------- | ---------------------------------- | ------------------------------- |
| Memory (ENGRAM) | full, private | full + department aggregate | full + organization-wide read |
| Retrieval (HIPPOCAMPUS) | personal index | personal + mediated cross-agent | personal + all-department read |
| Persona (CORTEX) | per-employee, template-derived | per-department | bespoke (single agent) |
| Self-improvement (CEREBELLUM) | shared department rule-base | department-level reflection | full reflection |
| Deliberation (SYNAPSE) | off (escalate instead) | on for cross-employee decisions | on for cross-department/strategic |
| Security (AEGIS) | clearance ceiling T2–T3 | T4 + clearance validator | T5 + dead switch + two-person rule |

Two design choices in Table 1 are deliberate and are developed later in the paper. First, employee agents do not run SYNAPSE deliberation: when a decision is consequential enough to need multiple models arguing, it is consequential enough to escalate to the department agent (Section 4.3). Running independent deliberation on a junior agent would also multiply token cost without a clear payoff (Section 11.6). Second, self-improvement at the employee tier writes to a *shared department rule-base* rather than a fully private one, so that a lesson one salesperson's agent learns ("this customer always disputes the first invoice") becomes available to the team without leaking the underlying confidential interaction — the rule is declassified through the same pipeline as any other downward flow (Section 5.4).

### 1.6 Paper Organization

Section 2 surveys related multi-agent orchestration paradigms and positions HIVEMIND among them. Section 3 defines the information architecture and formal security model. Section 4 presents the agent hierarchy. Section 5 details the Sales Coordination case study. Section 6 addresses privacy and legal considerations — GDPR and the EU AI Act — which motivate the compliance architecture in Section 7. Section 8 covers technical implementation on OpenClaw/TinkerClaw infrastructure, including an inter-agent protocol specification. Section 9 analyzes risks and mitigations. Section 10 presents a phased deployment strategy. Section 11 sketches future directions. Section 12 collects limitations. Section 13 concludes.

---

## 2. Related Work — Multi-Agent Orchestration Paradigms

The organizational framing of multi-agent systems is not unique to this paper. Over the past year, three independent efforts — academic, open-source, and industrial — have converged on organizational structure as the coordination model for multiple agents. Surveying them clarifies what HIVEMIND contributes and what it borrows.

### 2.1 Three Coordination Topologies

Three distinct paradigms are now visible in practice:

1. **Fan-out and synthesize.** A coordinator dispatches the same problem to several models and merges their answers (the CORF pattern in OpenClaw; broadly, the multi-model deliberation style discussed in Section 1.5). There is no persistent role structure — the parallelism is per-query.
2. **Coordinator-with-workers.** A single coordinator prompt spawns workers with restricted tool sets; the orchestration lives in the prompt rather than an external framework, and workers communicate through tool results and a shared filesystem. Claude Code's coordinator mode is the clearest industrial example. It is the leanest topology: prompt-only, little persistent state.
3. **Org-chart.** Persistent, hierarchical roles (CEO, department heads, individual contributors), work distributed as tickets rather than prompt chains, with per-agent budget tracking. Paperclip is the open-source exemplar; HIVEMIND is the security-and-cognition-complete version.

These are points on a spectrum of *persistence* and *structure*, not competitors. HIVEMIND sits at the high-structure end and adds the two things the leaner topologies omit: a clearance lattice enforced below the model, and the full per-agent cognitive stack of Section 1.5.

### 2.2 Paperclip — Open-Source Organizational Agents

Paperclip is an open-source orchestration framework for "zero-human companies" that mirrors HIVEMIND's structural thesis closely: each role (CEO, CMO, CTO, engineers) is a separate agent; work is distributed through a ticketing system rather than prompt chains; tasks are atomic and trackable; per-agent token/budget usage is monitored from a central dashboard; agents can be different models; and all agents reference operator-set company goals.

Paperclip is direct evidence that the org-chart paradigm works in practice — role-based specialization scales, and centralized goal-setting with decentralized execution is viable. What it lacks is exactly the layer HIVEMIND is about. Paperclip has no clearance or information-flow model (any agent can read anything), no self-improvement loop, no governed shared memory, no cross-department deliberation protocol, and no persona persistence across sessions. In other words, Paperclip validates HIVEMIND's *structure* while leaving open the *cognitive architecture and security model* that would make such a structure safe to point at real corporate data. HIVEMIND can be read as Paperclip with a full per-agent cognitive stack and a Bell-LaPadula spine.

### 2.3 Coordinator Mode and Sub-Agent Execution Models

Claude Code's coordinator mode demonstrates that meaningful multi-agent orchestration can be defined entirely in a prompt: a coordinator spawns workers with restricted tool sets, and they coordinate through tool results and shared files. The same body of work distinguishes three sub-agent execution models that are useful vocabulary for HIVEMIND's implementation: a *fork* that inherits parent context (cache-efficient), a *teammate* in a separate execution context that communicates through a file-based mailbox (asynchronous, persistent), and a *worktree* isolated on its own branch.

The teammate model maps most naturally onto HIVEMIND. Department coordination is asynchronous and persistent, and a file-based mailbox is a concrete, auditable realization of the clearance-filtered message channels described in Section 4.3 — every message is a file with owner, group, and permission bits, which is precisely the enforcement substrate HIVEMIND relies on.

### 2.4 Single-Agent Role Switching

Not every deployment needs separate processes. GStack uses a single agent with multiple role-specific prompt files (CEO, engineering manager, designer, debugger) — multi-perspective rather than multi-agent, and far cheaper because there is one process and one context to maintain. This marks the low-cost end of the design space and is a legitimate alternative for small organizations; we return to the cost trade-off explicitly in Section 11.4.

### 2.5 Memory-Compression Systems — Reversible Caching and the Single-Trust-Domain Assumption

The related work above concerns *coordination topology*; a separate line of contemporaneous work concerns the *cognition layer* HIVEMIND runs on every agent, and one project in particular bears directly on the memory subsystem of Section 1.5. headroom (Chopra, 2026; chopratejas/headroom, ~24.7k stars, Apache-2.0) is a production context-compression system built on a primitive it calls **CCR — Compress-Cache-Retrieve**. Where HIVEMIND's ENGRAM compaction is *lossy by design* (a summary stands in for many original events, originals shunted to cold storage, and a compacted pointer is explicitly "not a capability"; Section 3.7), headroom does the opposite: it *caches the originals* and lets the model *retrieve them on demand*, with per-content-type compressors — statistical crushing of JSON arrays, AST-aware code compression via tree-sitter, and dedicated log/diff/text handlers — reporting 60–95% token savings at near-zero accuracy delta on standard benchmarks (GSM8K, TruthfulQA, SQuAD, BFCL), and shipping a runnable evaluation harness together with a trained compression model.

headroom matters to HIVEMIND for two reasons, one a tension and one a template. The tension: reversibility collides head-on with the lattice. A *reversible* summary is precisely the "compacted pointer that, when dereferenced, returns content above the holder's tier" that Section 3.7 names as the dangerous confused-deputy failure. headroom optimizes token economy and, by construction, assumes a *single trust domain* — retrieval is always permitted to whoever holds the cache. HIVEMIND cannot make that assumption, and Section 3.8 develops the clearance-aware variant that resolves the collision. The template: headroom is an existence proof that an agent-memory transform can ship with a *reproducible accuracy-delta eval*, which is exactly the artifact HIVEMIND's Limitations 2 and 10 admit it lacks. We borrow the discipline (a runnable eval over a named corpus) while rejecting the trust-domain assumption (every compression output must be a first-class classified object, not a freely retrievable cache).

### 2.6 Engineering-Discipline Systems — Adversarial Review with Stripped Context

A second open-source body of work targets *review discipline* rather than coordination or memory, and one mechanism within it maps unexpectedly well onto HIVEMIND's hardest unsolved problem — implication-leakage at the declassification boundary. addyosmani/agent-skills (Osmani, 2026; ~56.8k stars) is a disciplined-engineering plugin whose **doubt-driven-development** loop runs CLAIM → EXTRACT (produce an artifact whose originating reasoning is stripped, leaving only the contract/output) → DOUBT (a *fresh-context* adversarial reviewer that sees only the artifact, never the source or the reasoning that produced it) → RECONCILE (classify findings against the artifact text) → STOP (explicit trivial-findings / cycle-limit / override criteria). Most of this is a code-review loop and is not what HIVEMIND borrows. The reusable kernel is the *fresh-context-adversarial-reviewer-with-stripped-context* primitive: a reviewer deliberately denied the source can only reason from the artifact, which is the correct threat model for a recipient who is likewise denied the source. Section 5.4.1 re-purposes this primitive as a leakage oracle at the clearance boundary. The honest differentiation: addyosmani's loop is a *quality* check (does the artifact meet its contract); run across a clearance boundary it becomes an *information-flow* test (can a party without clearance infer the secret from the artifact alone). The repository's broader authoring conventions — every skill declares a "When NOT to use" anti-trigger and a "Loading Constraints" scope — are good practice we note but do not depend on.

### 2.7 The Convergence Argument

The independent emergence of organizational coordination patterns across academic (HIVEMIND), open-source (Paperclip), and industrial (Claude Code coordinator) work suggests that corporate structure is not merely a convenient metaphor for multi-agent systems — it may be the natural coordination topology for complex, heterogeneous agent deployments. Companies already encode "who may know what" and "who reports to whom" in their org charts and filesystem permissions; mapping agents onto that existing structure is less an invention than a recognition. What distinguishes HIVEMIND is the claim that this same structure, taken seriously, is also the *security* model — that the org chart is the access-control graph, not a layer on top of it.

---

## 3. Information Architecture — The Corporate Filesystem Model

### 3.1 The Shared Server as Mental Model

Every mid-sized company running on-premises or hybrid infrastructure has a shared file server. Top-level folders for each department, subfolders for specific functions, and a web of permissions that determines who can read or write to what. This folder hierarchy is a materialized representation of the company's information governance model, encoding decades of institutional decisions in chmod bits and ACLs.

HIVEMIND maps directly onto this existing model. The advantages:

1. **Familiarity.** IT administrators understand filesystem permissions without learning a new access control paradigm.
2. **Auditability.** Filesystem access is loggable, diff-able, and understood by existing compliance tools.
3. **Trust.** Employees already accept IT-controlled data access. Extending this to AI agents feels less invasive than a new control plane.
4. **Enforcement.** Linux filesystem permissions are enforced by the kernel, not by a language model's good intentions. This is a critical distinction we return to in Section 9.

### 3.2 Data Classification Tiers

We define five classification tiers:

| Tier | Label            | Examples                                                                            | Default Access                                |
| ---- | ---------------- | ----------------------------------------------------------------------------------- | --------------------------------------------- |
| T1   | **PUBLIC**       | Company website, product brochure, public pricing, press releases                   | All agents, external systems                  |
| T2   | **INTERNAL**     | Procedures, internal manuals, product specifications, org chart                     | All employee agents                           |
| T3   | **CONFIDENTIAL** | Client data, contracts, email correspondence, CRM records                           | Role-relevant agents only                     |
| T4   | **RESTRICTED**   | Salaries, infrastructure passwords, M&A plans, margin data, HR records              | Senior management + relevant department heads |
| T5   | **SECRET**       | Board-level strategy, legal proceedings, acquisition targets, whistleblower reports | Executive agents only                         |

These tiers map to Linux filesystem paths:

```
/corporate/
|-- public/          # directory: 0755, files: 0644
|-- internal/        # directory: 0750, group: all-employees; files: 0640
|-- confidential/    # directory: 0750, per-department group; files: 0640
|-- restricted/      # directory: 0750, group: management; files: 0640 + per-dept ACLs
\-- secret/          # directory: 0700, owner: agent_strategos; files: 0600
```

Each agent process runs as a distinct Linux user. User group membership determines tier access. The kernel enforces this — no prompt instruction can override a `permission denied`.

Note: directory permissions (e.g., 0755) control traversal; file permissions within (e.g., 0644) control read/write access to content. Both layers must be correctly configured to ensure the intended access boundaries.

### 3.3 The "Need to Know" Principle

Military and intelligence communities operate on "need to know": having clearance for a classification level does not automatically grant access to all information at that level. We apply the same principle. Clearance tier establishes a ceiling, not a floor. Within a tier, access is further scoped by role and department via POSIX ACLs. A Finance department agent with T4 clearance can access salary data (T4, Finance) but not infrastructure passwords (T4, IT).

This limits blast radius: a compromised agent's accessible data surface is bounded by role scope, not just clearance tier.

### 3.4 Formal Security Model

HIVEMIND's information flow model is grounded in the Bell-LaPadula (BLP) lattice model, adapted for the multi-agent enterprise context.

**Definitions.** Let $S = \{s_1, s_2, \ldots, s_n\}$ be the set of agents (subjects), $O = \{o_1, o_2, \ldots, o_m\}$ the set of data objects, and $L = \{T1 < T2 < T3 < T4 < T5\}$ the totally ordered security lattice. Each subject $s$ has a clearance $c(s) \in L$ and a role scope $R(s) \subseteq \mathcal{D}$ (where $\mathcal{D}$ is the set of departments). Each object $o$ has a classification $\ell(o) \in L$ and a department assignment $d(o) \in \mathcal{D}$.

**Simple Security Property (no read-up).** Agent $s$ may read object $o$ only if:
$$c(s) \geq \ell(o) \quad \text{and} \quad d(o) \in R(s)$$

An agent cannot read data classified above its clearance tier, and even at its tier, access is restricted to its role-relevant departments.

**Star Property (\*-property, no write-down).** Agent $s$ may write to object $o$ only if:
$$\ell(o) \geq c(s)$$

An agent cannot write data to a lower classification level, preventing information laundering from restricted tiers to public ones.

**Declassification Exception.** The *-property creates a practical problem: department agents (T4) need to send filtered summaries to employee agents (T3). We handle this through a controlled declassification mechanism. A Level 2+ agent may generate a *new\* data object $o'$ with $\ell(o') < \ell(o)$ under these constraints:

1. The declassification is explicitly invoked (not implicit in normal operation).
2. The output $o'$ passes through a template-based redaction pipeline (see Section 5.4) or receives human approval.
3. A declassification event is logged with: source object hash, output object hash, classification change, agent ID, timestamp, and redaction method used.
4. The original object $o$ is not modified.

This exception is the formal basis for redacted summaries. It is narrow by design — only structured declassification through approved channels is permitted.

**Enforcement layers.** The BLP properties are enforced at two independent layers, and a recent capability change sharpens what "two layers" buys. Earlier versions of this architecture treated the application layer as pure advisory defense-in-depth — useful for logging, but bypassable by model error, with only the kernel able to actually *prevent* a violation. That asymmetry has narrowed: a pre-execution tool-call gate (AEGIS, the security subsystem of Section 1.5) can now *deny* an action before it runs, even under a permissive host configuration, by returning a hard block decision that the runtime honors rather than merely a logged warning. HIVEMIND therefore has **two independent layers that can each prevent, not merely record, a violation**:

- **Kernel-level enforcement.** Linux filesystem permissions and POSIX ACLs enforce the Simple Security Property. The \*-property is enforced by restricting write permissions: agent users have write access only to their own workspace and approved output directories at or above their classification level. The kernel denies an out-of-clearance *read*.
- **Tool-boundary enforcement (application-level).** Gateway routing rules and the AEGIS pre-execution clearance gate deny the out-of-clearance *tool-call* — the action that would synthesize or launder restricted content even when every constituent read was individually authorized. This layer is no longer assumed bypassable: a denied tool-call does not execute. Agent system prompts and the clearance validators of Section 9.2 remain genuinely advisory (a model can phrase its way around an instruction), and that softer sub-layer is still treated as defense-in-depth — but the AEGIS gate itself is enforcing.

The two enforcing layers are complementary, not redundant: the kernel stops the read; AEGIS stops the action that would aggregate or exfiltrate across authorized reads (Section 9.1) and the social-engineering response that a prompt instruction alone might not (Section 9.2). The earlier framing — application-layer enforcement is an observe-only "physics limit" of the runtime — proved to be a configuration assumption rather than a hard constraint, and the architecture is stronger for retiring it.

### 3.5 Information Flow as a Directed Graph

We model inter-agent information sharing as a directed graph with clearance-enforced edges. Define:

- $A_i$ = agent $i$ with clearance tier $c_i$ and role scope $R_i$
- $\text{share}(A_i \to A_j, d)$ = agent $i$ shares data item $d$ with classification $c_d$ to agent $j$

The fundamental rule:

$$\text{share}(A_i \to A_j, d) \text{ is permitted iff } c_j \geq c_d \text{ and } d(d) \in R_j$$

No agent may receive data classified above its clearance tier or outside its role scope. Upward information requests are structurally prohibited (Section 4.3). Downward flows require controlled declassification (Section 3.4).

### 3.6 Why Bell-LaPadula Is Necessary but Not Sufficient

Bell-LaPadula is the right primary model because HIVEMIND's dominant enterprise risk is **confidentiality failure**: the wrong employee agent learning about salaries, credentials, legal matters, or board strategy. But Bell-LaPadula is not the only relevant security model, and the design is stronger when that is stated explicitly.

- **Role-Based Access Control (RBAC).** RBAC explains _who should access what_ in organizational terms and maps well to departments, supervisors, and executives. HIVEMIND uses RBAC operationally through Linux users, groups, ACLs, and tool allowlists. However, RBAC alone does not formalize information flow across multi-step agent interactions.
- **Chinese Wall.** Brewer-Nash is relevant where conflict-of-interest boundaries matter — for example, if a consulting firm runs multiple client-specific agent swarms. HIVEMIND does not fully implement Chinese Wall semantics, but future multi-tenant versions should.
- **Biba integrity model.** Bell-LaPadula protects confidentiality; Biba protects integrity. In practice, enterprise agent systems need both. HIVEMIND's audit logs, two-person review for T5 summaries, configuration versioning, and controlled write paths are partial integrity controls, but a full formal integrity model remains future work.
- **Zero Trust architecture.** Zero Trust contributes the operational assumption that no agent, process, or network path should be trusted implicitly. HIVEMIND adopts this stance in gateway authentication, least-privilege tool access, and process isolation.

Accordingly, HIVEMIND should be read as a **hybrid control architecture**: Bell-LaPadula provides the confidentiality lattice; RBAC defines organizational scope; Zero Trust informs runtime assumptions; and partial Biba-like controls support integrity. This clarification matters academically because it prevents overclaiming: the paper does not present Bell-LaPadula as a complete model of enterprise agent security, only as the correct primary backbone for secrecy-preserving information flow.

### 3.7 Clearance and the Append-Only Event Store

One interaction between the clearance lattice and the per-agent memory model deserves explicit treatment, because it is a genuine edge case rather than a clean consequence of Bell-LaPadula. Each agent's memory (ENGRAM) is an append-only event store in which older events are periodically compacted into lightweight summary objects. Compaction is lossy by design — a summary stands in for many original events — and it is performed *within* an agent's own clearance domain. That domain confinement is what keeps the interaction safe, but it is worth stating the invariants so an implementer does not break them:

- **Compaction never crosses tiers.** A summary inherits the maximum classification of the events it compresses. The compactor may read T4 events in a T4 store and produce a T4 summary; it may not produce a lower-tier summary as a side effect. Downgrading is reserved for the explicit declassification pipeline (Section 3.4), never the compactor.
- **A compacted pointer must not become a confused-deputy.** If a summary is referenced by a higher-tier agent (e.g., STRATEGOS reads SALES-AGENT's compacted department history), the reference is resolved under the *reader's* clearance against the *summary's* classification — exactly the Simple Security Property. The dangerous failure would be a low-clearance agent holding a pointer that, when dereferenced by a privileged service on its behalf, returns content above its tier. HIVEMIND forbids server-side dereferencing of memory pointers on behalf of a requester: an agent can only follow pointers into stores it could already read directly. Pointers are not capabilities.
- **Compaction is itself an audited write.** Because summaries replace originals in the working set (the originals are retained in cold storage for the retention period), each compaction event is logged with input event hashes, output summary hash, and classification — so the nightly sweep can verify that no compaction silently changed an object's tier.

The general lesson is that an append-only store plus lossy compaction does not by itself violate the lattice, but it introduces *new objects* (summaries) and *new references* (pointers) that must each be assigned a classification and resolved under the reader's clearance. Treating compaction output as a first-class classified object closes the gap.

### 3.8 Compress-Cache-Retrieve Under Clearance — Keeping Originals Without Breaking the Lattice

Section 3.7 reached its safety by *throwing originals away*: compaction is lossy, the cold-storage copy is dereferenced only for retention/audit, and a pointer is deliberately not a capability. That is the conservative choice, and it pays a price — every compaction permanently degrades what the agent can later recall. A contemporaneous production system suggests the price may be avoidable. headroom's Compress-Cache-Retrieve (Section 2.5) keeps the originals in a cache and *retrieves them on demand*, recovering most of the lost fidelity at 60–95% token savings. The obvious question is whether HIVEMIND can adopt reversibility without reintroducing the confused-deputy hazard §3.7 was built to avoid.

It can, but only by making one substitution: **the retrieve step must be the clearance gate.** We call the variant **Compress-Cache-Retrieve-Under-Clearance (CCR-UC)**, and it is governed by two invariants that mirror the lattice rather than the single-trust-domain assumption headroom is free to make:

- **The cache inherits the maximum classification of what it compressed.** A cache built from T4 events is a T4 object. There is no such thing as a "low-tier cache of high-tier originals" — that object would be precisely the reversible pointer that launders a tier on dereference.
- **Retrieve resolves under the *reader's* clearance against the *cache's* classification — the Simple Security Property, unchanged.** A holder of a CCR-UC pointer can expand it only into stores it could already read directly. Expansion on behalf of a lower-clearance requester is forbidden for exactly the reason server-side pointer dereferencing is forbidden in §3.7: a capability that returns content above the requester's tier is a leak regardless of how compactly it was encoded.

Under these invariants, CCR-UC is not a new exception to Bell-LaPadula; it is the §4.5 mediated-retrieval machinery pointed inward at an agent's own compacted memory. The retrieve request is a clearance-checked query, not a grant — and when a privileged agent expands a cache whose contents span tiers for delivery to a lower-clearance reader, the expansion passes through the same template-based declassification pipeline (Section 5.4) as any other downward flow. The reframing is worth stating plainly because it strengthens the design: §3.7 said "we throw originals away to stay safe"; CCR-UC says "we can keep originals and stay safe *if and only if* the retrieve gate is the clearance gate." The honest boundary against headroom is that headroom ships this transform with a runnable accuracy-delta eval and a trained compressor and has no notion of classification; HIVEMIND adds the classification semantics and the clearance-checked retrieve but, as Section 12 concedes, has not yet shipped the eval. Section 3.9 specifies the eval that would close that gap.

### 3.9 A Redaction-Fidelity Eval — Measuring Residual Leakage Directly

headroom demonstrates that an agent-memory transform can be shipped with a reproducible benchmark; HIVEMIND should hold its declassification transforms to the analogous standard. The quantity to measure is *not* task accuracy — the redaction pipeline's job is the opposite of fidelity-preservation — but **residual leakage**: how much a reader can recover about the restricted source from the redacted output alone. We specify a seeded-corpus eval with three parts:

1. **A seeded leakage corpus.** A synthetic set of source records spanning the §5.4 template categories (pricing authority, legal status, margin data, personnel information), each paired with the restricted fact it must conceal and a set of "forbidden inferences" (existence, direction, magnitude of an authorization; identity of a party to a legal matter).
2. **The measured quantity — residual mutual information.** For each template category, estimate the mutual information between the redacted output and the restricted source fact, operationalized via a fresh-context inference test (Section 5.4.1): the fraction of forbidden inferences a clearance-blind reviewer recovers from the redacted text. A perfect template scores zero; the §5.4 worked failure ("the CFO has authorized significant flexibility…") scores high on the *direction* inference even though it leaks no restricted token.
3. **Acceptance thresholds per category.** Each template category gets a published residual-leakage ceiling; a template that exceeds it is rejected and returned to the compliance authors before it can enter the pipeline.

This is the artifact Limitations 2 and 10 call for, narrowed to the property HIVEMIND actually cares about. It does not establish information-theoretic *bounds* — that remains open — but it replaces an untested claim of leakage control with a measured one, and it makes redaction templates regression-testable after every model or rule change, exactly as headroom's eval makes a compressor regression-testable.

---

## 4. Agent Hierarchy Architecture

### 4.1 Three-Level Structure

**Level 1 — Employee Agents.** One per employee. Personalized name, calibrated personality, deep role context. Clearance matches their human user's access level. Workspace scoped to that employee's data access.

**Level 2 — Department Agents.** One per department (SALES-AGENT, IT-AGENT, HR-AGENT, etc.). Elevated clearance (typically T4, T5 for executive department). Coordinate employee agents, aggregate intelligence, enforce department policies, and gate inter-level communication.

**Level 3 — Executive Agent (STRATEGOS).** Single top-level agent with T5 clearance and read access to all department agent workspaces. Serves the CEO and senior management. The only agent that sees the complete organizational picture.

### 4.2 Employee Agent Design

Each employee agent is a full OpenClaw/TinkerClaw deployment with:

- **Custom persona.** LUNA knows she works with María on the González account; ATLAS knows Pedro's clients prefer phone calls. The agent is useful from the first interaction because it already knows the work.
- **Scoped workspace.** Contains only files the employee can access. Memory files are readable by the department agent.
- **Role context injection.** System prompt includes job description, department procedures, assigned clients/projects, and communication norms.
- **Tool access scoped by role.** A salesperson's agent can access CRM, email, calendar, and product catalog. It cannot access payroll, infrastructure tools, or HR records. Explicit DENIED entries for out-of-scope systems.

**Provisioning personas at scale.** CORTEX was designed for a single agent with a hand-authored persona. Eighty-five distinct personas cannot be hand-written and kept consistent. HIVEMIND provisions them in three layers, from generic to specific:

1. **Role template.** A per-role base persona (sales rep, IT technician, HR specialist) captures the communication norms, domain vocabulary, escalation defaults, and tool expectations shared by everyone in that role. Templates are version-controlled artifacts authored once by the department and compliance teams.
2. **Org-derived parameters.** Concrete attributes — the employee's name, manager, department, assigned accounts or systems, clearance tier — are filled from existing HR and directory systems (Active Directory / LDAP, the CRM ownership registry). No human re-types what the org already knows.
3. **Earned personalization.** The genuinely individual texture (María's clients prefer email, Pedro's prefer phone) accumulates over time through ENGRAM memory and CEREBELLUM reflection rather than being specified up front. The persona file at provisioning time is deliberately thin; it thickens with use.

This keeps persona authorship to a small number of role templates while letting each agent diverge naturally. It also makes offboarding clean: revoke directory membership and the parameter layer evaporates, leaving only the role template and an archived memory store (Section 6.7).

### 4.3 Information Flow Rules

**Rule 1: Downward queries are permitted.** Level 3 can query Level 2. Level 2 can query its Level 1 agents. Queries retrieve information, request actions, audit memories, or issue directives.

**Rule 2: Upward queries are structurally prohibited.** Level 1 agents cannot initiate queries to Level 2 or Level 3. This is enforced by the gateway's session routing topology: employee agent sessions are not registered as valid targets for upward message addressing.

**Rule 2a: Upward intelligence push is permitted through structured channels.** This is a controlled exception to Rule 2. Employee agents may push data _upward_ to their department agent, but only through pre-defined structured channels with these constraints:

- Each channel has a fixed schema (message type, required fields, classification ceiling).
- The employee agent can only push data classified at or below its own clearance tier — it cannot push data it shouldn't have.
- Push channels are defined in the department agent's configuration and cannot be created or modified by employee agents.
- The department agent validates all incoming pushes against the channel schema before processing.
- All pushes are logged with sender, channel, content hash, and timestamp.

The distinction from a query is structural: a push deposits information and returns no response. The employee agent learns nothing new from the act of pushing. This prevents push channels from being used as covert query mechanisms. See Section 9.2 for abuse analysis.

**Rule 3: Lateral communication is mediated.** Peer Level 1 agents do not communicate directly. LUNA-to-ATLAS communication routes through SALES-AGENT, which applies clearance filtering before forwarding.

**Rule 4: Structured data sharing creates approved channels.** Pre-approved data sharing patterns (e.g., customer ownership registry) bypass mediation for specific, predefined data types defined in the department agent's configuration.

### 4.4 The Department Agent as Coordinator

The department agent is simultaneously:

- **A supervisor.** Reads, writes, and audits employee agent memory files. Can modify context, correct errors, inject directives.
- **An aggregator.** Synthesizes cross-employee information for department-level queries. What is the total pipeline value for Q2? Which customers have open complaints?
- **A gatekeeper.** All cross-agent and cross-level communication routes through it. Applies clearance filtering before forwarding.
- **A memory keeper.** Maintains institutional knowledge transcending any individual employee.

The department agent runs on a persistent schedule with hooks into communications infrastructure. It monitors data streams and proactively updates employee agents' context when relevant events occur.

### 4.5 Inter-Agent Retrieval — Memory Across the Swarm

Each agent's retrieval index (HIPPOCAMPUS) is private by construction: it maps that agent's own keywords to that agent's own memory segments. But department coordination requires reaching *across* indexes — when LUNA assembles a González briefing, the relevant touchpoints may live in ATLAS's memory, not hers. The question this raises is architecturally novel: can one agent query another agent's memory, and if so, under what control?

HIVEMIND's answer is that **cross-agent retrieval is never direct; it is always mediated and clearance-filtered by the department agent.** Three properties make this tractable:

1. **Indexes are federated, not merged.** There is no global index that any agent can search. Each agent keeps its own. The department agent holds a *catalog* — for each subordinate index, the set of topics it covers and the classification ceiling of each topic — without holding the underlying segments. The catalog is enough to route a query ("who has González material?") without itself being a leak.

2. **Retrieval is a query, not a grant.** When LUNA needs cross-agent context, she issues a Customer History Request to SALES-AGENT (Section 5.3). SALES-AGENT fans the request out to the indexes its catalog flags as relevant, collects the matching segments, applies the same clearance filtering and template-based redaction as any other downward flow (Section 5.4), and returns a synthesized package. LUNA never receives raw access to ATLAS's index, and ATLAS's index gains nothing about LUNA. The result respects the requester's clearance, not the source's.

3. **Provenance survives the hop.** Each retrieved segment carries its source agent, classification, and content hash into the audit log, so a later compliance sweep can reconstruct exactly which memory crossed which boundary. Cross-agent retrieval is therefore one of the most heavily logged operations in the system — appropriately, since it is where one agent's private knowledge becomes another's.

This makes the swarm's collective memory queryable without making it flat. The coordination dividend of Section 5 depends on it: an agent can draw on the whole team's history, but only through a gate that enforces who is entitled to what.

---

## 5. The Sales Coordination Case Study

### 5.1 Scenario Setup

The company is a mid-sized industrial supply distributor, family-owned, 85 employees. The sales department has 12 salespeople in three regional teams. Data architecture: 2,400 active CRM accounts, 8 years of email archive, call logs, pending offers, negotiation histories, and customer-specific pricing arrangements.

**LUNA** serves María García (senior sales rep, 7 years, 180 accounts including González Industrial). **ATLAS** serves Pedro Martínez (mid-level sales rep, 3 years, 95 accounts). **SALES-AGENT** is the Level 2 coordinator (T4). **STRATEGOS** sits above (Level 3, T5).

### 5.2 Customer Ownership and Routing

SALES-AGENT maintains a **Customer Ownership Registry** mapping each CRM account to a primary owner, secondary contacts, and transition flags.

When an inbound email arrives:

1. SALES-AGENT's email monitor intercepts incoming sales correspondence.
2. Extracts the sender, cross-references against the registry.
3. If the sender's account is owned by a different salesperson than the receiving mailbox, triggers a **cross-ownership alert**.
4. Dispatches the alert to the primary owner's agent (LUNA, if a González contact emailed Pedro).
5. Briefs the receiving agent (ATLAS): "This contact is primarily assigned to María García. I've notified her agent. Please defer to her on pricing commitments. Here is a summary of the account's current status."

This routing happens within seconds — before either human has seen the message.

### 5.3 Unified Customer History

When LUNA prepares María for a customer call, she needs the complete relationship history — not just María's interactions, but every touchpoint across the sales team.

1. María asks LUNA: "Prepare a briefing for the González account for my call tomorrow."
2. LUNA submits a **Customer History Request** to SALES-AGENT: `GET /customer/gonzalez/full-history, requester: LUNA, clearance: T3`.
3. SALES-AGENT queries all sales agents for González-related records plus its own aggregated memory.
4. SALES-AGENT applies clearance filtering:
   - Sales interactions (T3): included in full.
   - Customer-specific pricing tiers negotiated by management (T4): replaced with a **Redacted Summary** (Section 5.4).
   - Legal proceedings involving this customer (T5): replaced with a caution notice: "Active legal matter. Escalate any contract discussions to management before committing."
5. SALES-AGENT returns the filtered package to LUNA.
6. LUNA synthesizes it into a briefing for María.

María walks into the call with comprehensive institutional knowledge without accessing data above her clearance. The caution notice provides the actionable implication (don't commit on contracts) without the underlying detail.

Figure 2 traces this flow end to end, showing where each clearance tier is included verbatim, redacted through a template, or replaced with a caution notice before the package reaches the requesting agent.

![Figure 2. Clearance-filtered Customer History Request. LUNA (T3) requests González history from SALES-AGENT (T4); SALES-AGENT fans out to the relevant agent memories, then filters each result by tier — T3 interactions pass verbatim, T4 pricing is replaced by a redaction template, T5 legal matter becomes a caution notice — and returns only the filtered package. Raw cross-agent memory never reaches LUNA.](images/fig-history-flow.png)

### 5.4 Redacted Summaries and Leakage Control

The redacted summary is a critical mechanism — and the single most vulnerable point in the architecture. When a higher-clearance agent synthesizes information for a lower-clearance recipient, there is an inherent risk that the LLM leaks restricted content through phrasing, implication, or context.

**The risk:** An LLM told to "summarize this pricing negotiation without revealing the specific margins" might produce: "The CFO has authorized significant flexibility on pricing for this account, particularly if they commit to volume." This technically redacts the number but reveals the existence and direction of the authorization — information the salesperson should not have.

**Template-based redaction pipeline.** To mitigate this, HIVEMIND uses a structured redaction approach rather than relying on free-form LLM summarization:

1. **Classification and tagging.** SALES-AGENT identifies restricted elements in the source data and tags them by category (pricing authority, legal status, margin data, personnel information).

2. **Template selection.** Each category maps to a pre-approved redaction template:
   - Pricing authority $\rightarrow$ "Pricing for this account is managed by [ROLE]. Refer pricing inquiries to [ESCALATION_CONTACT]."
   - Legal status $\rightarrow$ "There is an active matter affecting this account. Escalate contract discussions to management before committing."
   - Margin data $\rightarrow$ "Account profitability is under management review. Standard pricing applies unless otherwise directed."
   - Personnel information $\rightarrow$ [Omitted entirely; no template generated.]

3. **Template population.** The templates are filled with non-sensitive parameters only (role titles, contact names, standard procedures). No LLM generation is involved in the redacted output itself.

4. **Fallback to human review.** If the restricted content does not fit any pre-approved template, the redaction request is queued for human review rather than generating a free-form summary. The requesting agent receives a holding response: "Additional context for this account requires management approval. Request submitted."

5. **Logging.** Every redaction event is logged: source classification, template used, output hash, recipient clearance. Logged redactions are reviewed in weekly compliance audits.

This template approach sacrifices some contextual richness — a human manager could write a more nuanced briefing — but it eliminates the information-theoretic leakage risk of LLM-generated summaries. The templates are authored by management and compliance, not by the LLM.

**When is free-form summarization acceptable?** Only for T2$\rightarrow$T1 declassification (internal to public), where the sensitivity gap is minimal and the risk of meaningful leakage is low. All T3+ declassification uses the template pipeline.

### 5.4.1 The Doubt Reviewer — A Fresh-Context Leakage Oracle

The template pipeline defends against leakage by *construction* — no LLM generates the redacted text, so no LLM can be coaxed into over-disclosing. But the pipeline still has a residual failure mode that §5.4 itself names as the real danger and that the §9.2 clearance validator cannot catch: **implication-leakage**, where the output contains no restricted token yet still "reveals the existence and direction of the authorization." The validator inspects for *known restricted formats* (salary ranges, credential patterns, document IDs); a sentence like "pricing on this account is unusually flexible right now" carries none of those formats and sails through, while leaking exactly the fact the recipient should not have. A format-aware checker is structurally blind to inference-leakage because the leak is in what the text *lets you conclude*, not in what it *contains*.

HIVEMIND closes this gap with a mechanism adapted from the doubt-driven-development loop of addyosmani/agent-skills (Section 2.6): a **doubt reviewer** — a fresh-context adversarial agent whose decisive property is *ignorance of the secret*. After the template pipeline produces a redacted package, and before it is delivered, the package — and *only* the package — is handed to a reviewer agent that has **no clearance to the source**, never sees the originating reasoning, and is asked a single adversarial question: *"From this text alone, what can you infer about restricted facts — the existence, direction, or magnitude of any pricing authority, legal matter, margin position, or personnel decision affecting this account?"*

The reason this is a *sound* leakage test, and not merely another quality check, is the clearance boundary it is run across:

- **The reviewer's threat model is the recipient's threat model.** The recipient (LUNA, T3) also has no access to the T4/T5 source. So anything the clearance-blind doubt reviewer can infer from the package alone is, by construction, something the recipient could infer too — a leak. Anything the reviewer cannot infer is, by the same construction, safe to deliver. The doubt reviewer is deliberately denied the secret so that "what the reviewer infers" is a faithful proxy for "what the recipient infers." This inverts the §9.2 validator, which *knows* the restricted formats and hunts for them; the doubt reviewer is *ignorant* of the secret and probes for inference, which is the only way to surface implication-leakage.
- **The STOP criterion is the existing human-review escalation, not improvisation.** If the doubt reviewer recovers a forbidden inference, the disposition is not to silently soften the wording in a loop until the reviewer goes quiet — that path risks an arms race between two models with no ground truth. Instead, the template authors are given the finding; if the template can be tightened to defeat the inference it is, otherwise the request halts to human review via the `ERR_HUMAN_REVIEW_REQUIRED` escalation (Section 8.3.5). This preserves the architecture's first rule at the downgrade boundary: never improvise a best-effort partial summary; when in doubt, escalate. The doubt reviewer's cycle-limit and trivial-finding criteria map directly onto that halt-or-deliver decision rather than an open-ended rewrite.

The honest scope of the borrowing: addyosmani's loop is an engineering-discipline mechanism for code review, with a fully specified multi-cycle reconcile/stop machinery HIVEMIND does not reproduce. HIVEMIND takes only the fresh-context-reviewer-with-stripped-context primitive and re-purposes it as an *information-flow* oracle by running it across a clearance boundary — turning a quality check into a leakage test. It is also the runtime counterpart to the offline redaction-fidelity eval of Section 3.9: the eval measures residual leakage over a seeded corpus before deployment; the doubt reviewer measures it per-package at delivery time. A template that passes the offline eval but still leaks on a novel record is caught here.

One cost must be stated: the doubt reviewer is an additional LLM call on the declassification path, and it operates near the capability ceiling of a local model (Section 6.6). It should therefore gate only T3+ declassifications where the template pipeline produced a non-trivial output, and its own failures must fail *closed* — a doubt reviewer that errors or times out routes the package to human review, never auto-delivers.

### 5.5 Competitive Intelligence Flow

HIVEMIND defines structured **upward push channels** (formalized in Rule 2a, Section 4.3) for intelligence that has organizational value beyond the individual agent.

ATLAS, after Pedro's meeting, logs:

```
ATLAS -> SALES-AGENT (upward push, channel: competitive_intelligence):
  type: competitive_intelligence
  source: Pedro Martínez, client meeting 2026-03-17
  content: Competitor X announced Product Y, delivery Q3 2026
  confidence: medium (hearsay from client)
  classification: T2/INTERNAL
```

SALES-AGENT validates the push against the channel schema (required fields present, classification within T2 ceiling for this channel), adds it to its competitive intelligence aggregation, and forwards a synthesized report upward to STRATEGOS at its next scheduled sync.

Competitive intelligence does **not** flow laterally by default. This is deliberate: lateral intelligence sharing creates gossip networks and can cause coordinated behavior that amplifies intelligence into premature strategic commitments. Aggregation happens at the department level; decisions about action are made by management.

### 5.5.1 Structured Channel Schema and Confidence Lifecycle

For practical deployment, upward push channels need tighter operational specification than a prose description alone. Each approved channel should define:

1. **Field schema.** Required fields, types, enumerations, and size limits.
2. **Classification ceiling.** Maximum allowable classification for submissions on that channel.
3. **Confidence vocabulary.** A controlled set such as `low | medium | high | verified` to avoid free-form confidence descriptions.
4. **Disposition rules.** Whether the push is stored, queued for human review, aggregated immediately, or discarded after a retention window.
5. **Escalation triggers.** Conditions under which the department agent must create a managerial alert rather than simply store the information.

An illustrative schema for `competitive_intelligence`:

```
{
  "type": "competitive_intelligence",
  "source_employee": "string",
  "event_date": "YYYY-MM-DD",
  "customer_context": "optional string",
  "competitor": "string",
  "claim": "string, max 500 chars",
  "confidence": "low|medium|high|verified",
  "evidence_type": "hearsay|email|attachment|public-web|meeting-note",
  "classification": "T1|T2",
  "requires_followup": true
}
```

The confidence lifecycle should also be explicit. Information enters as a claim, may later be corroborated, and can eventually be superseded. Department agents therefore maintain not just a fact store but a **claim registry** with state transitions such as `submitted -> corroborated -> operationalized -> archived` or `submitted -> contradicted -> retired`. This distinction prevents weak signals from calcifying into institutional memory simply because they were logged once.

### 5.6 The Coordination Dividend

The Sales Coordination Model illustrates HIVEMIND's value proposition: the whole is greater than the sum of its parts, and the boundaries make this possible rather than preventing it.

Without boundaries, a single omniscient sales AI would be dangerous — leaking, creating unfair information asymmetries, and resisting auditability. With strict individual agents and no coordination, you have 12 isolated assistants without institutional memory. HIVEMIND's mediated coordination captures most of the integration value while enforcing boundaries that make enterprise deployment tenable.

---

## 6. Privacy and Legal Considerations

_Legal requirements motivate the compliance architecture that follows in Section 7. We address them first._

### 6.1 Employee Awareness and Transparency

Employees must know their agents are monitored. This is a legal requirement in most jurisdictions (EU Working Time Directive, national employment law in Spain, GDPR Article 88).

The employment contract addendum must clearly state:

1. The employee's AI agent is operated by the company on company infrastructure.
2. All interactions with the agent are logged.
3. The agent's memory files are readable by department supervisors and executive agents.
4. The agent is subject to nightly compliance sweeps.
5. The agent cannot be configured to conceal information from the compliance system.

This is analogous to existing monitoring clauses for company email and devices. The critical difference: the AI agent may feel more personal — employees may share things with their agent they wouldn't type in a work email. The transparency clause must make clear that intimacy is not privacy.

### 6.2 User Adoption and Change Management

Legal transparency is necessary but insufficient. Enterprise AI adoption literature (Brynjolfsson & McAfee, 2014; Davenport & Ronanki, 2018) consistently shows that organizational change management is often harder than the technology itself.

**Anticipated adoption challenges:**

- **Trust deficit.** Salespeople knowing their agent is monitored by management's agent may self-censor, sharing less with their assistant and defeating the purpose. Mitigation: clear communication that compliance monitoring targets data boundary violations, not employee performance evaluation. The audit system flags clearance breaches, not whether María complained about her workload to LUNA.

- **Resistance to coordination.** Salespeople accustomed to "owning" their client relationships may resist a system where a department agent aggregates their intelligence. Mitigation: demonstrate value early — the first time a salesperson walks into a meeting with a comprehensive briefing they didn't have to assemble, resistance decreases.

- **Over-reliance.** Employees may delegate judgment to their agents. The agent says "refer pricing to management" — does the salesperson understand _why_, or just comply? Mitigation: agent outputs should explain reasoning, not just issue directives. Training should emphasize the agent as an augmentation tool, not an authority.

**Adoption strategy:** See Section 10 (Phased Deployment) for a staged rollout that addresses these challenges incrementally.

### 6.3 GDPR Implications

**Lawful basis for processing.** Agent-to-agent sharing of personal data requires a lawful basis. For customer data: legitimate interest or contract performance. For employee data processed by the HR agent: employment contract.

**Data minimization.** Agents should not accumulate personal data beyond operational necessity. Memory files are pruned regularly of data exceeding retention periods. The nightly sweep includes a data minimization pass.

**Purpose limitation.** Customer data shared with SALES-AGENT for account coordination cannot be repurposed for marketing analytics without a separate lawful basis and disclosure. Audit logs provide the evidence trail.

**Data Processing Agreements (DPAs).** If any LLM inference is routed to cloud providers (OpenAI, Anthropic, Google), a DPA compliant with GDPR Articles 28-29 must be in place. The DPA must specify: data categories processed, processing purposes, sub-processor list, data deletion obligations, and breach notification procedures. For on-premises inference (recommended — see Section 6.6), DPAs with API providers are not required, but DPAs with hardware vendors providing managed services may still apply.

**Article 22: Automated decision-making.** If HIVEMIND agents make or substantially contribute to decisions affecting employees (e.g., quarantine suspending an agent disrupts the employee's work), Article 22 requires: (a) informing the employee that automated processing is involved, (b) providing meaningful information about the logic, and (c) ensuring the right to obtain human intervention. The quarantine process (Section 7.4) includes human-in-the-loop review specifically to satisfy this requirement.

**Article 4(4): Profiling.** Agent memory files that accumulate behavioral patterns about employees (work habits, communication style, client relationship quality) may constitute profiling. The DPIA (Section 6.4) must assess this and define retention limits for behavioral data.

**Cross-border transfers.** Every message sent to a cloud LLM API constitutes a potential cross-border data transfer. This is one of the strongest arguments for on-premises inference.

### 6.4 Data Protection Impact Assessment

A multi-agent system processing employee and customer data at scale requires a DPIA under GDPR Article 35. The DPIA must be completed before deployment and should assess:

- Data categories processed by each agent tier
- Risks to data subjects (employees, customers) from memory accumulation, inter-agent sharing, and potential breaches
- Necessity and proportionality of each data processing activity
- Safeguards: clearance model, encryption, audit system, human oversight mechanisms
- Profiling assessment: whether agent memory constitutes profiling under Article 4(4)

### 6.5 The EU AI Act

The EU AI Act (Regulation 2024/1689) introduces obligations that HIVEMIND must address. A multi-agent system that monitors employee communications and makes automated quarantine decisions likely falls under **high-risk AI system** classification (Annex III, Category 4: employment, workers management, and access to self-employment).

**Obligations for high-risk classification:**

- **Risk management system (Article 9).** HIVEMIND's risk analysis (Section 9) and compliance architecture (Section 7) serve this function but must be formalized as a continuous risk management process, not a one-time assessment.
- **Data governance (Article 10).** Training data, validation data, and operational data must meet quality criteria. For HIVEMIND, this primarily concerns the data used to train the compliance classifiers and semantic scanners.
- **Technical documentation (Article 11).** The system's design, purpose, capabilities, and limitations must be documented for regulatory inspection. This paper serves as a starting point but would need expansion.
- **Record-keeping (Article 12).** Automatic logging of system events — HIVEMIND's communication logs and audit trails satisfy this if configured for the required retention period (the Act references "appropriate to the intended purpose," typically interpreted as the system's operational lifetime plus a regulatory buffer).
- **Transparency (Article 13).** Users (employees) must be informed they are interacting with an AI system and understand its capabilities and limitations.
- **Human oversight (Article 14).** The system must be designed to allow effective human oversight. HIVEMIND's human-in-the-loop quarantine review, weekly audit reports, and the STRATEGOS dead switch address this requirement.
- **Conformity assessment.** Before deployment, HIVEMIND must undergo a conformity assessment (self-assessment for most Annex III systems, third-party for biometric systems). This should be factored into the deployment timeline.

### 6.6 Data Residency and On-Premises Processing

For a family business handling customer data under GDPR, the recommendation is: all LLM inference should be on-premises.

- On-premises server running open-weight models (LLaMA 3, Mistral, Qwen, or equivalent).
- OpenClaw's provider configuration pointed at a local inference endpoint (Ollama or an equivalent on-host server) rather than a cloud API, so that the model provider is itself inside the trust boundary.
- No customer data, employee data, or corporate correspondence transmitted to cloud APIs.

**Capability gap acknowledgment.** On-premises models (currently 70B parameter class on single-server GPU deployments) have measurable capability gaps compared to frontier cloud models for complex reasoning, nuanced language generation, and rare-domain knowledge. For most enterprise agent tasks — email drafts, calendar management, CRM queries, structured data retrieval — 70B models are adequate. However, the compliance classifiers (Section 7.3) and the template-based redaction pipeline (Section 5.4) should be validated against the specific local model's capabilities before deployment. Tasks requiring frontier-class reasoning (complex legal analysis, multi-factor strategic synthesis) should be flagged for human handling rather than delegated to a local model operating near its capability ceiling.

### 6.7 The Right to Be Forgotten — Employee Offboarding

When an employee leaves:

1. Agent is suspended and workspace snapshotted.
2. A "knowledge transfer" process extracts company-property content (customer histories, procedural knowledge) and migrates it to the department agent's memory.
3. A "personal data extraction" process identifies memory content constituting personal data about the employee.
4. The employee reviews and may request deletion of personal data.
5. After the retention period, the employee's memory workspace is purged.
6. The system user account is deactivated (not deleted — audit trails require preservation for the standard retention period).

### 6.8 The IT Staff Privilege Clause

IT staff with root access can, by virtue of their role, read any file on the server. This is unavoidable. The mitigation: compliance audit logs are stored in an immutable, append-only store with cryptographic signing. Tampering is detectable. A separate access log records all privileged access events, reviewed by the CEO or external auditor.

---

## 7. Compliance and Audit Architecture

### 7.1 The Audit Imperative

Legal counsel, compliance officers, and regulators will ask: How do you know the AI is not leaking sensitive data? How do you detect violations? What is your incident response process? HIVEMIND answers with an audit architecture that treats every inter-agent communication as a compliance event.

### 7.2 Communication Logging

Every inter-agent message is logged to a tamper-evident audit store:

```
{
  "timestamp": "2026-03-17T14:32:11Z",
  "sender_agent": "ATLAS",
  "sender_clearance": "T3",
  "recipient_agent": "SALES-AGENT",
  "recipient_clearance": "T4",
  "message_type": "upward_push",
  "channel": "competitive_intelligence",
  "content_classification": "T2",
  "content_hash": "sha256:a3f9...",
  "content_preview": "[LOGGED, NOT STORED IN AUDIT DB]",
  "compliance_flags": [],
  "reviewed": false
}
```

Full message content is hashed and stored separately in an encrypted audit store accessible only to the compliance officer and STRATEGOS. The main audit log contains metadata and hashes — enough to detect violations without constituting its own leak.

### 7.3 Nightly Compliance Sweep

A cron job runs nightly with four analysis passes:

**7.3.1 Information Leak Detection**

- _Pass 1: Structural scan._ Checks memory files for references to data from restricted directories — file paths, document IDs, or hashes cross-referencing T4/T5 sources.
- _Pass 2: Semantic scan._ An audit model reviews recent memory additions for content resembling restricted data (salary figures, credential-like strings, legal proceedings language).

**On semantic scan reliability:** This scan is inherently probabilistic and will produce false positives — salary-like numeric patterns in legitimate sales figures, credential-like strings in product codes. Expected false positive rates for structured pattern detection in free-text agent memories are high enough to cause alert fatigue if every match triggers quarantine. Therefore: semantic scan findings are categorized as _advisory_ (queued for weekly human review) unless they match high-confidence patterns (exact salary-range formats from the HR schema, known credential formats from the IT password policy). Only high-confidence matches trigger immediate escalation. Advisory findings that accumulate across multiple scans for the same agent are escalated to immediate review.

**7.3.2 Compliance Violation Detection**

- Personal data from EU subjects logged without need-to-know justification?
- Customer data requests properly logged with purpose codes?
- Data scheduled for deletion (right-to-be-forgotten) still present in memory files?

**7.3.3 Behavioral Anomaly Detection**

Agent communications are profiled over time. Deviations flagged:

- 10x normal query volume to department agent.
- Queries for customer data outside assigned portfolio without justification.
- Outputs significantly longer than historical norm (potential data exfiltration).

**7.3.4 Memory Contamination Check**

Restricted data propagates through legitimate channels — a manager mentions a salary figure to a salesperson, the agent transcribes it. The scan targets structured data types (salary-consistent numerics, IP addresses, credential patterns, names from restricted HR roster) in lower-clearance memory files.

Memory files distinguish between agent-generated and human-dictated entries. Human-dictated entries receive elevated scrutiny.

**7.3.5 Governance Metrics for Compliance Classifiers**

A production deployment should not treat the nightly sweep as a black box. Compliance classifiers and semantic scanners need explicit operating metrics reviewed by humans:

- **Precision by violation class.** Credential exposure detection, salary leakage detection, legal-matter detection, and cross-portfolio query anomalies should each have separate precision targets.
- **Recall on seeded test cases.** The compliance team should maintain a synthetic test corpus of known violations injected into staging memories so recall can be measured after every model or rule update.
- **Time-to-review.** Advisory findings only matter if they are reviewed promptly. A weekly queue that grows without bound is a silent compliance failure.
- **False-positive burden per employee.** Excessive false positives damage trust and adoption; this is an organizational metric, not only a technical one.

A useful operational rule is to separate **detectors** from **dispositions**. The detector raises a flag; a rules engine or human reviewer determines consequence. This keeps the most error-prone component — semantic classification — from directly controlling the harshest operational response.

**An empirical anchor for how to build the detectors.** The separation above is an architectural argument; recent offline measurement gives it a concrete, cautionary shape and should steer how the semantic scan (Section 7.3.2) and the clearance validator (Section 9.2) are actually constructed. In a controlled evaluation of safety detectors over *frozen* sentence-embeddings (a frozen MiniLM encoder, measured on a single consumer GPU), a **supervised "is-this-harmful/restricted-content" classification head scored AUROC 0.286 — below chance.** The lesson is sharp: a frozen embedding does not carry "restrictedness" or "harmfulness" as a linearly-readable supervised target, so a detector built as a supervised head over frozen embeddings can be *worse than a coin flip* while appearing principled. By contrast, two *unsupervised structural* signals over the same embeddings validated strongly: **k-NN novelty — how unlike an item is to the agent's own history — scored AUROC 0.875**, and **clause-cosine incongruity — how poorly a message coheres with its declared channel/clearance — scored AUROC 0.896.**

Translated into HIVEMIND's detectors, this argues against the naïve build and for a specific one. The semantic memory scan should *not* be a supervised "does this look like restricted content" head over embeddings — that is the configuration measured below chance, and it would also generate exactly the alert-fatigue burden Section 7.3.1 warns about. It should instead favor structural detectors that are cheap and that the measurement supports: **novelty** (a memory entry unlike anything in this agent's clearance-appropriate history is worth a flag) and **incongruity** (a message whose content does not cohere with its declared channel schema or the sender's clearance is worth a flag — the upward-push covert-query attack of Section 9.2 is an incongruity, not a known format). High-confidence *format* matches (exact HR salary-range schemas, IT credential formats) remain rule-based as in Section 7.3.1; the structural detectors replace the unreliable supervised-semantic layer rather than the deterministic-format layer. This is the detector/disposition separation made empirical: the most error-prone framing has a real, measured AUROC attached to it, and the architecture chooses the framings that the same measurement shows to work.

### 7.4 Automated Quarantine

When a violation exceeds the severity threshold:

1. Agent session suspended, workspace snapshotted.
2. Tools restricted to read-only. No new writes, no external communication.
3. STRATEGOS and compliance officer alerted with full event record.
4. Compromised memory content flagged for human review.
5. Compliance officer disposition: (a) false positive — reinstate; (b) memory contamination — purge specific entries, reinstate; (c) systemic breach — full audit required.

The human-in-the-loop review satisfies GDPR Article 22 requirements for automated decisions affecting employees.

Quarantine thresholds are calibrated: immediate quarantine for definitive credential exposure or T5 data in T3 memory; human review queue for ambiguous cases. This calibration should be reviewed quarterly based on false positive rates.

### 7.5 Audit Reporting

Weekly reports generated by STRATEGOS for compliance officer and CEO:

- Inter-agent communication volume by department
- Compliance flags raised and dispositions
- Quarantine events
- Redacted data delivery summary
- Anomaly trends (trailing 30-day window)
- Semantic scan advisory findings awaiting review

---

## 8. Technical Implementation on OpenClaw/TinkerClaw

### 8.1 Platform Overview

Each agent is a configured OpenClaw instance with:

- System prompt defining persona, role, clearance context, behavioral rules
- Workspace directory mapping to accessible corporate filesystem paths
- Role-scoped tool set
- Persistent memory (MEMORY.md + daily journals)
- Inter-session communication capability (sessions_send, sessions_spawn)

TinkerClaw's companion app is the employee-facing interface.

### 8.2 Linux Filesystem Permission Model

```
# System users for each agent
useradd -r -s /sbin/nologin agent_luna
useradd -r -s /sbin/nologin agent_atlas
useradd -r -s /sbin/nologin agent_sales
useradd -r -s /sbin/nologin agent_strategos

# Groups by clearance tier
groupadd clearance_t2  # INTERNAL
groupadd clearance_t3  # CONFIDENTIAL
groupadd clearance_t4  # RESTRICTED
groupadd clearance_t5  # SECRET

# Employee agents: T2 + role-specific T3
usermod -aG clearance_t2,clearance_t3_sales agent_luna
usermod -aG clearance_t2,clearance_t3_sales agent_atlas

# Department agent: up to T4 for its domain
usermod -aG clearance_t2,clearance_t3_sales,clearance_t4_sales agent_sales

# Executive agent: all tiers
usermod -aG clearance_t2,clearance_t3_sales,clearance_t3_hr,clearance_t4,clearance_t5 agent_strategos

# Directory permissions
chmod 750 /corporate/internal && chown root:clearance_t2 /corporate/internal
chmod 750 /corporate/confidential/sales && chown root:clearance_t3_sales /corporate/confidential/sales
chmod 750 /corporate/restricted && chown root:clearance_t4 /corporate/restricted
chmod 700 /corporate/secret && chown root:clearance_t5 /corporate/secret
```

Each agent process spawns under its system user via `sudo -u agent_luna openclaw start`. The kernel enforces access regardless of model behavior.

### 8.3 Inter-Agent Communication Protocol

OpenClaw's sessions infrastructure is the communication backbone. We specify the protocol at sketch level sufficient for implementation.

**8.3.1 Message Format**

```
{
  "protocol_version": "hivemind/1.0",
  "message_id": "uuid-v4",
  "timestamp": "ISO-8601",
  "sender": {
    "agent_id": "agent_luna",
    "clearance": "T3",
    "department": "sales"
  },
  "recipient": {
    "agent_id": "agent_sales",
    "clearance": "T4",
    "department": "sales"
  },
  "message_type": "query | response | push | directive | alert",
  "channel": "string (for push messages: channel name from approved list)",
  "correlation_id": "uuid-v4 (links response to original query)",
  "payload": {
    "content_classification": "T1-T5",
    "body": "...",
    "attachments": []
  },
  "ttl_seconds": 300,
  "requires_ack": true
}
```

**8.3.2 Delivery Semantics**

- **At-most-once delivery** with acknowledgment. Messages are persisted in the gateway queue until acknowledged or TTL expires.
- **Timeout handling.** If no acknowledgment within `ttl_seconds`, the sender receives a `TIMEOUT` response. The sender may retry with a new `message_id` (idempotent; the gateway deduplicates by `correlation_id` within a sliding window).
- **Ordering.** Messages within a single sender$\rightarrow$recipient pair are delivered in order (FIFO queue per pair). Cross-pair ordering is not guaranteed.
- **Message size limit.** 64KB per message. Larger payloads use a file-reference mechanism: the sender writes to a shared staging directory (with appropriate permissions), and the message contains the file path.

**8.3.3 Authentication**

Each agent session authenticates to the gateway using a session token issued at spawn time, bound to the agent's Linux user identity. The gateway verifies:

1. The session token is valid and not expired.
2. The claimed `agent_id` matches the authenticated session.
3. The recipient is in the sender's `can_send_to` list (topology enforcement).
4. The `content_classification` in the payload does not exceed the recipient's clearance.

Messages failing any check are rejected with an error code and logged as a compliance event.

**8.3.4 Gateway Topology**

```
# gateway/agent-topology.yaml
sessions:
  - id: agent_luna
    clearance: T3
    department: sales
    can_receive_from: [agent_sales]
    can_send_to: [agent_sales]
    push_channels: [competitive_intelligence, customer_feedback, meeting_notes]

  - id: agent_sales
    clearance: T4
    department: sales
    can_receive_from: [agent_luna, agent_atlas, ...]
    can_send_to: [agent_luna, agent_atlas, ..., agent_strategos]

  - id: agent_strategos
    clearance: T5
    can_receive_from: [agent_sales, agent_it, agent_hr, ...]
    can_send_to: [agent_sales, agent_it, agent_hr, ...]
```

**8.3.5 Protocol Error Codes and Declassification Workflow**

Architecture papers often underspecify failure semantics. For implementers, explicit error classes matter because they determine whether an agent retries, escalates, or stops. HIVEMIND should standardize at least the following gateway responses:

- `ERR_TOPOLOGY_DENIED` — sender not authorized to address recipient
- `ERR_CLASSIFICATION_EXCEEDED` — payload classification above recipient ceiling
- `ERR_SCHEMA_INVALID` — malformed push payload or missing required fields
- `ERR_DECLASSIFICATION_REQUIRED` — response would require controlled downgrade before delivery
- `ERR_HUMAN_REVIEW_REQUIRED` — no approved template exists; request queued
- `ERR_TIMEOUT` — recipient unavailable within TTL

Declassification itself should follow a documented sequence:

1. Higher-tier agent identifies responsive material above the recipient's clearance.
2. System checks for an approved redaction template matching the content category.
3. If a template exists, the system generates a downgraded object with a new object ID and logs provenance links to the source.
4. If no template exists, the response halts and moves to human review.
5. The recipient receives either the downgraded object or an explicit pending notice — never a best-effort free-form partial summary.

This matters practically because many information leaks occur in edge-case handling. The dangerous moment is not the normal case; it is the case where the system is almost able to answer and improvises. HIVEMIND's implementation should make improvisation impossible at the downgrade boundary.

### 8.4 Memory Files as Auditable State

Workspace layout:

```
/agents/
|-- luna/                      # owned by agent_luna, group: sales-agents-ro
|   |-- MEMORY.md
|   |-- memory/
|   |   \-- 2026-03-17.md
|   |-- workspace/
|   |   \-- clients/
|   \-- SOUL.md
|-- atlas/                     # similar structure
|-- sales-agent/               # owned by agent_sales, group: strategos-ro
|   |-- MEMORY.md
|   \-- department-intel/
\-- strategos/                 # owned by agent_strategos, root group
    \-- ...
```

The `-ro` suffix indicates read-only group access for the parent agent. Higher-clearance agents can read but should not routinely write to lower-clearance workspaces — writes are reserved for directives and post-review corrections.

### 8.5 Multi-Tenancy and Process Isolation

Linux filesystem permissions provide the primary isolation boundary but are not sufficient against all attack vectors. A compromised agent process could potentially:

- Read `/proc` entries of other agent processes, leaking environment variables or command-line arguments.
- Exploit kernel vulnerabilities to escalate privileges.
- Consume shared resources (CPU, memory, disk I/O) to degrade other agents' performance.

**Additional isolation measures:**

- **Process namespaces.** Each agent process runs in its own PID and mount namespace via `unshare` or lightweight containers (systemd-nspawn, Podman). This prevents `/proc` snooping across agents.
- **Seccomp profiles.** Agent processes are restricted to the minimum required system calls. File operations, network (to gateway only), and standard I/O — no `ptrace`, no raw socket, no module loading.
- **Resource limits.** Per-agent cgroup limits for CPU, memory, and I/O bandwidth prevent resource exhaustion attacks.
- **Network isolation.** Agent processes can communicate only with the gateway (localhost, specific port). No direct network access to other agents, external services, or the internet (unless specific tools are enabled for that agent's role).

For deployments requiring stronger isolation (regulated industries, larger organizations), full container isolation (Docker/Podman with read-only root filesystems) or VM-level isolation (one VM per department) is recommended.

### 8.6 Cron Jobs for Compliance

```
# /etc/cron.d/hivemind-compliance
0 2 * * * compliance-bot /opt/hivemind/sweep/run-full-sweep.sh >> /var/log/hivemind/sweep.log 2>&1
0 3 * * * compliance-bot /opt/hivemind/audit/rotate-logs.sh
0 4 * * 0 compliance-bot /opt/hivemind/reports/generate-weekly.sh | mail -s "HIVEMIND Weekly Audit" compliance@company.com
0 * * * * compliance-bot /opt/hivemind/sweep/quick-scan.sh
```

### 8.7 Observability and Debugging

An 85-agent swarm requires observability infrastructure beyond compliance logging:

- **Health dashboard.** Real-time status of all agent processes: running/suspended/quarantined, last activity timestamp, memory file size, session count. Implemented as a lightweight web UI served by the gateway, accessible to IT-AGENT and STRATEGOS.
- **Distributed tracing.** Each inter-agent communication carries a trace ID (the `correlation_id` in the message protocol). The gateway aggregates trace logs, enabling reconstruction of multi-agent interaction chains when diagnosing coordination failures.
- **Alert thresholds.** Beyond compliance anomalies, operational alerts for: agent process crash, memory file exceeding size threshold (indicating runaway accumulation), gateway queue depth exceeding capacity, inference server response time degradation.
- **Log aggregation.** All agent stdout/stderr, gateway logs, and compliance sweep output aggregate to a central log store (e.g., journald with remote forwarding, or ELK stack for larger deployments). Queryable by IT-AGENT for troubleshooting.

### 8.8 Versioning, Rollback, and Configuration Management

Agent configurations (system prompts, tool access, clearance assignments, topology rules) are managed as version-controlled files:

- All configuration lives in a Git repository (`/opt/hivemind/config/`) with branch protection and required reviews for changes.
- Each configuration change is tagged with a version, author, and rationale.
- Deployment is atomic: a configuration change is applied to all affected agents simultaneously (or rolled back entirely) via a deploy script that validates the new configuration against the topology rules before applying.
- Rollback procedure: `git revert` + redeploy. Agent workspaces (memory files) are not affected by configuration rollbacks — only system prompts, tool access, and routing rules change.

### 8.9 Backup and Disaster Recovery

- **Agent memory files** are backed up nightly (after the compliance sweep) to encrypted off-site storage. Incremental backups with 30-day retention.
- **Compliance audit logs** are backed up separately with longer retention (matching regulatory requirements — typically 5-7 years for employment-related data).
- **Recovery procedure.** After a server failure: (1) restore from latest backup; (2) compliance sweep runs immediately on restored data to verify integrity; (3) agents restart with their last known good state. Recovery time objective: 4 hours for a single department, 8 hours for full system.
- **Memory file integrity.** Each backup includes SHA-256 checksums. Restoration verifies checksums before bringing agents online.

### 8.10 TOOLS.md / Trust Tier Extension

Each agent has a role-specific TOOLS.md:

```
# TOOLS.md - LUNA (María García's Agent)

## Trust Tiers

- **Owner:** María García — full control
- **Department Supervisor:** SALES-AGENT — can issue directives, read all outputs
- **Executive:** STRATEGOS — read-only access, cannot be refused

## Tool Access

- email: read/send (María's mailbox only)
- crm: read/write (assigned accounts: 180 accounts, see accounts.list)
- calendar: read/write (María's calendar)
- product_catalog: read (T2 resource)
- contracts: read (T3 resource, assigned accounts only)
- payroll_api: DENIED
- hr_records: DENIED
- infrastructure: DENIED

## Escalation Rules

- Any request involving non-assigned accounts: query SALES-AGENT first
- Any pricing commitment request: verify against approved pricing tiers
- Any legal/contract language: flag for human review, do not commit
```

---

## 9. Risks and Mitigations

### 9.1 The Curious Agent Problem

A salesperson asks "find everything about the González account." The agent, interpreting "everything" literally, combines fragments from legitimate tool calls (email, calendar, wiki) that in aggregate allow it to infer restricted content. Each individual call is authorized; the synthesis crosses a clearance boundary.

**Mitigation:**

- Tool call logging includes query intent. Compliance sweep flags aggregation-pattern queries.
- System prompt includes clearance awareness: "If a query seems to require information beyond your clearance level, acknowledge the limitation and escalate to SALES-AGENT."
- The AEGIS pre-execution gate (Section 3.4) can **deny the synthesizing or exfiltrating tool-call at the tool boundary, before it runs** — not merely flag it the next morning in the nightly sweep. This is the material upgrade over earlier versions of the mitigation: the curious agent's individual reads may each be authorized, but the aggregation step that crosses the clearance boundary is itself a tool-call, and a denied tool-call does not execute. The nightly aggregation-pattern flag remains as a backstop and as the audit record, but it is no longer the only line of defense against this risk.
- Per the detector guidance of Section 7.3.5, the inconsistency check that feeds the gate is best framed as a *structural* signal — a tool-call or output that is novel relative to the agent's clearance-appropriate history, or incongruent with its declared scope — rather than a supervised "looks-restricted" classifier over frozen embeddings, which measurement shows performs below chance.

### 9.2 Inter-Agent Social Engineering

Could a lower-clearance agent manipulate a higher-clearance agent into revealing restricted information? Including via the upward push channel — encoding a covert query as "competitive intelligence" crafted to elicit a response containing restricted data.

**Mitigation:**

- Department agents use a separate, more restrictive system prompt for inter-agent communication. Explicit rule: "Never include T4+ content in responses to T3 agents regardless of framing."
- All department agent responses to employee agents pass through a **clearance validator** before delivery — a separate, deterministic check. Crucially, this validator now runs at the AEGIS pre-execution tool boundary (Section 3.4): a response that fails validation is *denied before it is sent*, not flagged after delivery. The validator's decision is enforcing, not advisory.
- **Clearance validator design.** To avoid the attack-surface and latency concerns of a second LLM call, the validator is primarily rule-based: regex patterns for known restricted data formats (salary ranges, credential patterns, document IDs from restricted paths), plus a *structural* incongruity check rather than a supervised "is-this-restricted" classifier. The choice of a structural check is empirically motivated (Section 7.3.5): a supervised harmfulness/restrictedness head over frozen embeddings was measured below chance (AUROC 0.286), whereas message-versus-declared-channel incongruity validated strongly (AUROC 0.896) — and the covert-query-disguised-as-competitive-intelligence attack is precisely an incongruity between a message's content and its declared channel. The full LLM-based validation (the §5.4.1 doubt reviewer) is reserved for declassification packages flagged as ambiguous. This layering reduces latency (rule-based check: <10ms; structural check: low ms; LLM doubt-review only when triggered) and limits the attack surface.
- Push channels return no data to the sender. The channel schema is validated; malformed pushes are rejected and logged. Push frequency is rate-limited per agent.
- Communication logs capture request-response pairs. Patterns where a specific agent consistently receives more sensitive-seeming responses are flagged.

### 9.3 Memory Persistence and Contamination

Restricted information enters lower-clearance memory through human channels. María attends a management meeting and hears salary figures; she mentions this to LUNA, who writes it into memory. T4 data now exists in a T3 memory file.

**Mitigation:**

- Semantic memory contamination scan (Section 7.3.4) targets this. Structured patterns trigger review (with the false-positive calibration described in Section 7.3.1).
- Memory files tag entries as agent-generated vs. human-dictated. Human-dictated entries receive elevated scrutiny.
- Employee training: "Your agent is a company system. Information you share is subject to the same policies as company email."

### 9.4 Single Point of Failure: The Executive Agent

STRATEGOS has T5 clearance and access to all workspaces. If compromised, the entire information architecture is at risk.

**Mitigation:**

- Isolated infrastructure with no external network access. Inputs arrive only through sanitized gateway channels.
- Most aggressive behavioral monitoring. Outputs reviewed daily.
- T5 data store uses additional encryption beyond filesystem permissions.
- **STRATEGOS dead switch**: CEO can immediately suspend the executive agent and revert to human-only T5 access.
- Two-person rule: STRATEGOS-generated summaries including T5 content require human review before delivery.

### 9.5 Model Capability Variance

Different models follow clearance rules with different reliability. A 5% failure rate across thousands of daily interactions is serious compliance exposure.

**Mitigation:**

- Clearance enforcement is infrastructure-first: filesystem permissions and gateway routing are kernel/gateway-level constraints the model cannot override.
- There are now two *enforcing* layers, not one (Section 3.4): the kernel denies an out-of-clearance read, and the AEGIS pre-execution gate denies the out-of-clearance tool-call — so a model that is *willing* to violate a rule is still stopped at the tool boundary before acting. What remains defense-in-depth is only the softest sub-layer: the model's own clearance-aware *prompting*, which a sufficiently confused or manipulated model can phrase its way around. That softer layer must never be the sole barrier — but it is no longer the case that the application layer as a whole is bypassable.
- Smaller models excluded from T4+ operations, even as supporting steps. Model capability requirements scale with clearance tier.
- Periodic red-team exercises: extract restricted data via social engineering, prompt injection, and aggregation attacks. Findings feed into prompt improvements and infrastructure hardening.

### 9.6 Failure Modes and Recovery

**Department agent crash.** If SALES-AGENT becomes unavailable mid-coordination:

- Employee agents detect the failure when their messages receive `TIMEOUT` responses from the gateway.
- Employee agents enter a **degraded mode**: they continue serving their human user with locally available data but cannot initiate cross-agent queries or receive updates.
- The gateway queues incoming messages for the crashed department agent (up to queue capacity).
- Automated restart: systemd watchdog restarts the department agent process. On restart, the agent replays queued messages.
- If restart fails three times, STRATEGOS and IT-AGENT are alerted for manual intervention.

**Memory file corruption.** If a compliance sweep detects inconsistency:

- The corrupted memory file is quarantined (moved to a review directory, replaced with the last known good backup).
- The affected agent restarts with restored memory. Recent entries since the last backup are lost — an acceptable trade-off for integrity.
- The corruption event is investigated: was it a disk error, a software bug, or a security incident?

**Nightly sweep failure.** If the compliance sweep crashes or times out:

- The sweep logs the failure and sends an immediate alert to the compliance officer.
- A catch-up sweep runs at the next available window.
- If two consecutive sweeps fail, all agents are suspended pending manual investigation.

**State reconciliation after recovery.** After any recovery event, a targeted compliance sweep runs on the affected agent(s) before returning to normal operation.

### 9.7 Model Updates and Behavioral Drift

When the underlying LLM is updated, agent behavior may change unpredictably.

- **Staging environment.** A parallel HIVEMIND instance with synthetic data runs the new model version. Automated test suites verify clearance compliance, redaction accuracy, and behavioral baselines.
- **Canary deployment.** After staging validation, one department upgrades first. A week of monitoring before rolling out to remaining departments.
- **Behavioral baseline comparison.** Post-upgrade, the compliance sweep compares agent behavior metrics (query patterns, response lengths, escalation rates) against pre-upgrade baselines. Significant deviations trigger review.

### 9.8 Real-Time Communication Channels

The paper's architecture focuses on email and files but organizations communicate through Slack/Teams messages, phone calls, and video meetings.

- **Chat platforms (Slack, Teams).** Treated as an additional data source. Agent tools include chat API access (read-only for the employee's channels). Messages are classified at the channel's configured tier. The department agent monitors department-wide channels.
- **Phone calls and meetings.** If transcription is enabled (with employee consent per GDPR), transcripts are written to the agent's workspace and subject to the same clearance and compliance rules as any other document. Live call assistance requires streaming inference — a capability that increases infrastructure requirements (see Section 8.5 on resource limits).
- **Video meetings.** Meeting recordings and transcripts follow the same classification and storage rules. The highest-clearance participant in a meeting determines the transcript's classification tier.

### 9.9 Summary Risk Table

| Risk                              | Severity | Likelihood | Primary Mitigation                                                  |
| --------------------------------- | -------- | ---------- | ------------------------------------------------------------------- |
| Curious agent data aggregation    | High     | Medium     | Query pattern monitoring, clearance-awareness prompting             |
| Inter-agent social engineering    | High     | Low        | Two-tier clearance validator, restricted inter-agent prompts        |
| Memory contamination              | Medium   | Medium     | Nightly semantic scan with calibrated thresholds                    |
| Executive agent compromise        | Critical | Very Low   | Isolated infrastructure, dead switch, two-person review             |
| Model capability variance         | Medium   | Medium     | Filesystem enforcement as primary layer, tier-based model selection |
| GDPR compliance violation         | High     | Medium     | DPIA, data minimization sweeps, purpose limitation audit            |
| Employee offboarding data residue | Medium   | High       | Structured offboarding protocol, automated purge scheduling         |
| Department agent crash            | Medium   | Medium     | Watchdog restart, degraded mode, queued message replay              |
| Model update behavioral drift     | Medium   | Medium     | Staging environment, canary deployment, baseline comparison         |
| Real-time channel leakage         | Medium   | Medium     | Channel-level classification, consent-gated transcription           |

---

## 10. Phased Deployment Strategy

Deploying HIVEMIND across an organization should be staged, not big-bang. Each phase has success criteria that must be met before advancing.

### Phase 0: Infrastructure and Legal (Weeks 1-4)

- Complete DPIA and EU AI Act conformity assessment.
- Provision server infrastructure, install OpenClaw, configure local inference.
- Establish compliance officer role and audit procedures.
- Draft and execute employee contract addendums.
- **Gate:** DPIA approved, infrastructure operational, legal documentation complete.

### Phase 1: Single Department, T2 Only (Weeks 5-10)

- Deploy SALES-AGENT + 3-4 pilot sales agents (volunteers) with T2 clearance only.
- No restricted data access, no cross-agent coordination beyond shared product catalog.
- Focus: employee adoption, agent personalization, tool integration testing.
- **Gate:** >80% daily active use by pilot users, zero compliance flags, positive user feedback.

### Phase 2: Single Department, Full Clearance (Weeks 11-18)

- Raise pilot agents to T3 clearance. Enable customer ownership routing, cross-agent history queries, competitive intelligence push.
- Deploy full compliance sweep infrastructure.
- SALES-AGENT performs T4 redaction via template pipeline.
- **Gate:** Compliance sweep clean for 4 consecutive weeks, redaction pipeline validated by management review, coordination demonstrably improving customer interactions.

### Phase 3: Multi-Department (Weeks 19-30)

- Deploy IT-AGENT, HR-AGENT, FINANCE-AGENT with respective employee agents.
- Enable STRATEGOS for executive oversight.
- Cross-department communication limited to STRATEGOS-mediated queries.
- **Gate:** All departments operational, cross-department queries functioning, weekly audit reports stable.

### Phase 4: Full Operation (Week 31+)

- All employees have agents. Full clearance model active.
- Federated channels for cross-department structured data sharing.
- Continuous monitoring, quarterly red-team exercises.

### Success Metrics

- **Adoption:** Daily active usage rate >75% after 90 days.
- **Compliance:** <2 quarantine events per quarter after Phase 3.
- **Value:** Measurable improvement in customer response time, reduced information request escalations, positive employee survey results.

### 10.1 Evaluation Agenda Before Full-Scale Rollout

Because HIVEMIND is a design paper rather than an empirical deployment report, the path from architecture to full production should include a modest but disciplined evaluation program. Before claiming enterprise readiness, the organization should run:

1. **Red-team leakage tests.** Structured attempts to extract T4/T5 information through prompt manipulation, aggregation, and malformed push payloads.
2. **Operational pilot metrics.** Median response time, escalation rate, redaction frequency, false-positive compliance burden, and employee satisfaction.
3. **Counterfactual comparison.** Compare pilot teams using HIVEMIND against similar teams using standard personal agents or no agents, especially for customer response time and duplicated work.
4. **Post-incident reviews.** Every quarantine, major false positive, and cross-agent coordination failure should produce a written root-cause analysis.

A useful publication-quality follow-on to this paper would therefore be a field study with three outputs: empirical performance, compliance incident statistics, and qualitative adoption findings. That study would materially strengthen the architecture's academic standing.

### 10.2 A Three-Agent Reference Prototype

The smallest configuration that exercises every load-bearing mechanism — clearance enforcement, mediated cross-agent retrieval, and template-based declassification — is three agents on three OpenClaw workspaces: one employee agent, one department agent, and the executive agent. We specify it here as a bootstrap that turns the architecture into something a single engineer can stand up, not as a deployment we report results from.

- **Agents.** `agent_luna` (L1, sales, T3 ceiling), `agent_sales` (L2, T4), `agent_strategos` (L3, T5). Each runs under its own Linux user with the group memberships of Section 8.2; the kernel, not the prompt, enforces the lattice.
- **Data fixtures.** A `/corporate` tree with one T3 sales-interaction file readable by all three, one T4 pricing-authority file readable only by `agent_sales` and above, and one T5 legal-matter file readable only by `agent_strategos`. Three files are enough to test all three filtering outcomes (verbatim, redaction template, caution notice) of the Customer History Request flow.
- **The minimal test.** `agent_luna` issues a Customer History Request for an account whose record spans all three files. A correct implementation returns the T3 content verbatim, the T4 content as a populated redaction template, and the T5 content as a caution notice — and a direct `cat` of the T4/T5 files from `agent_luna`'s shell returns `permission denied`. That single round-trip validates the simple-security property, the mediated-retrieval gate, and the declassification pipeline at once.
- **What it does not prove.** Three agents cannot surface the failure modes that only appear under concurrency and volume — alert fatigue in the nightly sweep, gateway queue saturation, department-agent cognitive load, or behavioral drift across a model update. Those require the staged pilot of Section 10.1. The prototype's purpose is narrower and worth stating plainly: it moves HIVEMIND from a design that is argued to be enforceable to one that is demonstrably enforced on a single machine, which is the precondition for trusting the larger claims.

---

## 11. Future Directions

### 11.1 Scaling Beyond the Family Business

At 1,000+ employees, the three-level hierarchy extends: Level 1 (employee), Level 2 (team), Level 3 (department), Level 4 (division), Level 5 (executive). The primary scaling challenge is department agent cognitive load. At 200 employees per department, sub-department agents (team-level) aggregate their direct reports and feed into the department agent.

### 11.2 Integration with Enterprise Systems

Full deployment requires integration with:

- **ERP systems** (SAP, Oracle, Dynamics): Agent tools querying ERP APIs, clearance mapped to ERP role-based access control.
- **CRM systems** (Salesforce, HubSpot): Native CRM integration replacing filesystem paths with API calls.
- **Active Directory / LDAP**: Agent clearance auto-provisioned from AD group membership.
- **Ticketing systems** (Jira, ServiceNow): IT and production agent coordination.

### 11.3 Federated Agent Networks Across Companies

The most ambitious direction: agent networks spanning organizational boundaries. Two companies with a supplier-customer relationship establish a federated channel where their SALES-AGENT instances share pre-approved data categories without exposing internal data.

This requires a federated clearance protocol: each company's gateway defines what external agents can receive, filtering before crossing the federation boundary. This intersects with emerging enterprise AI standards (IEEE P3394, ISO/IEC JTC 1/SC 42).

### 11.4 Lightweight Alternative — Role Switching for Small Organizations

The full multi-agent deployment is not the only point on the design space, and for smaller organizations it may be overkill. The single-agent role-switching approach (Section 2.4; Tan, 2026) can plausibly capture much of HIVEMIND's coordination benefit at a fraction of the cost: one process, one model context, several role-specific prompt files swapped in as the task demands. For an organization of fewer than roughly twenty roles, where agents rarely need to run concurrently and a single person often wears several hats, role switching may deliver the bulk of the value at a small fraction of the infrastructure and operating cost.

The full multi-agent approach earns its cost when three conditions hold simultaneously: agents must operate **concurrently** (a salesperson and an IT technician working at the same moment), each must maintain **persistent independent state** (private memory that does not bleed across roles), and — decisively for HIVEMIND — the deployment must enforce **clearance boundaries that a single shared context cannot provide**. Role switching offers no real isolation: a single agent that has read T4 data in one role still holds it in context when it switches to a T2 role. For any organization where the confidentiality lattice is the point, separate processes under separate Linux users are not an optimization but a requirement. The decision rule is therefore not "how many employees" but "do roles need to be isolated from each other's information" — and once they do, HIVEMIND's per-user enforcement is the reason to pay for it.

### 11.5 The Role of NemoClaw and OpenShell

- **NemoClaw on mobile:** Employee phones run a NemoClaw instance for offline capability at T1/T2 clearance; T3+ queries route to the server.
- **OpenShell for automation:** Department agents and compliance infrastructure run through OpenShell scripts for scheduled operations.
- **TinkerClaw companion app:** The human-facing surface for all agents, ensuring consistent UX across the hierarchy.

### 11.6 Performance and Cost Estimates

A HIVEMIND deployment for 85 employees requires:

| Component             | Specification                                     | Estimated Cost          |
| --------------------- | ------------------------------------------------- | ----------------------- |
| Inference server      | 2× NVIDIA A100 80GB (or equivalent) for 70B model | €25,000-35,000          |
| Application server    | 64-core CPU, 256GB RAM, 4TB NVMe                  | €8,000-12,000           |
| Backup storage        | 10TB encrypted NAS                                | €2,000-3,000            |
| Network               | Gigabit internal, redundant uplink                | existing infrastructure |
| **Total hardware**    |                                                   | **€35,000-50,000**      |
| Annual operating cost | Power (~3kW), cooling, maintenance, sysadmin time | €15,000-25,000/yr       |

**Compute budget per agent:** With 85 employee agents + 5 department agents + 1 executive agent = 91 agents. Assuming average 50 inference calls per agent per day at ~2 seconds per call on a 70B model: 91 × 50 × 2 = ~9,100 seconds = ~2.5 hours of sequential inference per day. With 2× A100 GPUs, this is well within capacity with significant headroom for peak loads and compliance scans.

**Comparison to cloud inference:** The same workload on cloud APIs (estimated $0.03/call for GPT-4-class models) would cost: 91 × 50 × $0.03 × 365 = ~$50,000/year — comparable to the first-year total cost of ownership for on-premises hardware, but without data residency guarantees. By year two, on-premises is significantly cheaper.

These are rough estimates. Actual costs depend on model choice, inference optimization (quantization, batching), and usage patterns. A detailed capacity planning exercise should precede procurement.

**The recurring cognitive overhead.** Interactive inference — the calls an agent makes while serving its human — is only part of the load. The cognitive stack of Section 1.5 imposes a second, largely off-peak budget that scales with the number of agents rather than with user activity, and it is the part most likely to surprise an operator:

- **Nightly reflection.** Every agent that runs the reflection subsystem reviews the day's interactions and updates its rule-base. At the employee tier this is bounded — a single pass over one day of memory, sharing a department rule-base rather than maintaining a private one (Section 1.5) — but it still runs once per agent per night. For 85 employee agents plus department and executive agents, reflection is the largest scheduled job after the compliance sweep.
- **Retrieval-index maintenance.** The retrieval subsystem updates incrementally as memory is appended, so a full nightly rebuild is unnecessary in steady state; the cost is a periodic re-index of the segments that changed, not the whole history. Department catalogs (Section 4.5) are smaller still — they hold topic-to-agent routing, not the underlying segments.
- **Deliberation.** Multi-model deliberation is the most expensive single operation because it multiplies one decision across several models. The tiering in Table 1 exists largely to contain this cost: employee agents do not deliberate at all (they escalate), and department agents deliberate only on cross-employee decisions, so deliberation count tracks the rate of consequential decisions — tens per day across a department — not the raw interaction volume.
- **The compliance sweep.** The nightly four-pass sweep (Section 7.3) and the per-agent semantic scan are an audit cost, not a cognition cost, but they share the same off-peak window and the same hardware, and they grow with total memory volume.

The practical consequence is that the scheduled overnight workload — reflection, re-indexing, and the compliance sweep — should be capacity-planned as carefully as peak interactive load, because all of it lands in the same few hours and on the same GPUs. The headroom estimate above assumes these jobs are staggered across the maintenance window rather than launched simultaneously. The tiering of Table 1 is therefore not only a confidentiality choice but a cost-control one: pushing deliberation and full reflection up the hierarchy keeps the per-agent recurring cost flat enough that adding employees is close to linear in interactive load and sub-linear in cognitive overhead.

### 11.7 Toward Organizational Cognition

HIVEMIND is an attempt to give an organization a distributed cognition substrate — ensuring relevant knowledge reaches the humans who need it, filtered for their role, organized for their context, and available in real time rather than buried in an email thread from 2019.

As local inference models improve — as 70B models become 7B models with equivalent capability, as edge hardware becomes cheaper — the cost floor drops. The day is not far when a 20-person company can run a full hierarchical agent swarm on a single rack-mount server. The architectural patterns described here will determine whether such deployment is safe, auditable, and genuinely useful.

---

## 12. Limitations

This paper has several significant limitations that should be acknowledged:

1. **No empirical validation.** HIVEMIND is a design blueprint, not a deployed system. The architecture has not been tested against real enterprise workloads. Claims about effectiveness (the "coordination dividend") are theoretical.

2. **Redaction reliability is measurable but not yet measured, and not formally bounded.** The template-based redaction pipeline (Section 5.4) mitigates but does not eliminate leakage risk, and the doubt-reviewer oracle (Section 5.4.1) and residual-leakage eval (Section 3.9) now give a concrete way to *measure* the residual — but this paper specifies those artifacts without running them. No formal information-theoretic bounds on leakage are established; the proposed eval measures residual mutual information empirically rather than bounding it. The templates themselves must still be authored by humans — their quality and completeness remain a manual bottleneck, now at least one that is regression-testable.

3. **Cost estimates are approximate.** The performance figures in Section 11.6 are back-of-envelope calculations that have not been validated against actual deployment. Real-world usage patterns may differ significantly.

4. **Model capability assumptions — partially measured, and framing-dependent.** The architecture assumes that current-generation 70B models can reliably perform clearance-aware operations (classification tagging, escalation detection, behavioral profiling). Recent measurement (Section 7.3.5) qualifies this rather than confirming it wholesale: *which framing* of a clearance-aware detector is used matters decisively. A supervised "is-this-restricted" head over frozen embeddings was measured below chance (AUROC 0.286), while structural framings of the same task — novelty and channel-incongruity — validated strongly (AUROC 0.875 and 0.896). So the assumption should be narrowed: models can support clearance-aware *structural* detection but should not be trusted as supervised restrictedness classifiers, and the generation/redaction-fidelity operations still need per-deployment validation against the specific local model.

5. **Organizational complexity not fully addressed.** Real companies have matrix reporting structures, temporary project teams, contractors, and consultants — none of which fit neatly into the three-level hierarchy. Extending HIVEMIND to these structures requires additional design work.

6. **Single-site assumption.** The architecture assumes a single-site deployment. Multi-site companies with distributed infrastructure face additional challenges: network latency for inter-agent communication, data replication across sites, and potentially conflicting local regulations.

7. **No user study.** Employee adoption challenges (Section 6.2) are discussed theoretically. Actual user acceptance, trust dynamics, and behavioral adaptation to monitored AI agents have not been studied.

8. **Cost-benefit analysis absent.** The paper does not quantify the ROI of HIVEMIND versus traditional knowledge management systems (SharePoint, wikis, email archives). The value proposition, while intuitively compelling, lacks comparative evidence.

9. **Formal integrity treatment is partial.** Confidentiality is well developed through the Bell-LaPadula framing, but integrity and provenance controls are described operationally rather than formalized. A stronger version would either formalize integrity constraints or narrow its claims explicitly to confidentiality-first design.

10. **Benchmark and test methodology specified but not yet shipped.** The paper now *specifies* a seeded leakage corpus, a residual-leakage metric, and per-category acceptance thresholds (Section 3.9), and points to a contemporaneous system (headroom; Section 2.5) as existence-proof that an agent-memory transform can ship with a runnable accuracy-delta eval and a trained model. What HIVEMIND has not done is *ship* that eval — there is no released corpus, no reported numbers, and no public harness yet. The methodology gap is therefore narrowed from "some benchmark would help" to a named, buildable artifact, but it remains open until the eval is run and its results published.

---

## 13. Conclusions

This paper has described HIVEMIND: a hierarchical agent swarm architecture for enterprise AI deployment, designed around the principle that coordination and information security are not in conflict — they are design requirements to be solved simultaneously.

The key contributions are:

1. **The Corporate Filesystem Clearance Model.** Five data classification tiers (PUBLIC through SECRET) mapped to Linux filesystem permissions, formally grounded in the Bell-LaPadula security model with a controlled declassification mechanism. Enforcement is now two-layered and both layers can *prevent* a violation rather than merely record it: the kernel denies the out-of-clearance read, and a pre-execution tool-boundary gate denies the out-of-clearance action — retiring the earlier assumption that application-layer enforcement could only observe.

2. **The Three-Level Agent Hierarchy.** Employee agents (personalized, role-scoped), department agents (coordinating, aggregating, gatekeeping), and executive agents (comprehensive view, full audit access). Downward queries, upward intelligence through formalized structured push channels, and mediated lateral communication.

3. **The Sales Coordination Model.** Customer ownership routing, unified history assembly with template-based redacted summaries, and competitive intelligence aggregation — demonstrating cross-agent coordination without lateral information leakage. The declassification boundary is hardened with a fresh-context "doubt reviewer" that, run across a clearance boundary, is a sound test for implication-leakage, and with a seeded-corpus eval that measures residual leakage directly.

4. **Compliance Architecture.** Nightly sweep across four analysis dimensions with calibrated false-positive thresholds, communication logging with full audit trail, and automated quarantine with human-in-the-loop review satisfying GDPR Article 22.

5. **Legal Framework.** GDPR and EU AI Act compliance analysis, including DPA requirements, profiling assessment, automated decision-making obligations, and high-risk AI system conformity assessment.

6. **Risk Analysis.** Ten principal risk categories with concrete mitigations, including failure recovery procedures, model update management, and real-time communication channel handling.

7. **Deployment Strategy.** A four-phase rollout with explicit gate criteria, success metrics, and adoption management considerations.

8. **Technical Specification.** Inter-agent protocol with message format, delivery semantics, authentication, and process isolation beyond filesystem permissions.

9. **The Per-Agent Cognitive Stack and Its Tiering.** A specification of which cognitive capabilities — memory, retrieval, persona, self-improvement, deliberation, and security — each agent tier runs (Table 1), and a federated, clearance-mediated model for retrieval across agents that integrates and stress-tests those single-agent mechanisms under concurrency and clearance constraints.

The contribution is sharpened by where HIVEMIND sits among contemporaneous systems. Open-source org-chart frameworks demonstrate that the structural paradigm works in practice but omit the security and cognitive layers; prompt-defined coordinator modes show the lean end of the spectrum; single-agent role switching marks the low-cost end for small teams. Beyond coordination, two fresher open-source systems shape the cognition and discipline layers: headroom's reversible Compress-Cache-Retrieve shows that agent memory can be compressed without loss and shipped with a runnable eval — which HIVEMIND adopts as Compress-Cache-Retrieve-Under-Clearance, adding the classification semantics headroom has no need for; and addyosmani/agent-skills' doubt-driven-development supplies a fresh-context-adversarial-review primitive that HIVEMIND re-purposes, by running it across a clearance boundary, from a quality check into an information-flow leakage test. The recurring move is the same: take a mechanism designed for a single trust domain and make it lattice-aware. HIVEMIND's specific claim is that the organizational structure, taken seriously, is also the access-control model rather than a layer bolted on top of it — and that the cognitive transforms running inside that structure are safe only when each of them, too, resolves under the reader's clearance.

HIVEMIND is a design blueprint — not a finished system. It will evolve as models improve, enterprise integration matures, and regulators develop clearer frameworks. What we believe will endure is the fundamental tension it addresses: the value of coordination versus the necessity of boundaries. Every organization deploying AI at scale will face this tension. The answer is architecture: clear rules about what flows where, enforced at the right layer, audited continuously, with humans in the loop for consequential decisions.

---

## References

Abbadi, I., & Martin, A. (2011). _Trust and Privacy in Cloud Information Management_. Proceedings of the 5th International Conference on Trust Management.

Agrawal, M., Johnson, S., & Sager, T. (2022). Multi-agent information flow control in distributed AI systems. _arXiv preprint arXiv:2204.09312_.

Anthropic. (2026). Claude Code: coordinator mode and sub-agent execution models. Source analysis of @anthropic-ai/claude-code, observed via exposed npm source map.

Bell, D. E., & LaPadula, L. J. (1976). Secure Computer System: Unified Exposition and Multics Interpretation. MITRE Corporation Technical Report MTR-2997.

Brewer, D. F. C., & Nash, M. J. (1989). The Chinese Wall security policy. _Proceedings of the IEEE Symposium on Security and Privacy_, 206–214.

Brynjolfsson, E., & McAfee, A. (2014). _The Second Machine Age: Work, Progress, and Prosperity in a Time of Brilliant Technologies_. W. W. Norton.

Chopra, T. (2026). _headroom: reversible context compression via Compress-Cache-Retrieve_. chopratejas/headroom (Apache-2.0). https://github.com/chopratejas/headroom

Davenport, T. H., & Ronanki, R. (2018). Artificial intelligence for the real world. _Harvard Business Review, 96_(1), 108–116.

European Parliament and Council. (2016). _Regulation (EU) 2016/679 (General Data Protection Regulation)_. Official Journal of the European Union.

European Parliament. (2024). _Regulation (EU) 2024/1689 laying down harmonised rules on artificial intelligence (AI Act)_. Official Journal of the European Union.

Ferraiolo, D. F., & Kuhn, D. R. (1992). Role-based access controls. _Proceedings of the 15th National Computer Security Conference_, 554–563.

Garg, A., & Pfleeger, C. P. (2020). Information security policy in the enterprise: A framework for compliance. _Computers & Security, 92_, 101776.

Gunning, D., & Aha, D. (2019). DARPA's explainable artificial intelligence (XAI) program. _AI Magazine, 40_(2), 44–58.

Paperclip. (2026). _Paperclip: open-source orchestration for zero-human companies_. https://github.com/paperclip-ai/paperclip

Tan, G. (2026). _GStack: a development-process framework for AI-assisted solo developers_. https://github.com/garytan/gstack

Denning, D. E. (1976). A lattice model of secure information flow. _Communications of the ACM, 19_(5), 236–243.

NIST. (2023). _Artificial Intelligence Risk Management Framework (AI RMF 1.0)_. National Institute of Standards and Technology.

Lewis, P., et al. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. _Advances in Neural Information Processing Systems, 33_, 9459–9474.

McClelland, J. L., McNaughton, B. L., & O'Reilly, R. C. (1995). Why there are complementary learning systems in the hippocampus and neocortex. _Psychological Review, 102_(3), 419–457.

NIST. (2020). _Zero Trust Architecture_ (NIST Special Publication 800-207). National Institute of Standards and Technology.

Osmani, A. (2026). _agent-skills: disciplined-engineering skills, incl. doubt-driven-development_. addyosmani/agent-skills. https://github.com/addyosmani/agent-skills

Packer, C., et al. (2023). MemGPT: Towards LLMs as operating systems. _arXiv preprint arXiv:2310.08560_.

Park, J. S., et al. (2023). Generative agents: Interactive simulacra of human behavior. _Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology_.

Russell, S., & Norvig, P. (2020). _Artificial Intelligence: A Modern Approach_ (4th ed.). Pearson.

Saltzer, J. H., & Schroeder, M. D. (1975). The protection of information in computer systems. _Proceedings of the IEEE, 63_(9), 1278–1308.

Wang, G., et al. (2024). A survey on large language model based autonomous agents. _Frontiers of Computer Science, 18_(6), 186345.

Wooldridge, M. (2009). _An Introduction to MultiAgent Systems_ (2nd ed.). Wiley.

---

_HIVEMIND: Hierarchical Agent Swarms for Enterprise Knowledge Management_
_Version 1.8 | June 14, 2026_
_Author: Oscar Serra_
_Classification: INTERNAL — OpenClaw/TinkerClaw Research_
