The Governance Layer
Relevant source files
The following files were used as context for generating this wiki page:
The Governance Layer serves as the primary security and policy enforcement framework within the Nexus Orchestrator. It is designed to manage non-human identities—specifically AI agents—by implementing a Zero Trust security model and Open Policy Agent (OPA) integration to ensure that all infrastructure interactions are authorized and audited.
This layer bridges the gap between autonomous agent actions and secure operating environments by enforcing strict controls over how agents access managed environments, SSH connectivity, and persistent state files. It functions as a critical pillar of the "Autonomous Infrastructure Daemon," providing the necessary oversight for a local-first, background orchestration system.
Sources: README.md:3-13, README.md:19
Architecture and Core Pillars
The Governance Layer is one of the four core pillars of the Nexus system. It operates in tandem with the Connectivity, Orchestration, and Context layers to provide a holistic "nervous system" for AI development.
Security Model
The architecture relies on two primary technical standards:
- Open Policy Agent (OPA): Used for fine-grained policy evaluation and decision-making regarding infrastructure access.
- Zero Trust: A security paradigm where no entity, even within the local environment, is trusted by default. Every agent must be verified and authorized for every action.
The following diagram illustrates the relationship between the Governance Layer and other system components:
The diagram shows how the OPA engine and Zero Trust principles within the Governance Layer mediate requests between AI agents and the managed infrastructure.
Sources: README.md:4-10, README.md:19
Agent Identity Management
A central component of the Governance Layer is the tracking and verification of identities. This is primarily handled through persistent state management in the Context Layer, specifically through the AGENTS.md file.
Known Agents Registry
The system maintains a registry of all AI agents that interact with the orchestrator. This registry is used by the Governance Layer to determine the "Trust Level" of an identity before granting access to infrastructure resources.
| Field | Description |
|---|---|
| Agent ID | Unique identifier for the AI agent entity. |
| Description | Human-readable metadata about the agent's function. |
| Trust Level | The security clearance or classification assigned to the agent. |
Sources: context/AGENTS.md:3-8, README.md:18
Infrastructure Governance
The Governance Layer controls the lifecycle of infrastructure components through the following mechanisms:
Environment and SSH Security
The orchestrator autonomously manages SSH connectivity. The Governance Layer ensures that these connections are only established under the parameters defined by the security policy, preventing unauthorized lateral movement or environment escapes by agents.
Policy Enforcement Flow
When an agent attempts an operation through the Orchestration Layer (powered by LangGraph), the Governance Layer evaluates the request against the OPA policies.
The sequence demonstrates the mandatory check-in with the Governance Layer before any infrastructure-altering command is executed.
Sources: README.md:5-9, README.md:17-19
Configuration and Implementation
The Governance Layer's behavior is influenced by environment-level configurations and setup scripts that define the operational boundaries of the daemon.
Environment Configuration
Key variables required for the secure operation of the orchestrator are defined in environment templates. These include parameters for connectivity and local-first orchestration.
| Variable | Context |
|---|---|
NEXUS_MODE | Determines the operational state of the orchestrator. |
TRUST_DOMAIN | Defines the scope of the Zero Trust boundary. |
Sources: .env.example, scripts/setup-env.sh
Project Dependencies
The governance and orchestration logic is integrated into the core application, as evidenced by the project structure and scripts designed to initialize the nervous system.
Sources: package.json, scripts/setup-env.sh
Summary
The Governance Layer is the security backbone of Nexus Orchestrator. By combining OPA governance with Zero Trust principles, it ensures that AI agents can autonomously manage infrastructure without compromising security. It turns the orchestrator into a controlled environment where every action is mapped to a known identity with a specific trust level, effectively bridging the "infrastructure gap" with a layer of safety and accountability.
Sources: README.md:3-10, README.md:19