Defining Custom Policies
Relevant source files
The following files were used as context for generating this wiki page:
Nexus Orchestrator utilizes a Governance Layer to enforce security and operational constraints on AI agents. Defining custom policies allows administrators to specify how agents interact with infrastructure, ensuring that non-human identities adhere to Zero Trust principles and organizational standards.
The policy framework is built upon the integration of Open Policy Agent (OPA) and Zero Trust security models. This system functions as part of the autonomous infrastructure daemon, synthesizing governance with the LangGraph-powered orchestration and the Model Context Protocol (MCP) connectivity layer.
Sources: README.md:1-20
Policy Architecture and Governance
The governance system acts as a gatekeeper within the Nexus "nervous system." It evaluates requests from agents against defined policies before any infrastructure changes are executed. This is managed within the Governance Layer, which combines OPA for policy logic and Zero Trust for identity verification.
The following diagram illustrates the flow of a request through the governance and security layers:
The diagram shows the sequence from an agent request through identity verification and policy evaluation before reaching the orchestration and infrastructure layers.
Sources: README.md:11-16, src/core/governance.py
Agent Trust and Identity
Policies are often applied based on the identity and trust level of the agent making the request. The system tracks these attributes in a central registry to facilitate policy decisions.
| Attribute | Description | Purpose |
|---|---|---|
| Agent ID | Unique identifier for the AI agent | Used to map specific policies to individuals |
| Description | Functional role of the agent | Provides context for manual audits |
| Trust Level | Assigned security tier | Determines the scope of accessible infrastructure |
Sources: context/AGENTS.md:1-10, src/core/security.py
Implementing OPA Policies
Custom policies are defined using Rego (the OPA policy language). These policies reside within the governance layer and are evaluated against the context of the agent and the requested action.
Zero Trust Security Model
The implementation follows a Zero Trust architecture for non-human identities. Every interaction is verified, regardless of where the request originates. This is crucial for agents operating in background orchestration roles where manual oversight is minimal.
The class diagram demonstrates the relationship between the governance layer, the OPA service for policy execution, and the identity management system.
Sources: README.md:16, src/core/governance.py, config/opa/policies/main.rego
Policy Configuration Elements
Policies are structured to handle various infrastructure tasks, including SSH connectivity and environment management. When defining a new policy, the following components are typically involved:
- Input Context: Data about the agent (ID, trust level) and the target infrastructure.
- Rules: Logic that determines if the
allowvariable is true or false. - Data: Static or dynamic information about known agents and their permissions.
Example Policy Structure
A custom policy might check the Trust Level defined in the agent tracking system to permit or deny access to specific SSH environments managed by the connectivity layer.
Sources: README.md:9-10, context/AGENTS.md:7-9, config/opa/policies/main.rego
Summary
Defining custom policies in Nexus Orchestrator is the primary method for securing autonomous AI infrastructure interactions. By leveraging OPA and Zero Trust, the system ensures that every action taken by an agent is authorized according to its trust level and the specific rules defined in the Governance Layer. This provides a robust bridge between AI agents and their operating environments, maintaining security without sacrificing autonomy.
Sources: README.md:1-6