Skip to content

parsePolicies()

PromptScript API


parsePolicies(input, context?): ParsedPolicies

Defined in: validator/src/policy/parser.ts:674

Parse and validate policy definitions from config.

Validates all policies and collects errors without stopping at the first failure. Successfully validated policies are returned alongside any errors. An unknown kind is an error, so a policy this version cannot evaluate never passes silently. Prompt kinds also reject unknown keys, and check roles, environments, models and, when governance.dataClasses is set, data classes against context.

Parameters

input

unknown

Raw policies value from config: a list, or undefined or null for none

context?

PolicyContext = {}

Governance, release and model settings of the project

Returns

ParsedPolicies

Parsed policies and any validation errors