Hyperproperty-Constrained Secure Reinforcement Learning

Ernest Bonnah, Luan Viet Nguyen, Khaza Anuarul Hoque · DOI

Abstract

Hyperproperties for Time Window Temporal Logic (HyperTWTL) is a domain-specific formal specification language known for its effectiveness in compactly representing security, opacity, and concurrency properties for robotics applications. This paper focuses on HyperTWTL-constrained secure reinforcement learning (SecRL). Although temporal logic-constrained safe reinforcement learning (SRL) is an evolving research problem with several existing literature, there is a significant research gap in exploring security-aware reinforcement learning (RL) using hyperproperties. Given the dynamics of an agent as a Markov Decision Process (MDP) and opacity/security constraints formalized as HyperTWTL, we propose an approach for learning security-aware optimal policies using dynamic Boltzmann softmax RL while satisfying the HyperTWTL constraints. The effectiveness and scalability of our proposed approach are demonstrated using a pick-up and delivery robotic mission case study. We also compare our results with two other baseline RL algorithms, showing that our proposed method outperforms them.

Introduction

In autonomous robotics, Safe Reinforcement Learning (SRL) typically focuses on "trace-based" safety—ensuring a single execution of a task avoids obstacles. However, security and privacy properties, such as opacity (hiding a secret) or non-interference, are hyperproperties. These require comparing multiple execution traces to ensure an observer cannot deduce sensitive information. Standard temporal logics like LTL or STL struggle to express these multi-trace relationships compactly. This research addresses the challenge of training an RL agent to maximize rewards while strictly adhering to complex, multi-trace security constraints defined via HyperTWTL.

Methodology

The proposed framework bridges formal logic and reinforcement learning through a multi-stage pipeline:

  1. Specification with HyperTWTL: The logic is designed to be more compact than alternatives like HyperMTL, requiring fewer operators for timing and security constraints.
  2. Automata and Product MDPs: The HyperTWTL formula is converted into a Deterministic Finite Automaton (DFA), which is then combined with the environment's Markov Decision Process (MDP) to create a Product MDP. To account for mission deadlines, this is further transformed into a Timed MDP.
  3. Action Pruning: To ensure security, the system calculates the probability of violating constraints from any state. Actions that make it mathematically impossible to satisfy the security formula within the time limit are "pruned" from the agent's action space.
  4. Dynamic Boltzmann Softmax RL: The agent learns using a "Softmax-$ε$" approach, combining the exploration benefits of $ε$-greedy strategies with the smooth convergence of Boltzmann distribution-based action selection.

Experimental Setup

The approach was evaluated using a Pick-up and Delivery Robotic Mission simulation. The environment consists of grid worlds (starting at $8 \times 8$) containing initial states, pick-up locations ($p_1, p_2$), delivery zones ($d_1, d_2$), obstacles, and reward regions.

Figure 1: The 8x8 grid world environment used for the pick-up and delivery mission case study.

Tasks included opacity-aware specifications (hiding delivery routes) and side-channel attack countermeasures (ensuring consistent timing to prevent information leaks).

Key Results

The proposed Softmax-$ε$ method was compared against standard Q-learning and Dyna-Q baselines across various mission sets.

  • Sample Efficiency: The Softmax-$ε$ method consistently reached higher average rewards faster than the baselines.
  • Guaranteed Security: The pruning mechanism ensured the agent satisfied security requirements with a probability $\geq 0.85$ throughout the learning process, preventing the occasional violations common in standard RL exploration.
  • Scalability: The system demonstrated linear scalability, successfully finding solutions for grids up to $100 \times 100$ in approximately two hours.
Figure 4: Comparison of average rewards across different mission sets (a-d) for Softmax-epsilon, Dyna-Q, and Q-Learning, including the simulation parameters.

Conclusion and Future Work

This framework successfully integrates hyperproperties into RL, ensuring that agents are not just safe, but secure. Current limitations include a focus on the "alternation-free" fragment of HyperTWTL and synchronous trace assumptions. Future work will extend the framework to handle $k$-alternation and asynchronous fragments to cover more complex, real-world security scenarios.

Summary updated

BibTeX
@inproceedings{bonnah2025hyperproperty,
  author = {Ernest Bonnah and Luan Viet Nguyen and Khaza Anuarul Hoque},
  title = {{Hyperproperty-Constrained Secure Reinforcement Learning}},
  booktitle = {Memocode},
  year = {2025},
  doi = {10.1145/3742875.3754687},
}
Figure