This is the official repository for Remotely Detectable Robot Policy Watermarking.
Requirements: This repository requires Python 3.10.12 and all dependencies listed in requirements.txt.
This repository already contains pre-trained policies for the environments used in the paper. Thus, this section explains how to load these base policies and watermark them. To train your own policy, see Section 2.
The watermark_policy.py script is the core tool for evaluating watermarking strategies.
It uses Hydra for configuration management, with corresponding configuration files in config_watermark_policy/ (detailed in Section 1.2).
To run the script with default parameters (which performs 10 replications of CoNoCo on VMAS Navigation):
python3 watermark_policy.py
This would do the following:
- Loads the model specified by the
model_folderargument (e.g.,models/navigation/). This loads both the policy and the environment it was trained on. - Builds the watermarking strategy specified by the
watermarkargument (e.g.,conoco). This uses the corresponding definition in thewatermarking_strategies/folder. - For each requested glimpse modality (specified by
ground_truth_actions_glimpses,onboard_sensors_glimpses, andremote_camera_feed_glimpsesarguments), performs the analyses requested by the different analysis arguments (see Section 1.3 for details).
The main configuration file for watermark_policy.py is located at config_watermark_policy/config.yaml, which references two sub-configurations: the glimpse config in config_watermark_policy/glimpses/ and the watermark config in config_watermark_policy/watermark/.
Currently, there is only one glimpse configuration file: config_watermark_policy/glimpses/glimpses.yaml. However, there is one watermark configuration file per watermarking strategy.
Hydra automatically loads the corresponding sub-configuration based on the chosen watermarking strategy. For example, when using CoNoCo, it loads config_watermark_policy/watermark/conoco.yaml.
The main configuration file config_watermark_policy/config.yaml defines common arguments such as model_folder (specifying where to load the policy from), ground_truth_actions_glimpses, onboard_sensors_glimpses, and remote_camera_feed_glimpses. It also defines per-analysis arguments (see Section 1.3).
Each watermark configuration in config_watermark_policy/watermark/ defines one mandatory argument name (the name of the watermarking strategy) and multiple strategy-specific arguments within an args section.
watermark_policy.py currently implements the following analyses.
Each analysis runs for all requested glimpse modalities, specified in the configuration by the ground_truth_actions_glimpses, onboard_sensors_glimpses, and remote_camera_feed_glimpses arguments:
analysis_episodes: Main analysis. Performsanalysis_episodes.num_replicationsindependent policy episodes, each of lengthanalysis_episodes.length, both with and without watermarking. Records detectability, final return, and other metrics.analysis_length: Studies the impact of evaluation length on watermarking performance.analysis_sensitivity: Studies the impact of a given parameter on watermarking performance.analysis_glimpses: Studies the impact of glimpse parameters on watermarking performance.
The plot_watermark_policy.py script is a plotting tool that aggregates and compares results from multiple runs of watermark_policy.py. It recursively searches for all results in the outputs folder, automatically detects parameter discrepancies, and generates comparison plots.
This section provides instructions for training a base policy. Note that this does not include any watermarking and should not be needed for most use cases of this repository.
The train_policy.py script trains an RL policy using PPO on a chosen environment.
This script uses Hydra for configuration, with configuration files located in the config_train_policy/ folder.
It can run PPO on any environment defined in this repository, using the default implementation from TorchRL.
To use a trained policy with watermark_policy.py, the outputs must be copied to the models/ directory so they can be accessed by the watermarking script.
The environments/ repository defines Environment Factories for each type of environment. These are interfaces that expose all necessary functions for watermarking.
All factories follow the structure defined in environments/base_environment_factory.py.
Most environments in this repository are not used directly from their corresponding libraries but are modified first, either to use velocity control (as in Navigation) or to adjust their delta_t parameter (as in MuJoCo environments).
An important distinction in this repository compared to other RL repositories is that multiple policies are trained within variants of the same environment that differ only in their frequencies, given by parameters:
env_frequency: how often the environment is stepped, corresponds to the glimpses frequency.policy_frequency: how often the policy is queried and the action is updated, corresponds to the policy frequency.
If you use this code, please cite:
@misc{amir2025remotelydetectablerobotpolicy,
title={Remotely Detectable Robot Policy Watermarking},
author={Michael Amir and Manon Flageat and Amanda Prorok},
year={2025},
eprint={2512.15379},
archivePrefix={arXiv},
primaryClass={cs.RO},
url={https://arxiv.org/abs/2512.15379},
}