azure-ai-fine-tuning

Warn

Audited by Gen Agent Trust Hub on Jun 22, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONREMOTE_CODE_EXECUTIONPROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The skill uses subprocess.run() in multiple orchestrator scripts to interact with the Azure CLI (az) and to chain execution of other Python scripts.
  • Evidence in scripts/auto_finetune.py, scripts/deploy_model.py, and scripts/chunk_and_generate.py shows the construction of command lines to fetch AAD tokens, deploy models via ARM, and launch data generation jobs.
  • In scripts/chunk_and_generate.py, arguments like --teacher and --recipe are passed directly into subprocess calls, which could be exploited if configuration artifacts are modified by an attacker.
  • [DYNAMIC_EXECUTION]: The script scripts/calibrate_grader.py utilizes exec() and compile() to load and execute Python code from a file provided by the user or the agent.
  • While the script includes a path validation check to ensure the grader file is within the current working directory, this mechanism allows for arbitrary code execution within the context of the agent's environment.
  • This is a core feature for Reinforcement Fine-Tuning (RFT) where custom grading logic is required, but it presents a risk if the agent is directed to execute a malicious grader file.
  • [INDIRECT_PROMPT_INJECTION]: The skill is designed to process untrusted external data (CSV, JSON, JSONL) for fine-tuning and evaluation, using LLM judges to score the outputs.
  • Ingestion points: Data enters the context via scripts/auto_finetune.py, scripts/evaluate_model.py, and scripts/quality_filter.py when loading datasets.
  • Boundary markers: Missing; prompt templates for the LLM judges (e.g., in scripts/evaluate_model.py) use simple string interpolation of model outputs without explicit delimiters or instructions to ignore embedded commands.
  • Capability inventory: The skill has significant capabilities including file writing, network operations to Azure endpoints, and shell command execution.
  • Sanitization: There is minimal sanitization of the content from the processed datasets before it is sent to the evaluation models.
  • [EXTERNAL_DOWNLOADS]: Several scripts and documentation files reference external resources and APIs, all of which are hosted on official Microsoft and Azure domains.
  • scripts/deploy_model.py interacts with management.azure.com for ARM deployments.
  • scripts/content_safety_check.py sends text to the Azure Content Safety API.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Jun 22, 2026, 10:44 AM
Security Audit — agent-trust-hub — azure-ai-fine-tuning