An agent autonomously creates feature branches and opens pull requests as part of its workflow. The team is concerned about agents cluttering the repository's branch namespace and making it difficult to distinguish human-created branches from agent-created branches. Which branch naming strategy MOST effectively addresses this concern?
Select an answer to reveal the explanation.
Short Explanation and Infographic
A branch named 'fix-dependency' could be from a human or a bot — you'd have to check the commit author to know. A branch named 'agent/dep-update-agent/task-20240729-001' is unambiguous at a glance. The namespace prefix is the key: it creates a machine-enforceable convention (GitHub rulesets can target 'agent/**') and a human-readable signal simultaneously. Include agent identity and task ID for traceability when something goes wrong.
Full explanation below image
Full Explanation
Branch namespace management in agent systems is an operational hygiene concern with real consequences for repository usability, CI cost, and incident response.
Option A (any branch name) is the anti-pattern. Mixed namespaces make it impossible to build automation that targets agent branches (e.g., auto-delete stale agent branches, apply different CI rules to agent PRs, filter the branch list). Incident response is hampered when you cannot quickly identify which open PRs were created by agents.
Option B is correct for three compounding reasons: (1) Reserved namespace prefix ('agent/' or 'bot/') creates a machine-readable, human-readable signal. Engineers scanning the branch list immediately know which branches are agent-created. GitHub Branch Rulesets can apply different rules to 'agent/' branches (e.g., required merge queue, different reviewer requirements). Automation can target 'agent/' for cleanup jobs. (2) Agent identity in the branch name ('dep-update-agent') answers 'which agent created this?' without looking at commit metadata. This is critical when an agent is misbehaving and you need to find all its branches. (3) Task ID in the branch name enables direct correlation between a branch and the task that created it, linking the branch to logs, audit trails, and the triggering event. The full name 'agent/dep-update-agent/task-20240729-001' is self-describing and uniquely identifiable.
Option C ('-automated' suffix) is better than nothing but provides less information and is harder to enforce mechanically. A GitHub Ruleset cannot target 'branches ending in -automated' as cleanly as it can target 'branches starting with agent/'. Also, appending a suffix to a natural branch name means 'fix-dependency-automated' — the branch name still looks like a human branch name with a suffix rather than a clearly distinguished namespace.
Option D (registry file) requires manual maintenance, creates a race condition when multiple agents create branches simultaneously, and is a secondary lookup rather than an inline signal. Engineers must open a file to answer a question that should be answerable from the branch name alone.