Papers
Topics
Authors
Recent
2000 character limit reached

AgentODRL: NL to ODRL Automation

Updated 6 December 2025
  • AgentODRL is a multi-agent system that converts free-text data usage policies into structured, enforceable ODRL, ensuring both syntactic precision and semantic fidelity.
  • It employs an orchestrator-workers architecture that decomposes complex policy descriptions and iteratively validates translations using SHACL-based syntax correction and semantic reflection.
  • The framework integrates a dynamic enforcement component (ODRE) that evaluates and executes ODRL policies in real-world data-sharing ecosystems with fast, context-aware rule evaluation.

AgentODRL is a multi-agent system enabling the automated, high-fidelity translation and enforcement of data usage policies from natural language to the Open Digital Rights Language (ODRL), as well as the practical evaluation and execution of ODRL-based rulesets in data-sharing ecosystems. Two research lines converge under the AgentODRL designation: (1) a LLM-driven orchestrator-workers architecture for translating complex, free-text policy descriptions into structured ODRL, and (2) an enforcement component responsible for evaluating, transforming, and executing ODRL policies in real-world application contexts. These innovations address both the syntactic and semantic precision of policy encoding, and the transformation of ODRL from a purely descriptive ontology into a mechanism for enforceable usage control (Zhong et al., 29 Nov 2025, Cimmino et al., 26 Sep 2024).

1. Motivation and Problem Space

ODRL v2.2 is the W3C standard ontology for expressing fine-grained permissions, prohibitions, and duties over digital assets. Key requirements for practical adoption include machine-precise encoding of policy intent and operational enforceability. The translation of natural language (NL) policy statements to ODRL is impeded by the logical complexity of the ODRL model (nested RDF graphs, recursive and parallel clause structures, constraints, profiles) and the lack of a substantial corpus of parallel NL–ODRL data. Existing approaches, including monolithic LLM-based pipelines with ontology-guidance or self-correction enhancements, fail to resolve cross-clause dependencies, segment policies with parallel semantics, or guarantee strict SHACL-based syntax adherence. As a result, these solutions are prone to incomplete or invalid ODRL code, particularly for complex policy use cases (Zhong et al., 29 Nov 2025).

Simultaneously, even hand-crafted ODRL policies lack an integrated mechanism for dynamic policy enforcement. The ODRE component addresses this by extending ODRL with an evaluation and execution engine, facilitating the reduction of template-based and parameterized ODRL policies to enforceable, context-aware decisions (Cimmino et al., 26 Sep 2024).

2. AgentODRL Translation System Architecture

AgentODRL implements an Orchestrator-Workers paradigm to decompose and manage the translation of natural language rules into ODRL policies. Specialized worker agents are coordinated dynamically:

  • Orchestrator Agent: Classifies incoming use cases by complexity (Simple, Parallel, Recursive) and assembles an execution plan.
  • Rewriter Agent: Resolves recursive references in NL text, inlining cross-linked clauses via structure-preserving inlining.
  • Splitter Agent (Decomposer): Segments NL text into independent policy units by detecting semantic shifts in assets, parties, or policy purposes; assigns appropriate ODRL types (Agreement, Offer, Set).
  • Generator Agent: Produces initial ODRL JSON-LD representations from structured, atomic policy inputs, performing post-generation corrections via syntax and semantic loops.

A simplified representation of workflow logic is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def AgentODRL_Main(use_case_text):
    complexity = Orchestrator.classify(use_case_text)
    if complexity == "Recursive":
        text1 = Rewriter.inline(use_case_text)
        units = Splitter.segment(text1)
    elif complexity == "Parallel":
        units = Splitter.segment(use_case_text)
    else:
        units = [use_case_text]
    odrl_policies = []
    for unit in units:
        p0 = Generator.generate(unit)
        p1 = SyntaxCorrector.loop_validate(p0)
        p_final = SemanticReflect.loop_reflect(p1, unit)
        odrl_policies.append(p_final)
    return combine_policies(odrl_policies)

The SyntaxCorrector loop applies SHACL-based validation (up to 8 iterations), feeding error graphs back to the LLM for correction. The SemanticReflect loop utilizes atomic semantic checkpoints—extracted using a LoRA-finetuned expert—to re-prompt the LLM, ensuring every policy unit specified in the NL source is faithfully encoded (Zhong et al., 29 Nov 2025).

3. Validator and Semantic Reflection Enhancements

Two central innovations enhance ODRL generation:

  • Validator-Based Syntax Correction: The candidate ODRL policy graph GG is validated against a SHACL constraint set S={c1,…,cM}\mathcal{S} = \{c_1,\ldots,c_M\}, capturing all shapes derived from the ODRL ontology. The loop iteratively prompts the LLM to revise the policy until all syntax errors (reported as E={e1,...,eN}E = \{e_1, ..., e_N\}) are eliminated or a maximum number of iterations is reached. Grammar compliance is measured as Grammar Score=(1−∣E∣/M)×100\text{Grammar Score} = (1 - |E| / M) \times 100.
  • LoRA-Finetuned Semantic Reflection: A Qwen3-4B-Instruct model, further finetuned with LoRA (rank r=16r=16, scaling α=32\alpha=32) is trained to extract semantic checkpoints SC(u)={s1,…,sL}\text{SC}(u) = \{s_1,\ldots,s_L\} from each use case. These atomic semantic units encompass parties, assets, actions, and constraints. The reflection loop prompts the Generator LLM to revise the policy until all checkpoints are represented, with semantic agreement scored via multi-annotator voting:

Scoresemantic=1L∑i=1L(1K∑j=1KSij)×100\mathrm{Score}_{\mathrm{semantic}} = \frac{1}{L} \sum_{i=1}^L \left(\frac{1}{K} \sum_{j=1}^K S_{ij}\right) \times 100

where SijS_{ij} is the [0,1][0,1] score assigned by juror jj to semantic unit ii (Zhong et al., 29 Nov 2025).

4. Dataset Construction and Evaluation Methods

A 770-case dataset was constructed, covering:

  • 440 simple cases (single, flat rules)
  • 220 parallel cases (multiple units sharing context)
  • 110 recursive cases (cross-clause dependencies)

Seeded by 70 human-crafted examples (standards, GDPR/CCPA, contracts), the dataset was augmented via LLM generation (Gemini 2.5 Pro), enforcing logic preservation and contextual variation, then manually reviewed for validity. Evaluation uses strict grammar and semantic metrics as described above—measuring both adherence to SHACL constraints and completeness of intent coverage (Zhong et al., 29 Nov 2025).

5. Experimental Results

Comparative results across GPT-4.1-based baselines and AgentODRL’s full pipeline demonstrate sharp improvements in both grammar and semantic score, particularly on complex cases:

Strategy Grammar (%) Semantic (%)
OGS (Ontology-Guided) 82.07 89.59
SCR-Enhanced 93.08 92.00
Semantic-Enhanced (LoRA) 93.47 97.78
AOFP (AgentODRL Pipeline) 99.89 97.93

On recursive use cases, AOFP achieves 99.86% grammar and 96.40% semantic, compared with 96.32% and 78.97% for SCR-Enhanced, respectively. Ablation studies confirm that decomposition (Splitter, Rewriter) stages yield significant semantic improvements, particularly on parallel and recursive cases. AgentODRL demonstrates consistent grammar >99% across structural complexities (simple, parallel, recursive), maintaining high semantic fidelity with minimal drop even on challenging examples (Zhong et al., 29 Nov 2025).

6. Enforcement and Application: ODRE Integration

The AgentODRL enforcement component, as detailed under the ODRE framework, operationalizes ODRL policies by evaluating them against request contexts and executable function registries. The formal model defines a policy PP as a collection of rules r=⟨id,kind,target,action,{cj}⟩r = \langle\text{id}, \text{kind}, \text{target}, \text{action}, \{c_j\}\rangle, with constraints c=(oL,op,oR)c = (o_L, op, o_R). The enforcement algorithm reduces the policy (handling templates, dynamic data, and coded functions) to an A-level, fully grounded policy graph, then iteratively extracts and evaluates each action and constraint pair.

Both Python (pyodre) and Java (odre-java) implementations enable dynamic instantiation of constraint functions (e.g., geospatial checks), policy execution via HTTP proxies or local data calls, and extensibility through ontology and function registry mechanisms. Performance evaluations show per-policy enforcement times of 8–28 ms, with Java/SPARQL integration typically ~20–30% faster due to pre-compilation strategies (Cimmino et al., 26 Sep 2024).

7. Limitations, Applicability, and Future Directions

AgentODRL, while establishing a new benchmark for NL-to-ODRL policy generation and enforcement, remains subject to limitations. These include LLM hallucinations in handling rare or novel constraint profiles, dependency on up-to-date SHACL/ODRL ontology definitions, and potential residual semantic errors in edge cases. Proposed future directions involve incorporating multi-juror, human-in-the-loop reflection for further semantic assurance, and extending the architecture to support other policy languages (e.g., XACML, EPAL) via prompt engineering.

AgentODRL and its enforcement stack have targeted applicability in automated policy authoring for data spaces (IDS, GAIA-X), integration with data governance platforms for real-time validation, and as a foundation for multimodal rights management that spans natural language, code, and formal models (Zhong et al., 29 Nov 2025, Cimmino et al., 26 Sep 2024).

Whiteboard

Follow Topic

Get notified by email when new papers are published related to AgentODRL.