Block role/tool namespace mismatch for author and reviewer mutations #209

Closed
opened 2026-07-05 15:26:57 -05:00 by jcwalker3 · 1 comment
Owner

Problem

Agents can perform author-side mutations through a reviewer MCP namespace or report one role while using tools from another namespace. This makes capability proofs unreliable and weakens role-boundary enforcement.

Observed failure

The transcript shows author mutations being performed with reviewer-prefixed tools:

  • gitea-reviewer/gitea_create_issue
  • gitea-reviewer/gitea_create_pr

But the final handoff reports:

  • Role: author
  • Identity: jcwalker3 / prgs-author

This is contradictory. A reviewer namespace should not be used for author mutations, and an author handoff must not rely on reviewer tool calls.

Required wall

Every mutation must prove that the tool namespace, active profile, authenticated username, and allowed capability all match the declared task role.

Acceptance criteria

  • Add a test where gitea-reviewer/gitea_create_issue is invoked; expected result: blocked unless reviewer profile explicitly allows issue creation for that task.
  • Add a test where gitea-reviewer/gitea_create_pr is invoked; expected result: blocked.
  • Add a test where the final handoff role does not match the mutation tool namespace; expected result: invalid handoff.
  • Add a test where capability proof says prgs-author but mutation path says gitea-reviewer; expected result: blocked.
  • Mutation audit logs must include namespace, profile, username, remote, repo, operation, and task role for every mutation.

Related issues

  • #139 - role-aware MCP task routing
  • #191 - issue-filing final reports and exact mutation capability proof
  • #197 - hard-stop purity after reviewer capability denial
  • #206 - pre-task role/session router
## Problem Agents can perform author-side mutations through a reviewer MCP namespace or report one role while using tools from another namespace. This makes capability proofs unreliable and weakens role-boundary enforcement. ## Observed failure The transcript shows author mutations being performed with reviewer-prefixed tools: * `gitea-reviewer/gitea_create_issue` * `gitea-reviewer/gitea_create_pr` But the final handoff reports: * `Role: author` * `Identity: jcwalker3 / prgs-author` This is contradictory. A reviewer namespace should not be used for author mutations, and an author handoff must not rely on reviewer tool calls. ## Required wall Every mutation must prove that the tool namespace, active profile, authenticated username, and allowed capability all match the declared task role. ## Acceptance criteria * Add a test where `gitea-reviewer/gitea_create_issue` is invoked; expected result: blocked unless reviewer profile explicitly allows issue creation for that task. * Add a test where `gitea-reviewer/gitea_create_pr` is invoked; expected result: blocked. * Add a test where the final handoff role does not match the mutation tool namespace; expected result: invalid handoff. * Add a test where capability proof says `prgs-author` but mutation path says `gitea-reviewer`; expected result: blocked. * Mutation audit logs must include namespace, profile, username, remote, repo, operation, and task role for every mutation. ## Related issues * #139 - role-aware MCP task routing * #191 - issue-filing final reports and exact mutation capability proof * #197 - hard-stop purity after reviewer capability denial * #206 - pre-task role/session router
jcwalker3 added the status:in-progress label 2026-07-05 20:11:40 -05:00
Author
Owner

Implementation pushed on branch feat/issue-209-namespace-mismatch.

PR: #223

Adds role_namespace_gate, wires namespace blocks into gitea_create_issue/gitea_create_pr, enriches mutation audit records (mcp_namespace, task_role, operation), and adds assess_mutation_namespace_handoff for invalid author handoffs that used gitea-reviewer.

20 targeted tests pass.

Implementation pushed on branch `feat/issue-209-namespace-mismatch`. **PR:** [#223](https://gitea.prgs.cc/Scaled-Tech-Consulting/Gitea-Tools/pulls/223) Adds `role_namespace_gate`, wires namespace blocks into `gitea_create_issue`/`gitea_create_pr`, enriches mutation audit records (`mcp_namespace`, `task_role`, `operation`), and adds `assess_mutation_namespace_handoff` for invalid author handoffs that used `gitea-reviewer`. 20 targeted tests pass.
sysadmin removed the status:in-progress label 2026-07-06 00:14:50 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#209