P248 — AIEP — Governance Policy Execution Compiler
Applicant: Neil Grassby Classification: Patent Application — Confidential Priority: Claims priority from GB2519711.2 filed 20 November 2025 Architecture Layer: AIEP Phase 2 Governance Execution Layer
Framework Context
[0001] This specification operates within an AIEP environment as defined in GB2519711.2 and GB2519798.9. The present specification defines a governance policy compiler that transforms authored governance policy documents (GPL schema, P228) into efficient executable evaluation representations optimised for low-latency decision evaluation in the Governance-Bound Reasoning Enclave (P242).
Field of the Invention
[0002] The present invention relates to policy compilation systems for governance policy execution in evidence-bound AI.
Background
[0003] Governance policy documents authored in the GPL schema (P228) are human-readable structured documents. Evaluating these documents at decision time requires parsing, rule indexing, and predicate evaluation. Compilation of policy documents into an executable representation (bytecode, decision tree, or indexed rule set) reduces decision latency significantly and is particularly important for enclave execution (P242) where code footprint and execution time are constrained.
Summary of the Invention
[0004] The invention provides a Governance Policy Execution Compiler (GPEC) that: parses an input governance policy document (GPL schema); validates the document for completeness and internal consistency; transforms the action rules into an indexed decision structure; compiles safety predicates into evaluable expression trees; and produces a compiled governance policy package, including a canonical hash commitment, that can be loaded into the governance enclave (P242) for execution.
[0005] The compiled policy package is deterministic: the same input document always produces the same compiled output. The package is verified against the source document hash before loading into the enclave.
ASCII Architecture
GPL Policy Document (P228)
|
v
+------------------------------------------+
| Governance Policy Execution Compiler |
| (GPEC) |
| |
| Parse + validate |
| Rule indexing (by action type) |
| Predicate expression compilation |
| Parameter bound table construction |
| Compiled package assembly |
| Package hash commitment |
+-------------------+----------------------+
|
v
Compiled Governance Policy Package
→ Load into GB Reasoning Enclave (P242)
Detailed Description
[0005] Parsing and Validation. The compiler front-end parses the GPL document and validates: mandatory fields are present; action type patterns are well-formed; predicate expressions are syntactically valid; parameter bounds are self-consistent; emergency override policy references valid authoriser identities.
[0006] Rule Indexing. Action rules are indexed by action type pattern in a trie or hash map, enabling O(1) rule lookup for a given action type during evaluation.
[0007] Predicate Compilation. Safety predicate expressions are compiled into abstract syntax trees with pre-computed evaluation order. Conjunctive predicates are ordered by expected evaluation cost (cheapest first) to enable short-circuit evaluation.
[0008] Package Hash. The compiled package hash is computed as SHA-256(compiled_bytecode || source_policy_hash). This binds the compiled package to the source document and enables enclave verification of correct compilation.
Technical Effect
[0009] The invention provides deterministic, verifiable compilation of governance policy documents into enclave-executable representations, eliminating the ambiguity and performance overhead of runtime interpretation. By computing a package hash binding compiled bytecode to source policy hash, the compiler enables loading-time verification that a compiled package was correctly compiled from a specific source document, preventing unauthorised policy substitution. O(1) action-type indexed lookup and short-circuit predicate evaluation reduce governance enforcement latency on the critical reasoning path.
Claims
-
A method of compiling and loading a governance policy document for execution in an evidence-bound artificial intelligence governance enclave, comprising the steps of: (a) parsing the GPL policy document and validating: presence of all mandatory fields; syntactic well-formedness of action type patterns; validity of predicate expressions; self-consistency of parameter bounds; and validity of authoriser identity references in the emergency override section; (b) indexing validated action rules by action type pattern in a trie or hashmap structure enabling O(1) rule lookup for a given action type during enclave evaluation; (c) compiling safety predicate expressions into abstract syntax trees with conjunctive sub-expressions ordered by ascending evaluation cost to enable short-circuit evaluation; (d) computing a package hash as SHA-256(compiled_bytecode || source_policy_hash) binding the compiled package to its source document; (e) loading the compiled package into the governance execution enclave after verifying the package hash matches the expected value derived from the source policy document.
-
The method of claim 1, wherein compilation is deterministic such that compiling the same source document always produces bit-identical compiled bytecode and thus the same package hash.
-
The method of claim 1, wherein the package hash is recorded in the AIEP attestation record produced by the Federated Trust Attestation Hardware Path during attestation.
-
The method of claim 1, wherein validation errors at step (a) produce structured error records identifying the failing field and line reference, with compilation aborted on any validation error.
-
The method of claim 1, wherein compiled packages are versioned with a monotonically increasing version counter, and the active version is recorded in the governance enclave state.
-
A governance policy execution compiler for an evidence-bound artificial intelligence system, comprising: a parser and validator for GPL policy documents; a rule indexer constructing O(1) action-type lookup structures; a predicate compiler generating short-circuit-ordered ASTs; a package hash computer; and an enclave loader verifying the package hash before policy activation.
-
A computer-readable medium carrying instructions for implementing the method of any preceding method claim.
Abstract
A governance policy execution compiler for evidence-bound artificial intelligence transforms GPL schema policy documents into enclave-executable compiled packages through parsing and validation, action-type-indexed rule trie or hashmap construction, and AST-based predicate compilation with short-circuit evaluation ordering. A package hash computed as SHA-256(compiled_bytecode || source_policy_hash) cryptographically binds each compiled package to its source document. Compiled packages are loaded into the governance execution enclave only after package hash verification, preventing unauthorised policy substitution.