Enforce strict cross-project boundaries (permit issues, block codebase mutations) #707

Open
opened 2026-07-13 21:15:04 -05:00 by jcwalker3 · 1 comment
Owner

Problem

Currently, there is no strict boundary preventing an AI agent instantiated in one project context from executing codebase mutations (such as branch creation, file modification, or PR creation) against another distinct project repository. If the agent's filesystem or MCP permissions technically allow it, the agent can spontaneously attempt to perform direct code work outside of its originally authorized context.

While we want to enable agents to orchestrate cross-project coordination, this should be strictly confined to metadata operations (e.g., creating issues) rather than direct codebase modification.

Requirements

  1. Implement a policy/guard inside the MCP server that explicitly enforces cross-project mutation boundaries.
  2. Allow agents to execute metadata operations (such as creating tracking issues or commenting on issues) across project boundaries to coordinate workflows.
  3. Block any attempt to execute mutation operations (creating branches, committing files, creating PRs) outside of the primary authorized project context.
  4. Ensure clear diagnostic output when this boundary is hit, explicitly advising the agent that cross-project work is forbidden and that it should create an issue in the target repository instead.
  5. Provide regression tests validating that cross-project codebase mutations fail closed, while cross-project issue creation is allowed.
## Problem Currently, there is no strict boundary preventing an AI agent instantiated in one project context from executing codebase mutations (such as branch creation, file modification, or PR creation) against another distinct project repository. If the agent's filesystem or MCP permissions technically allow it, the agent can spontaneously attempt to perform direct code work outside of its originally authorized context. While we want to enable agents to orchestrate cross-project coordination, this should be strictly confined to metadata operations (e.g., creating issues) rather than direct codebase modification. ## Requirements 1. Implement a policy/guard inside the MCP server that explicitly enforces cross-project mutation boundaries. 2. Allow agents to execute metadata operations (such as creating tracking issues or commenting on issues) across project boundaries to coordinate workflows. 3. Block any attempt to execute mutation operations (creating branches, committing files, creating PRs) outside of the primary authorized project context. 4. Ensure clear diagnostic output when this boundary is hit, explicitly advising the agent that cross-project work is forbidden and that it should create an issue in the target repository instead. 5. Provide regression tests validating that cross-project codebase mutations fail closed, while cross-project issue creation is allowed.
jcwalker3 added the type:guardrailstatus:ready labels 2026-07-13 21:16:36 -05:00
jcwalker3 added status:pr-open and removed status:ready labels 2026-07-25 18:19:23 -05:00
Author
Owner

Canonical Issue State

STATE: needs-review
WHO_IS_NEXT: reviewer
NEXT_ACTION: Independent review of PR #923 and issue #707.
NEXT_PROMPT:

Switch profile to prgs-reviewer, acquire reviewer lease for PR #923, perform review of PR #923 and submit final review report.

WHAT_HAPPENED: Allocated issue #707, locked issue, created worktree at branches/issue-707-cross-project-boundaries on branch feat/issue-707-cross-project-boundaries, updated remote_repo_guard.py and gitea_mcp_server.py to enforce cross-project codebase mutation boundaries (for_mutation=True), added unit tests in tests/test_cross_project_mutation_boundary.py (23/23 passed), committed changes caaec9a, pushed branch to prgs, and opened PR #923.
WHY: Enforce strict cross-project codebase mutation boundaries in the MCP server (#707).
RELATED_PRS: #923
BLOCKERS: none
VALIDATION: pytest tests/test_cross_project_mutation_boundary.py tests/test_remote_repo_guard.py (23 passed in 1.00s).
LAST_UPDATED_BY: jcwalker3 (prgs-author)

Canonical Handoff

REPOSITORY: Scaled-Tech-Consulting/Gitea-Tools
ISSUE: 707
PR: 923
WORKFLOW_STATE: needs-review
HEAD_SHA: caaec9a60e060000a6e0cdd12b6f1cfbe6a77d24
BASE_BRANCH: master
BASE_OR_MERGE_SHA: 2b4e43042a34f4e29617378ae79a7f5a3d312688
ACTING_ROLE: author
ACTING_IDENTITY: jcwalker3 (prgs-author)
COMPLETED_ACTIONS: Allocated issue #707, locked issue, created worktree at branches/issue-707-cross-project-boundaries on branch feat/issue-707-cross-project-boundaries, updated remote_repo_guard.py and gitea_mcp_server.py to enforce cross-project codebase mutation boundaries (for_mutation=True), added unit tests in tests/test_cross_project_mutation_boundary.py (23/23 passed), committed changes caaec9a, pushed branch to prgs, and opened PR #923.
VALIDATION_EVIDENCE: pytest tests/test_cross_project_mutation_boundary.py tests/test_remote_repo_guard.py (23 passed in 1.00s).
MUTATION_LEDGER: gitea_lock_issue (issue #707), git commit caaec9a, git push prgs feat/issue-707-cross-project-boundaries, gitea_create_pr #923.
BLOCKERS: none
NEXT_ACTOR: reviewer
NEXT_ACTION: Independent review of PR #923 and issue #707.
PROHIBITED_ACTIONS: Author self-review or self-merge.
NEXT_PROMPT: Switch profile to prgs-reviewer, acquire reviewer lease for PR #923, perform review of PR #923 and submit final review report.
WORKFLOW_FAILURE_ISSUES: none
LAST_UPDATED: 2026-07-25T23:19:30Z
## Canonical Issue State STATE: needs-review WHO_IS_NEXT: reviewer NEXT_ACTION: Independent review of PR #923 and issue #707. NEXT_PROMPT: ```text Switch profile to prgs-reviewer, acquire reviewer lease for PR #923, perform review of PR #923 and submit final review report. ``` WHAT_HAPPENED: Allocated issue #707, locked issue, created worktree at branches/issue-707-cross-project-boundaries on branch feat/issue-707-cross-project-boundaries, updated remote_repo_guard.py and gitea_mcp_server.py to enforce cross-project codebase mutation boundaries (for_mutation=True), added unit tests in tests/test_cross_project_mutation_boundary.py (23/23 passed), committed changes caaec9a, pushed branch to prgs, and opened PR #923. WHY: Enforce strict cross-project codebase mutation boundaries in the MCP server (#707). RELATED_PRS: #923 BLOCKERS: none VALIDATION: pytest tests/test_cross_project_mutation_boundary.py tests/test_remote_repo_guard.py (23 passed in 1.00s). LAST_UPDATED_BY: jcwalker3 (prgs-author) <!-- sph:v1 --> ## Canonical Handoff ```text REPOSITORY: Scaled-Tech-Consulting/Gitea-Tools ISSUE: 707 PR: 923 WORKFLOW_STATE: needs-review HEAD_SHA: caaec9a60e060000a6e0cdd12b6f1cfbe6a77d24 BASE_BRANCH: master BASE_OR_MERGE_SHA: 2b4e43042a34f4e29617378ae79a7f5a3d312688 ACTING_ROLE: author ACTING_IDENTITY: jcwalker3 (prgs-author) COMPLETED_ACTIONS: Allocated issue #707, locked issue, created worktree at branches/issue-707-cross-project-boundaries on branch feat/issue-707-cross-project-boundaries, updated remote_repo_guard.py and gitea_mcp_server.py to enforce cross-project codebase mutation boundaries (for_mutation=True), added unit tests in tests/test_cross_project_mutation_boundary.py (23/23 passed), committed changes caaec9a, pushed branch to prgs, and opened PR #923. VALIDATION_EVIDENCE: pytest tests/test_cross_project_mutation_boundary.py tests/test_remote_repo_guard.py (23 passed in 1.00s). MUTATION_LEDGER: gitea_lock_issue (issue #707), git commit caaec9a, git push prgs feat/issue-707-cross-project-boundaries, gitea_create_pr #923. BLOCKERS: none NEXT_ACTOR: reviewer NEXT_ACTION: Independent review of PR #923 and issue #707. PROHIBITED_ACTIONS: Author self-review or self-merge. NEXT_PROMPT: Switch profile to prgs-reviewer, acquire reviewer lease for PR #923, perform review of PR #923 and submit final review report. WORKFLOW_FAILURE_ISSUES: none LAST_UPDATED: 2026-07-25T23:19:30Z ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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