code-quality-workflow

Pass

Audited by Gen Agent Trust Hub on Sep 10, 2026

Risk Level: SAFECOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The script scripts/check_patch_scope.py uses subprocess.run to execute git commands. This functionality is used to analyze repository state, calculate line churn, and identify untracked files for budget enforcement. The commands use fixed argument lists (e.g., git diff --numstat) and are executed within a validated repository path.
  • [DYNAMIC_EXECUTION]: The test suite in tests/test_scripts.py utilizes the importlib library to dynamically load the skill's utility scripts (merge_audit_reports.py and check_patch_scope.py) for validation. This is a local execution pattern used strictly for unit testing the skill's own components.
  • [INDIRECT_PROMPT_INJECTION]: The skill represents a surface for indirect prompt injection because it is designed to ingest and analyze untrusted source code and JSON audit reports. The skill incorporates multiple defensive layers to mitigate this risk, including a mandatory gating process, strict patch budgets, and explicit 'read-only' instructions for the agent until user authorization is granted.
  • Ingestion points: External data enters the context via source code files during the AUDIT state and JSON report files processed by scripts/merge_audit_reports.py.
  • Boundary markers: The skill instructions define clear state transitions and include a 'Non-negotiable rules' section that prohibits unauthorized edits. The audit-and-sweep.md reference provides a 'Slice prompt' that explicitly instructs the agent not to edit files.
  • Capability inventory: The skill is capable of executing git commands and writing to the local filesystem (in the CHANGE state). These capabilities are restricted by the check_patch_scope.py budget validator.
  • Sanitization: The scripts use standard JSON parsing and text normalization, relying on the workflow's structural gates rather than content sanitization to prevent accidental instruction following.
Audit Metadata
Risk Level
SAFE
Analyzed
Sep 10, 2026, 08:37 AM
Security Audit — agent-trust-hub — code-quality-workflow