grpo-rl-training

Pass

Audited by Gen Agent Trust Hub on Nov 8, 2026

Risk Level: SAFECOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTIONEXTERNAL_DOWNLOADS
Full Analysis
  • [COMMAND_EXECUTION]: The library of reward functions contains code designed to execute model-generated scripts to verify their correctness.
  • Evidence: In examples/reward_functions_library.py, the run_test_cases function uses subprocess.run to execute Python code extracted from model completions.
  • Impact: This allows the execution of arbitrary code produced by the model being trained. While the implementation uses sys.executable -I (isolated mode), it does not provide a full security sandbox.
  • [DYNAMIC_EXECUTION]: The skill generates and executes scripts at runtime as part of the reward evaluation loop.
  • Evidence: examples/reward_functions_library.py writes extracted code blocks to a temporary file (completion.py) and then executes them via a subprocess using runpy.run_path.
  • [INDIRECT_PROMPT_INJECTION]: The skill possesses a significant attack surface for indirect prompt injection because it processes and executes untrusted data generated by the LLM.
  • Ingestion points: Data enters the system via datasets.load_dataset (e.g., GSM8K) and through model-generated completions during the training loop in GRPOTrainer.
  • Boundary markers: The skill uses XML-like tags (<reasoning>, <answer>) and markdown code blocks (```python) to delimit different parts of the model output.
  • Capability inventory: The skill has the capability to write files to the local system (trainer.save_model) and execute shell commands via subprocess.run (to score code completions).
  • Sanitization: Content is extracted using regular expressions (e.g., extract_code_block), but the extracted content is executed without further validation or sandboxing beyond process isolation.
  • [EXTERNAL_DOWNLOADS]: The training templates and instructions facilitate the download of datasets and pre-trained models from public repositories.
  • Evidence: templates/basic_grpo_training.py loads the openai/gsm8k dataset and the Qwen/Qwen2.5-1.5B-Instruct model from Hugging Face.
Audit Metadata
Risk Level
SAFE
Analyzed
Nov 8, 2026, 02:06 AM