prior-work-retrieval
Warn
Audited by Gen Agent Trust Hub on Nov 27, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONPERSISTENCEPRIVILEGE_ESCALATIONPROMPT_INJECTIONINDIRECT_PROMPT_INJECTIONDYNAMIC_EXECUTION
Full Analysis
- [COMMAND_EXECUTION]: The skill executes local binaries and shell commands using
subprocess.run. Logic inscripts/prior_work.pycallsripgrepfor file searching andgitfor status and revision checks. It also supports acommandmode that executes arbitrary scripts defined in a local manifest file (sources.json). - [PERSISTENCE]: The skill includes an installation routine in
scripts/prior_work_hook.pythat modifies agent configuration files, specifically~/.claude/settings.jsonand~/.codex/hooks.json. This registers the skill as a permanent hook within the agent's platform environment. - [PRIVILEGE_ESCALATION]: Once installed as a hook, the skill can intercept and monitor all
UserPromptSubmit,PreToolUse, andStopevents. It uses this capability to block the agent's production tools and final responses until a 'reuse receipt' is generated, overriding the agent's standard autonomy. - [PROMPT_INJECTION]: The hook mechanism in
scripts/prior_work_hook.pyapplies regular expressions to every user prompt to detect specific triggers. When a trigger matches, the skill injects system-level instructions into the prompt context to enforce its mandatory retrieval workflow. - [INDIRECT_PROMPT_INJECTION]: The skill has an attack surface for indirect injection because it ingests and processes untrusted user prompts and tool outputs to decide whether to block or allow agent actions. The gating logic relies on parsing these inputs to identify 'prior work' requests.
- [DYNAMIC_EXECUTION]: The script
scripts/prior_work.pyperforms dynamic loading of Python modules usingimportlib.util. It specifically loads the sibling hook script to access its classification logic and regex patterns at runtime.
Audit Metadata