Certified Repair of LLM-Drafted Legal Text with Context-Gated Graph Transformation Rules
Generative language models now draft consent notices and privacy policies, yet an autoregressive model has no representation of the obligations a statute imposes, and behavioural alignment certifies no individual output. Recent neuro-symbolic systems add a symbolic layer but remain diagnostic: they decide compliance and defer repair, and they depend on hand-authored rule bases whose maintenance is the acknowledged scaling bottleneck. We recast compliance as a transformation problem. Generated text is parsed into a typed Semantic Legal Graph and repaired by Context-Parameterized Graph Transformation Rules (CP-GTR), Double-Pushout rules gated by a predicate over the reader's age and jurisdiction. Rules are synthesized from statute by a language model and admitted only if a globally stratified measure establishes termination and all critical pairs are strongly joinable under their negative application conditions, so the admitted rule set has a unique normal form. With LegiSafe-Bench we measure the pipeline end to end over 540 documents, six arms and three jurisdictions (Fleiss' kappa = 0.820). The repair-typing check proves essential: without it, all twelve deployment hosts diverge. Among the arms that edit or regenerate the draft, only repair with the expert-reviewed, context-gated library adds no unwarranted requirement, against 22 for the unreviewed library, while whole-document compliance stays at the level of the draft, where a critique-and-revise baseline that regenerates the text scores higher. An independent legal expert judged 6 of 31 certified rules fully supported by their cited provisions, establishing statutory fidelity as a property complementary to certification. To our knowledge, this is the first certified synthesis-to-deployment pipeline for legal text repair to be measured end to end, and it lays a foundation and a reference point for this line of research.
Authors
- Abdullah M. Alshanqiti (ORCID: https://orcid.org/0000-0002-6080-5236)
Institutions
- Islamic University of Madinah (SA)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-10-30
- DOI
- https://doi.org/10.5281/zenodo.23804004
- Primary Topic
- Artificial Intelligence in Law
- Type
- preprint