gitlab.ai-servicers.com · design decision · 2026-10-24 · updated 2026-11-06
Every merge request gets an AI analysis before a human merges.
The AI advises — deterministic controls and the human click decide.
Sources: docs/mr-ai-review.md · docs/reviews/mr-ai-review.final.md (3-model review synthesis) · cicd mr-review/README.md
One shared repo ships executable payloads (9 hook scripts, the safety guard itself, setup.py) and instruction payloads (skills, CLAUDE.md imports) to every user's sessions.
Not only malice: a buggy hook or developer-oriented instruction lands in admin sessions with full rights. Merges into claude-shared now need the Maintainer role, which only the administrator account holds.
Closed 2026-11-06. Protected main: merge and push need Maintainer, held only by the administrator account; force-push off. Developers still push branches and open MRs.
"All threads must be resolved" is on, so the review thread blocks the merge. "Pipelines must succeed" is off: claude-shared has no CI yet.
No approval rules, no CODEOWNERS, no push rules, no Duo — all Premium. Controls must be CE-native.
Under bypass-permissions sessions, a poisoned SKILL.md or CLAUDE.md executes shell without touching a single .sh file.
The admin clone changes only on manual pull — a natural checkpoint we can put a gate on.
2026-06-07: webhook → auto-executing AI caused real damage. Lesson: webhook AI must only ever comment.
design principle
The AI layer produces comments.
The deterministic layer and the human merge click are the controls.
A prompt-injected reviewer can mislead — it must never hold merge power or labels, and it sees only the uploaded merge request.
No labels: the bot's role cannot apply them, and a thread is enforced by GitLab itself. The central Review Board is never in this path.
Done 2026-11-06. main: merge = Maintainer, push = Maintainer, force-push off. Plan said push = No one; the administrator account can still push directly.
"All threads must be resolved" is on — the review thread is a click-to-acknowledge gate. "Pipelines must succeed" waits for CI.
Closed. Developers can no longer read GitLab admin tokens: rotated 2026-10-31, permissions fixed by 2026-11-04, history locked 2026-11-06.
Pipeline definition lives in administrators/cicd — MR authors can't edit it. Guard tests, shellcheck, semgrep, gitleaks. claude-shared has no CI yet.
/updateskills shows the executable/instruction diff and requires tty confirmation before the admin clone fast-forwards.
AI sessions and review services get their own GitLab identities, never the administrator's.
| # | Step | Status |
|---|---|---|
| 1 | Lock claude-shared main (merge=Maintainer) · secrets hygiene · runner audit | Lock done 2026-11-06 · admin tokens closed · runners tracked internally |
| 2 | Build mr-review service + external CI with guard tests, in cicd · pilot on claude-shared | Service live since 2026-10-24 · peer review built · CI planned |
| 3 | /updateskills tty gate · separate AI GitLab identity | Planned |
| 4 | agent-session moves into claude-shared — gated on 1–3, not on the AI reviewer · retire runtime copy | Planned |
| 5 | cicd-dashboard risk badge · expand repos on pilot metrics | Planned |
Step 1's merge lock and token fix are in place. The AI layer is never the control.
A confident, misleading "looks clean" review lowering the merger's scrutiny. Mitigation: AI output framed as questions the merger must answer — never "safe".
Review comments are untrusted input to any downstream AI session — never wire a label or comment to autonomous execution.
0
merge, push, or execution rights held by any AI component in this design