microsoft / microsoft/hve-core
ci(security): enforce VEX human-in-the-loop gate via branch protection and autonomous-PR identity
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 301
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 92
Description
## Summary
The VEX trust model is "AI drafts, human merges": the agent performs every step except the merge click, and the merge-commit author is the accountable author of record. Today that gate is **convention**, not an enforced control. This issue makes it enforced and closes the autonomous-PR identity seam so drafted PRs cannot bypass required checks or review.
Relates to #2038, #1220, #1221.
## Why
* Without branch protection, an agent-drafted PR could be merged without the intended CODEOWNERS review — the human-in-the-loop becomes optional in practice.
* gh-aw drafting workflows running under the default `GITHUB_TOKEN` do **not** trigger required status checks on the PRs they open, so a drafted PR can present as "green" without checks having run.
* These two gaps together are the highest-severity governance risk for the `experimental` capability.
## Scope
### Branch protection (repo admin)
- [ ] Enable branch protection requiring **CODEOWNERS review** on the VEX-owned paths:
- `/security/vex/**`
- the VEX `.github/` paths (workflows, agents, instructions, skills) covered by `CODEOWNERS`.
- [ ] Require review approval before merge (no self-merge bypass for these paths).
- [ ] Require status checks to pass before merge on the protected paths.
> `CODEOWNERS` already assigns ownership of `/security/vex/` and `/.github/`; this issue is the enforcement toggle, not new ownership.
### Autonomous-PR identity (repo admin)
- [ ] Provision a **GitHub App** and populate gh-aw's `GH_AW_GITHUB_TOKEN` so agent-drafted PRs run as a non-`GITHUB_TOKEN` identity and therefore **trigger required checks**.
- [ ] Confirm behavior on the org: the Copilot engine uses `copilot-requests: write` (no PAT needed, unlike the personal-fork validation run).
- [ ] Verify a drafted PR end-to-end: opened by the App identity, required checks run, CODEOWNERS review required before merge.
## Acceptance criteria
- [ ] Branch protection rule active on `/security/vex/**` requiring CODEOWNERS review and passing checks.
- [ ] Agent-drafted PRs open under the GitHub App identity and trigger required status checks.
- [ ] A test drafted PR demonstrably cannot merge without a human CODEOWNERS approval.
## Notes
* Deferred from the PR #2038 review to the core team / repo admin as one-time operational setup.
* Pairs with the first live **VEX Detection → VEX Draft** run inside HVE Core, which exercises this identity path on the real repo.
Contributor guide
Research direction
Start with the repository's CODEOWNERS configuration, GitHub branch protection settings, and the gh-aw token configuration. Verify the GitHub App identity and required checks using a test drafted PR, then confirm that CODEOWNERS approval is required before merge and that the acceptance criteria are met.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, github-actions
- Domain
- ci-cd, devops, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100