feat: block direct MCP imports and unsanctioned keychain access (Closes #558) #566
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#566
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Closes #558.
Blocks mutation auth and keychain credential fill outside the official MCP daemon so agents cannot bypass preflight via raw
import gitea_auth/ shell keychain dumps.Changes
mcp_daemon_guard.py— sanctioned runtime detection (GITEA_MCP_SANCTIONED_DAEMON, pytest, operator opt-in)gitea_auth.get_auth_headerrequires sanctioned runtimegit credential fillpath requires daemon orGITEA_ALLOW_KEYCHAIN_CLI=1mcp_server.py,gitea_mcp_server__main__) mark the process sanctionedWorktree
branches/feat-issue-558-block-direct-imports@8ff1924only.Tests
Self-review: no.
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #566
issue: #558
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 26681-ebfa77b6f660
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-566-block-direct-imports
phase: claimed
candidate_head:
412f0e0081target_branch: master
target_branch_sha:
9340dc7009last_activity: 2026-07-09T13:08:02Z
expires_at: 2026-07-09T15:08:02Z
blocker: none
Review: APPROVE PR #566
Closes #558 — block direct MCP imports and unsanctioned keychain access.
Scope (7 files)
mcp_daemon_guard.py— sanctioned runtime detection + fail-closed assertsgitea_auth.get_auth_headerrequires sanctioned daemongit credential fillrequires daemon orGITEA_ALLOW_KEYCHAIN_CLI=1mcp_server.py,gitea_mcp_server__main__) mark sanctionedValidation
prgs/master(9340dc7): no conflicts; post-sim 5 passedAssessment
mcp_server.pyis swallowed (documented;__main__path also marks)Identity
Canonical PR State
STATE: approved ready-to-merge
WHO_IS_NEXT: merger
NEXT_ACTION: merge PR #566 at the pinned head with expected_changed_files
NEXT_PROMPT:
WHAT_HAPPENED: Formal review of PR #566 against #558; validation green; merge-sim clean.
WHY: Tight security scope, fail-closed design, tests cover daemon/pytest/opt-in paths.
ISSUE: #558
HEAD_SHA:
412f0e0081REVIEW_STATUS: approved
MERGE_READY: yes
BLOCKERS: none
VALIDATION: py_compile+diff-check clean; 5 focused tests passed; merge-sim clean on
9340dc7LAST_UPDATED_BY: sysadmin / prgs-reviewer
adopted_at: 2026-07-09T13:08:31Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 26681-ebfa77b6f660
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 7942
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #566
issue: #558
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 27153-5851b9362770
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-566-block-direct-imports
phase: adopted
candidate_head:
412f0e0081target_branch: master
target_branch_sha:
9340dc7009last_activity: 2026-07-09T13:08:31Z
expires_at: 2026-07-09T15:08:31Z
blocker: none