Skip to content

feat: label-governance hook should enforce an allowlist of agent-settable labels #76

Description

@EashanKaushik

Description

The label-governance.sh hook currently only blocks agent:start (prevents infinite re-invocation). But the agent can add any other label — including ones that don't exist or aren't meaningful (e.g. agent:pr, agent:foo).

Observed

The agent added agent:pr which is not a recognized pipeline label. It should only be allowed to set labels from a defined allowlist.

Proposed

Add an allowlist to label-governance.sh. Only labels matching the allowed set pass; anything else with the {LABEL_PREFIX}: prefix is blocked.

Suggested allowlist:

  • agent:explore
  • agent:implement
  • agent:critique
  • agent:done
  • agent:blocked
  • agent:clarification

Any label not in this list that starts with agent: should be blocked with exit 2.

Files

  • coding-assistants/claude-code/plugin/hooks/label-governance.sh — add allowlist logic
  • test/hooks/test_hooks.sh — add test cases for allowed/blocked labels
  • sdlc-config.template.yaml — optionally make the allowlist configurable

Constraints

  • Keep agent:start as the hard-block (current behavior)
  • The allowlist should be configurable via env var or config (so different projects can customize)
  • Labels without the agent: prefix are always allowed (team labels, GitHub defaults, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions