org-branch-cleanup

Pass

Audited by Gen Agent Trust Hub on Sep 14, 2026

Risk Level: SAFECOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTIONDYNAMIC_EXECUTION
Full Analysis
  • [COMMAND_EXECUTION]: The script scripts/org_branch_cleanup.py executes the GitHub CLI (gh) via subprocess.run. This is a core feature for managing repository branches. The implementation correctly passes arguments as a list, which prevents shell injection vulnerabilities.
  • [INDIRECT_PROMPT_INJECTION]: The skill processes external data from GitHub, including branch names and pull request metadata. This creates an indirect prompt injection surface where malicious branch names could theoretically influence the agent's behavior. However, the script mitigates technical risks by using URL encoding for branch names in all API calls.
  • Ingestion points: The query_repository_branches function in scripts/org_branch_cleanup.py reads data from the GitHub API.
  • Boundary markers: The skill workflow relies on structured audit logs and explicit human-in-the-loop confirmation before any destructive actions are taken.
  • Capability inventory: The skill has the ability to delete GitHub branches using gh api -X DELETE calls.
  • Sanitization: Branch names are URL-encoded via urllib.parse.quote in the encoded_branch helper function before use in command arguments.
  • [DYNAMIC_EXECUTION]: The test script scripts/test_org_branch_cleanup.py uses importlib.util to dynamically load the main cleanup script for unit testing. This is a standard Python pattern for testing standalone scripts and is restricted to loading a local file within the skill's own directory. The file also uses an inline __import__('json') call within a test case, which is a benign use of dynamic importing.
Audit Metadata
Risk Level
SAFE
Analyzed
Sep 14, 2026, 10:51 AM
Security Audit — agent-trust-hub — org-branch-cleanup