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.py uses subprocess.run to execute shell commands, specifically ssh for remote data collection and rg (ripgrep) for local file searches. The ssh_target parameter from the fleet policy is passed as a command-line argument to the ssh binary; 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.py via collect_sqlite_goals (reading ~/.codex/*.sqlite) and collect_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.md includes 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.py uses importlib.util and exec_module to dynamically load and execute the main reporting script from the file system.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Jul 29, 2026, 02:49 AM
Security Audit — agent-trust-hub — codex-goal-mining