# Function checkPipelinePolicy

- checkPipelinePolicy(
  task: {
  id: string;
  description: string;
  status:
  | "failed"
  | "planning"
  | "executing"
  | "approved"
  | "done"
  | "intake"
  | "clarifying"
  | "validating";
  analysis: { complexity: string; taskType: string; ambiguityScore: number };
  constraints: { time?: string; quality?: string; scope: string[] };
  requiredCapabilities: { tools: string[]; experts: string[] };
  capabilityGaps: {
  available: { tools: string[]; experts: string[] };
  gaps: unknown[];
  allSatisfied: boolean;
  };
  parentId?: string;
  artifacts: {
  id: string;
  type: | "code"
  | "plan"
  | "analysis"
  | "review"
  | "test"
  | "spec"
  | "report"
  | "vote";
  }[];
  metadata: Record<string, unknown>;
  createdAt: number;
  updatedAt: number;
  completedAt?: number;
  error?: string;
  },
  stageType: string,
  ): PolicyEvalResult

  Evaluates pipeline policy before execution. Builds PolicyContext from TaskContract metadata and stage type. Uses the default PolicyEngine with 5 built-in rules.

  #### Parameters

  - task: {
    id: string;
    description: string;
    status:
    | "failed"
    | "planning"
    | "executing"
    | "approved"
    | "done"
    | "intake"
    | "clarifying"
    | "validating";
    analysis: { complexity: string; taskType: string; ambiguityScore: number };
    constraints: { time?: string; quality?: string; scope: string[] };
    requiredCapabilities: { tools: string[]; experts: string[] };
    capabilityGaps: {
    available: { tools: string[]; experts: string[] };
    gaps: unknown[];
    allSatisfied: boolean;
    };
    parentId?: string;
    artifacts: {
    id: string;
    type: | "code"
    | "plan"
    | "analysis"
    | "review"
    | "test"
    | "spec"
    | "report"
    | "vote";
    }[];
    metadata: Record<string, unknown>;
    createdAt: number;
    updatedAt: number;
    completedAt?: number;
    error?: string;
    }
  - stageType: string

  #### Returns PolicyEvalResult

  - Defined in packages/nexus-agents/src/pipeline/v2-delegate.ts:140