# Interface IPolicyEngine

Policy engine interface.

interface IPolicyEngine {
evaluate(
gate: {
id: string;
afterStage: string;
beforeStage: string;
rules: string[];
onFail: "warn" | "block" | "escalate";
},
context: PolicyContext,
): PolicyDecision;
registerRule(rule: PolicyRule): void;
listRules(): readonly PolicyRule[];
}

#### Implemented by

- PolicyEngine

- Defined in packages/nexus-agents/src/pipeline/policy-engine.ts:45

##### Index

### Methods

evaluate
registerRule
listRules

## Methods

### evaluate

- evaluate(
  gate: {
  id: string;
  afterStage: string;
  beforeStage: string;
  rules: string[];
  onFail: "warn" | "block" | "escalate";
  },
  context: PolicyContext,
  ): PolicyDecision

  #### Parameters

  - gate: {
    id: string;
    afterStage: string;
    beforeStage: string;
    rules: string[];
    onFail: "warn" | "block" | "escalate";
    }
  - context: PolicyContext

  #### Returns PolicyDecision

  - Defined in packages/nexus-agents/src/pipeline/policy-engine.ts:46

### registerRule

- registerRule(rule: PolicyRule): void

  #### Parameters

  - rule: PolicyRule

  #### Returns void

  - Defined in packages/nexus-agents/src/pipeline/policy-engine.ts:47

### listRules

- listRules(): readonly PolicyRule[]

  #### Returns readonly PolicyRule[]

  - Defined in packages/nexus-agents/src/pipeline/policy-engine.ts:48