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, therun_test_casesfunction usessubprocess.runto 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.pywrites extracted code blocks to a temporary file (completion.py) and then executes them via a subprocess usingrunpy.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-generatedcompletionsduring the training loop inGRPOTrainer. - 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 viasubprocess.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.pyloads theopenai/gsm8kdataset and theQwen/Qwen2.5-1.5B-Instructmodel from Hugging Face.
Audit Metadata