codex-goal-mining
Warn
Audited by Gen Agent Trust Hub on Jul 29, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONREMOTE_CODE_EXECUTIONDATA_EXFILTRATIONPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The script
scripts/codex-goal-report.pyusessubprocess.runto execute shell commands, specificallysshfor remote data collection andrg(ripgrep) for local file searches. Thessh_targetparameter from the fleet policy is passed as a command-line argument to thesshbinary; if the policy file contains untrusted or malicious targets (e.g., using-oProxyCommand), it could lead to local command execution. - [REMOTE_CODE_EXECUTION]: The skill implements a fleet reporting mechanism that transmits its own Python source code to remote machines and executes it via
ssh [target] python3 -. This design allows the skill to run arbitrary logic on any system defined in the fleet configuration policy. - [PROMPT_INJECTION]: The skill processes user-generated "goal objectives" retrieved from historical databases and session logs. This creates a surface for indirect prompt injection where malicious instructions embedded in previous goals could influence the agent's behavior during summarization or rerun generation.
- Ingestion points: Data is ingested in
scripts/codex-goal-report.pyviacollect_sqlite_goals(reading~/.codex/*.sqlite) andcollect_local_goals(reading~/.codex/sessions/*.jsonl). - Boundary markers: No explicit boundary markers or "ignore" instructions are present in the skill instructions or script logic to separate data from instructions.
- Capability inventory: The script has capabilities for file system access, local command execution (
rg), and network-based remote execution (ssh). - Sanitization: Goal objectives are normalized by whitespace and case, but no sanitization or escaping is performed to mitigate prompt injection risks.
- [DATA_EXFILTRATION]: The core purpose of the skill is to aggregate interaction history, including objectives and token usage, from local and remote stores. While
SKILL.mdincludes best practices for scrubbing secrets, the inherent capability to collect and transmit detailed user activity logs poses a data exposure risk if the output is misdirected or captured. - [COMMAND_EXECUTION]: The test script
scripts/codex-goal-report-test.pyusesimportlib.utilandexec_moduleto dynamically load and execute the main reporting script from the file system.
Audit Metadata