codex-imagegen
Pass
Audited by Gen Agent Trust Hub on Nov 13, 2026
Risk Level: SAFECOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTIONEXTERNAL_DOWNLOADS
Full Analysis
- [COMMAND_EXECUTION]: The skill interacts with the local environment by executing the
codexCLI and internal Python scripts viasubprocess.runandsubprocess.Popen. - Evidence includes calls to
codex login status,codex exec, and background execution ofimage_project.py. - The skill implements robust security controls for these operations, including the use of a sanitized environment (filtering
os.environto a specific whitelist of safe variables) and strict validation of command-line arguments to prevent shell injection. - [INDIRECT_PROMPT_INJECTION]: The skill processes untrusted user data in the form of image briefs and reference PNG files which are passed to remote models.
- Ingestion points: Inputs are ingested via the
--prompt-fileand--imagearguments inrun_codex_imagegen.py. - Boundary markers: The skill uses a dedicated "relay" system prompt that explicitly instructs the model to treat the brief as data rather than instructions. It also enforces a strict JSON schema for the model's output to prevent command or context leakage.
- Capability inventory: The skill has the ability to execute the
codexCLI, write PNG files to the local filesystem, and generate a local HTML gallery for image comparison. - Sanitization: The skill validates image headers (PNG, JPEG, WebP) to ensure they are valid image files, resolves paths to prevent directory traversal, and escapes HTML content using
html.escapeto prevent cross-site scripting (XSS) in the generated gallery. - [EXTERNAL_DOWNLOADS]: The skill requires the
@openai/codexCLI tool to be installed globally via npm. - This dependency is a standard requirement for accessing the OpenAI Codex infrastructure through the CLI.
Audit Metadata