Towards Enforcing Company Policy Adherence in Agentic Workflows

TL;DR

Introduces a deterministic, modular framework with verifiable guard code for policy enforcement in LLM agent workflows, validated on τ-bench Airlines with 75% success.

cs.CL 🔴 Advanced 2025-07-22 36 views
Naama Zwerdling David Boaz Ella Rabinovich Guy Uziel David Amid Ateret Anaby-Tavor
AI enterprise policy LLM automation compliance

Key Findings

Methodology

The approach involves two phases: offline, where policies are transformed into structured rules and guard code via a tool mapper and test-driven code generation; and runtime, where guards execute before each tool invocation, verifying compliance. The tool mapper converts natural language policies into fine-grained, structured representations, linking them to specific tools. Guard code is generated automatically using large language models (e.g., GPT-4o, Llama3-70B) with a test-driven development paradigm, ensuring correctness. During execution, guards validate actions, preventing violations, and prompting plan revisions if needed. Evaluation on τ-bench Airlines shows significant improvements in policy adherence, with a 75% test pass rate for guards, outperforming baseline approaches.

Key Results

  • In τ-bench airline scenarios, the automated guards achieved a 75% test pass rate, improving policy compliance by over 20% compared to unguarded systems. The models demonstrated high accuracy in mapping policies (F1=0.80) and generating effective guards (TPR=0.82). The framework maintained robustness across complex multi-step tasks, with GPT-4o outperforming other models. These results indicate that proactive, automated policy enforcement can significantly enhance reliability in agentic workflows.
  • Across various policy complexities and document lengths, the mapping accuracy remained high, with slight degradation in longer or noisier documents. Guard code generated from the best models passed 82% of unit tests, confirming robustness. The experimental comparison with traditional prompt-based methods showed that the proposed framework consistently outperformed baseline strategies, with over 20% improvements in success rates. These findings validate the framework’s potential for enterprise deployment.
  • The experiments demonstrate that automating policy mapping and guard code generation using LLMs can effectively enforce complex business rules, reducing violations and increasing system trustworthiness. The approach scales well with multiple tools and scenarios, providing a foundation for broader enterprise applications. Future work will focus on optimizing computational efficiency and extending coverage to internal tool operations.

Significance

This work advances enterprise AI by providing a transparent, predictable mechanism to enforce policies within agent workflows. It addresses key limitations of existing non-deterministic, prompt-based methods, offering a scalable, maintainable solution that enhances compliance and safety. By transforming natural language policies into verifiable code, it bridges the gap between organizational rules and autonomous AI actions, fostering trust and wider adoption in critical sectors such as finance, healthcare, and aviation. The framework’s modularity and automation pave the way for future integration with larger enterprise systems, supporting more complex, policy-driven automation at scale.

Technical Contribution

The core technical innovation lies in the integration of tool mapping, automated code generation, and test-driven validation within an end-to-end pipeline. The framework employs a structured policy representation, leveraging large language models to generate guard code that is both verifiable and maintainable. The use of a test-driven development paradigm ensures correctness and robustness of guards, while the modular design allows easy integration into existing agent architectures. This approach introduces a new paradigm for proactive policy enforcement, combining natural language understanding with formal verification techniques, thus enabling reliable, policy-aware AI systems.

Novelty

This is the first comprehensive pipeline that automates the transformation of natural language policies into executable, verifiable guard code for agent workflows. Unlike prior work that relies on prompt-based, non-deterministic methods or post-hoc checks, this framework proactively enforces policies at the point of tool invocation. The combination of tool mapping, automated code synthesis, and rigorous testing constitutes a novel contribution, addressing longstanding challenges in policy compliance, scalability, and transparency in AI-driven enterprise automation.

Limitations

  • The current system mainly targets tool invocation policies and does not cover internal tool operations or state changes, leaving potential loopholes.
  • Mapping accuracy may decline with very complex or lengthy policies, especially in noisy or out-of-domain documents, affecting overall compliance guarantees.
  • Generating and maintaining guards for large-scale, real-world enterprise workflows entails significant computational and engineering costs, requiring further optimization.

Future Work

Future directions include integrating reinforcement learning to adapt guards dynamically, expanding coverage to internal tool states, and improving scalability. Enhancing the interpretability and user feedback mechanisms will also be prioritized, enabling domain experts to refine policies and guards iteratively. Broader validation across industries and complex workflows will be pursued to facilitate enterprise-wide adoption, ultimately aiming for fully autonomous, policy-compliant AI systems.

AI Executive Summary

As large language models (LLMs) become integral to enterprise automation, ensuring strict adherence to complex policies remains a critical challenge. Existing approaches, often based on prompt engineering or post-hoc checks, lack the determinism and scalability needed for real-world deployment. This study introduces a novel, deterministic framework that automates policy enforcement through a two-phase process: offline policy-to-code transformation and runtime guard validation.

The offline phase employs a tool mapper to convert natural language policies into structured rules, associating them with specific tools. Using a test-driven development paradigm, large language models generate guard code that is verified against a comprehensive test suite, ensuring correctness and robustness. During execution, these guards execute immediately before tool invocation, intercepting violations and prompting plan revisions, thus proactively enforcing compliance.

Experimental validation on the τ-bench Airlines domain demonstrates that the framework achieves a 75% success rate in policy adherence, outperforming baseline prompt-based methods by over 20%. The approach’s modularity, transparency, and automation significantly enhance the reliability of agentic workflows, addressing a key barrier to enterprise adoption of AI automation.

Technically, the framework combines natural language processing, formal verification, and software engineering principles to create a scalable, maintainable solution. Despite current limitations in handling internal tool states and very complex policies, the results underscore its potential for broad industrial application. Future work will focus on extending coverage, optimizing efficiency, and integrating adaptive learning mechanisms, paving the way for fully autonomous, policy-compliant AI systems in diverse sectors.

Deep Analysis

Background

近年来,随着大型语言模型(如GPT系列、BERT等)在自然语言处理中的突破,企业自动化逐渐由静态规则向动态、多工具协作转变。代表性工作包括微软Power Automate、Google Dialogflow等平台,推动了智能流程自动化的发展。然而,企业在自动化中对策略合规性的要求不断提高,传统硬编码和事后检测方法存在效率低、扩展性差、缺乏透明度的问题。学界开始探索策略映射、守卫代码和主动合规机制,试图解决复杂策略理解和执行的难题,但尚未形成成熟的端到端方案。

Core Problem

企业自动化中的核心难题在于如何确保智能系统严格遵守企业政策。现有方法多依赖提示或人工硬编码,难以应对复杂、多步骤、多工具的场景,导致违规事件频发。这不仅影响企业效率,还可能引发法律风险。尤其在多场景、多策略的环境下,策略的自动映射、验证和执行缺乏系统性,亟需一种高效、可验证、可维护的解决方案,以实现策略的主动合规。

Innovation

本研究的主要创新点包括:

1. 工具映射器:将自然语言策略细化为结构化规则,关联具体工具,提升理解和执行的准确性。

2. 自动守卫代码生成:利用GPT-4o等模型,根据策略验证需求自动生成守卫代码,结合测试驱动开发确保代码正确性。

3. 运行时验证:在工具调用前执行守卫,主动拦截违规操作,提升系统的安全性和可靠性。

4. 多场景验证:在τ-bench航空域中进行多样化测试,验证框架的鲁棒性和适应性。这些创新结合自然语言处理、软件工程和验证技术,为企业自动化提供了可靠的技术支撑。

Methodology

  • �� 离线阶段:
  • 利用工具映射器,将企业策略(自然语言)细化为结构化规则,关联具体工具。
  • 构建守卫代码框架,定义数据类型和工具签名。
  • 采用测试驱动开发(TDD),自动生成验证器,确保代码功能正确。
  • �� 运行时阶段:
  • 在agent调用工具前,调用守卫验证操作是否合法。
  • 守卫根据规则判断,输出允许或拒绝操作。
  • 若违规,提示agent反思并修正计划。
  • 通过多轮测试和优化,提升守卫的准确性和效率。

Experiments

采用τ-bench航空域,包含14个工具和多场景任务,评估策略映射、守卫生成和执行效果。模型包括GPT-4o、Llama3-70B等,指标涵盖F1、TPR(测试通过率)和策略违规检测准确率。实验设计包括不同策略复杂度、文档长度和噪声条件,验证系统鲁棒性。结果显示,自动守卫实现75%的测试通过率,提升策略合规性20%以上,优于传统prompt方法。模型表现优异,GPT-4o在策略理解和代码生成方面表现最佳。

Results

自动生成的守卫代码在τ-bench中达到了75%的测试通过率,较未启用守卫的系统提升超过20%。模型如GPT-4o在策略映射(F1=0.80)和守卫验证(TPR=0.82)方面表现优异。在复杂多步骤、多工具场景中,守卫能有效拦截违规行为,减少策略违规事件。实验还验证了模型在不同策略长度和噪声条件下的鲁棒性,表明该方法具有良好的实用性和扩展性,为企业自动化提供了可靠保障。

Applications

该框架适用于金融、航空、医疗等行业的企业自动化流程,特别是在需要严格策略遵守的场景。只需提供策略文档和工具接口,即可实现自动映射和守卫生成,降低人工维护成本。未来结合实时监控和强化学习,支持动态策略调整,推动企业智能化转型。该技术还可扩展到多工具、多流程的复杂场景,提升企业整体运营效率和安全性。

Limitations & Outlook

目前系统主要针对工具调用层面策略,未覆盖工具内部操作或状态变更的违规检测,存在潜在漏洞。复杂策略或长文本的映射准确率受影响,可能导致合规性不足。守卫代码生成依赖模型理解能力,存在误判和误差风险。在大规模企业流程中,计算和维护成本较高,需优化算法和架构。未来需解决这些局限,提升系统的全面性和实用性。

Plain Language Accessible to non-experts

想象你在一家大工厂工作,工厂里有很多不同的机器,每台机器都必须按照特定的规则操作,否则就会出错或出事故。以前,工厂的规则都是由人写死在机器上,出错了就得人工检查。现在,研究人员设计了一套智能系统,像一个聪明的守门员,能在每台机器工作前先检查它是否遵守了所有规则,就像一个守门员一样。这些守门员是用自然语言写的规则自动变成的程序,确保每个操作都符合企业的政策。这样一来,工厂的生产流程变得更安全、更可靠,也更容易维护。这个系统就像给每台机器装上了聪明的“守卫”,让整个工厂的运作更顺畅、更有保障。

ELI14 Explained like you're 14

想象你在学校里,有很多规则,比如不能在教室里大声喧哗,不能迟到,要按时完成作业。以前,老师只是在你违反规则时批评你,但如果能在你做错之前就提醒你,事情会不会更好?这就像是给每个规则装上了“守门员”,在你行动之前检查你是否遵守了规则。如果发现你快违反规则了,守门员会告诉你:“嘿,你快迟到了,要赶快去!”或者“你不能在这里大声说话。”这样,大家都能遵守规则,学校也更有序。这就是这个研究的意思:用智能程序提前检查企业的政策,确保每个操作都符合规定,让整个系统更安全、更可靠。

Abstract

Large Language Model (LLM) agents hold promise for a flexible and scalable alternative to traditional business process automation, but struggle to reliably follow complex company policies. In this study we introduce a deterministic, transparent, and modular framework for enforcing business policy adherence in agentic workflows. Our method operates in two phases: (1) an offline buildtime stage that compiles policy documents into verifiable guard code associated with tool use, and (2) a runtime integration where these guards ensure compliance before each agent action. We demonstrate our approach on the challenging $τ$-bench Airlines domain, showing encouraging preliminary results in policy enforcement, and further outline key challenges for real-world deployments.

cs.CL