Task-Conditioned Least-Privilege Learning for Executable Terminal and MCP Agents

TL;DR

Task-conditioned least-privilege framework reduces excess permissions to 0.79%, boosting safe success to 98.48% on 1500 tasks.

cs.CR πŸ”΄ Advanced 2026-08-19 67 views
Alexander Tu Michael Tu
AI safety permission gating reinforcement learning large language models tool use

Key Findings

Methodology

This paper introduces a post-training reinforcement learning framework that employs a six-dimensional risk vector to evaluate each action before and after execution. Using deterministic verifiers, actions are scored on completion, evidence, exact state, prohibited attempts, and safe success. The model is trained with Qwen3.5-4B, integrating LoRA and Dr. GRPO algorithms, on 1500 tasks. The framework dynamically adjusts super-privilege values based on task-specific permission envelopes, optimizing for safety and task success. The training process emphasizes minimizing excess privilege while maintaining high task completion rates, validated through internal and external benchmarks, achieving 98.48% safe success and reducing over-privilege events from 4.56% to 0.79%.

Key Results

  • On 896 evaluation episodes across 500 unseen tasks, the trained model achieved 98.48% safe success, a substantial increase over the baseline 64.36%, with super-privilege errors dropping from 4.56% to 0.79%.
  • External benchmarks such as MetaTool and FORTIS confirmed the model's ability to select tools accurately and reduce over-privilege, with MetaTool accuracy rising to 83.6% and over-privilege rate dropping to 40.72%.
  • A continuation study with 400 new tasks demonstrated the model's strong generalization, reducing excess-privilege events by 6.99 percentage points while maintaining previous capabilities.

Significance

This work advances AI safety by providing a scalable, task-aware permission management method that significantly reduces security risks associated with over-privileged actions. It addresses the limitations of static permission gating, offering a dynamic, risk-aware approach that can adapt to complex environments. The framework enhances the deployment safety of tool-using large language models in sensitive domains like finance, healthcare, and security, where minimizing unintended actions is critical. By integrating deterministic auditing and task-specific permission envelopes, it paves the way for more reliable and controllable AI systems, fostering broader trust and safer AI integration into real-world applications.

Technical Contribution

The paper's main technical innovation lies in combining a six-dimensional risk vector with deterministic verification to evaluate actions dynamically, enabling precise super-privilege adjustments. It introduces a novel reward function that penalizes excess privileges based on task-specific permission envelopes, integrated into a reinforcement learning pipeline using Dr. GRPO and LoRA. The approach effectively balances task success and safety, outperforming prior static gating and skill boundary methods. This framework provides a generalizable, scalable solution for permission management in complex, multi-step environments, with demonstrated improvements in safety metrics across diverse tasks and benchmarks.

Novelty

This is the first work to incorporate a comprehensive six-dimensional risk assessment into post-training reinforcement learning for large language models, dynamically optimizing permissions based on task context. Unlike prior static gating or skill boundary methods, this approach learns to minimize over-privilege during task execution, significantly reducing security risks. Its integration of deterministic verification with task-specific permission envelopes offers a novel, scalable paradigm for AI safety, setting a new standard beyond existing permission inference or static sandboxing techniques.

Limitations

  • The framework relies on predefined permission envelopes and risk metrics, which may not fully capture all real-world scenarios, especially in highly unpredictable environments. Its effectiveness depends on the quality of risk definitions and verifier accuracy.
  • Training costs are substantial, requiring significant computational resources, especially for large models and extensive task sets, limiting immediate scalability.
  • Despite significant reductions, residual over-privilege events still occur, indicating the need for additional hardware-level or formal verification safeguards to ensure comprehensive security.

Future Work

Future research will focus on adaptive, self-supervised adjustment of permission envelopes to better handle unseen or evolving environments. Integrating multi-modal data and hardware-based security measures can further enhance safety. Extending the framework to multi-agent systems and real-time permission adjustments in dynamic settings is also promising. Additionally, efforts to reduce training costs and improve interpretability of permission decisions will facilitate broader adoption and deployment in critical sectors.

AI Executive Summary

The rapid deployment of large language models in tool-using applications has raised significant safety concerns, particularly regarding over-privileged actions that can lead to security breaches or unintended consequences. Traditional static permission gating methods, while useful, often fall short in complex, dynamic environments where actions depend heavily on context and observed effects. Addressing this challenge, the authors propose a novel task-conditioned least-privilege learning framework that integrates reinforcement learning with multi-dimensional risk assessment.

This framework employs a six-dimensional risk vector to evaluate each action both before and after execution, using deterministic verifiers to score completion, evidence, exact state, prohibited attempts, and safe success. These scores inform a dynamic adjustment of super-privilege values, constrained within task-specific permission envelopes. The model, trained with the Qwen3.5-4B architecture, leverages LoRA and Dr. GRPO algorithms, optimizing permissions to minimize excess privilege while maintaining high task success rates.

Experimental results demonstrate remarkable improvements: on 896 evaluation episodes across 500 unseen tasks, the trained model achieves 98.48% safe success, with super-privilege errors reduced from 4.56% to 0.79%. External benchmarks like MetaTool and FORTIS confirm the model's ability to select tools accurately and control over-privilege, with performance gains of 1.7 and 2% respectively. A continuation study with 400 new tasks further validates the model's generalization, reducing excess-privilege events by nearly 7 percentage points.

This research significantly advances AI safety by providing a scalable, task-aware permission control mechanism that dynamically adapts to environment and task demands. It addresses the limitations of static gating, offering a more flexible, risk-sensitive approach that enhances deployment safety in sensitive sectors such as healthcare, finance, and security. While promising, the framework still relies on predefined risk metrics and requires substantial computational resources, highlighting avenues for future refinement. Overall, this work lays a solid foundation for safer, more controllable AI systems capable of operating securely in complex real-world scenarios.

Deep Dive

Abstract

Tool-using large language-model agents can complete a task while exercising authority that the user did not grant or the task does not need, causing excess-authority errors. Traditional permission gating systems alone for validating agent environments are insufficient. We study whether post-training can teach a 4B-parameter model to choose task-conditioned authority in executable terminal and Model Context Protocol (MCP) environments to complement those measures. We propose a framework where each action is audited before execution and again from observed effects along six dimensions of risk. This auditing is conducted using deterministic verifiers that score completion, evidence, exact state, prohibited attempts, and safe success. In conjunction with predefined task-specific sufficient-authority envelopes, we determine task-specific excess privilege values for trajectories, which are then optimized for in post-training. We find that after training using this framework on Qwen3.5-4B over 1,500 tasks, the selected seed reaches 98.48% safe success across 2,896 evaluation episodes spanning all 500 held-out tasks, compared with 64.36% for the base policy, and reduces excess-authority error events from 4.56% to 0.79%. Furthermore, external tests show capability retention and prompt-directed improvement. A 400 task continuation study also found evidence of generalization, reducing excess-authority events by 6.99 percentage points while maintaining previous capabilities. We conclude learned restraint through least-privilege aware post-training is therefore useful as an additional control layer for tool-using agents in executable terminal and MCP environments, but it does not replace permission gates and sandboxing.

cs.CR cs.AI cs.LG eess.SY