Skip to content

Add the Governance group to V2 Admin Settings - #1680

Merged
Paul Lizer (paullizer) merged 3 commits into
microsoft:paullizer-react-v2-uifrom
paullizer:paullizer-v2-admin-governance-settings
Oct 7, 2026
Merged

Paul Lizer (paullizer) merged 3 commits into
microsoft:paullizer-react-v2-uifrom
paullizer:paullizer-v2-admin-governance-settings

Conversation

@paullizer

Copy link
Copy Markdown
Contributor

Summary

Governance was missing from V2 Admin Settings. The only trace of it was a fallback switch labelled "Mcp destination governance", so feature policies, delegated item policies, MCP destination policies, and inbound MCP source policies could only be managed on the classic page. This brings the whole surface into V2 as a Governance group that follows the V2 admin design language, built on the existing /api/admin/governance/* APIs.

  • Five Governance sections, declared in admin_settings_fields.py: feature toggles (paired personal/group, with a short "how a request is checked" explainer); feature policies edited in place with a live Enforced / Not enforced / Waiting badge; a searchable, paged delegated item policy list (create, edit or move, duplicate, inverse, delete); MCP action destination governance with a pattern builder and a deployment-restrictions readout; and inbound MCP source governance. People and group pickers search the directory plus group and public workspaces, and accept pasted IDs.
  • Governance is reachable from the settings it qualifies: Agents & Actions permissions show their governance switch with a Review link, the Inbound MCP card shows the source-policy count and can create one, and each AI connection gets Manage access for its endpoint policies.
  • Backend: the review endpoint accepts several entity types (an unknown type is a 400 instead of returning everything) and one exact item_id; two new admin-only routes, GET /api/admin/governance/principal-groups and GET /api/admin/governance/mcp-destination-catalog; V2 settings saves now write the same governance_feature_toggles_updated audit entry the classic save does; a status readout reports environment-forced MCP restrictions as booleans and a count only.
  • Fix: fields gated on a runtime flag were filtered out a second time inside SettingsSection, which left the V2 Inbound MCP card empty even with ENABLE_MCP_UI=true.

Worth a careful look:

  • Fail-closed switches (deliberate difference from classic). The classic save clears a governance switch whose feature is off. V2 keeps the value and shows "Prerequisite missing" and, for example, "Waiting for Allow Group Agents"; enforcement starts when the feature is turned on, so toggling a feature off and on cannot silently drop governance. Runtime enforcement is unchanged, and the classic page is intentionally untouched.
  • Patterns that can never match are refused. The server stores any string, and the classic examples suggest transport:streamable-http, which never matches because transports are stored as streamable_http. The builder offers ids and transports from what the server loads, and rejects hyphenated transports, host patterns with a port or path, and a * before the end of a URL path.
  • Policies save immediately through the governance API, not through the page Save bar. Unsaved inline policy edits lock category navigation and search (the same lock the Call agent manager uses), and a policy dialog stays open while its save is in flight. Both came out of an independent review and have regression tests.
  • Allow all is sent with empty allow lists, because _normalize_policy_state reads a non-empty list as restricted.
Screenshots (synthetic fixture data)

Governance Feature Toggles, with a switch kept while its feature is off:

Governance Feature Toggles

Feature Policies with enforcement state:

Feature Policies

MCP Action Destination Governance:

MCP Action Destination Governance

Destination policy editor building a group-scoped transport pattern:

MCP destination policy editor

Related governance on Workspace Agent Permissions:

Related governance on Workspace Agent Permissions

Manage access on an AI connection:

Manage access on an AI connection

Linked issue

N/A (no associated issue)

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only (0.261.259 -> 0.261.260)
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

Testing / validation

  • npm run typecheck and npm run build in application/v2_ui: passed
  • python functional_tests/test_v2_admin_governance_parity.py: 15/15 passed (includes the 29 checks in test_v2_admin_governance_logic.ts)
  • python functional_tests/test_v2_admin_section_shell.py: 5/5 passed (31 TypeScript checks, including the runtime-flag regression)
  • python -m pytest ui_tests/test_v2_admin_governance_settings.py: 9 passed
  • python -m pytest ui_tests/test_v2_admin_*.py ui_tests/test_agent_delegation_v2.py ui_tests/test_admin_orchestration_planner_model.py ui_tests/test_chat_content_checks.py ui_tests/test_model_endpoint_capacity_editor.py ui_tests/test_v2_content_screening.py: 139 passed, 1 failed (test_admin_policy_is_discoverable_and_editable_before_citations_are_enabled, which fails the same way on the base commit 1b8d4c4)
  • python functional_tests/test_v2_admin_*.py (each file): 27/29 passed; test_v2_admin_security_parity.py (chat_content_settings_present) and test_v2_admin_settings_schema.py (m365_trusted_download_hosts default) fail identically on the base
  • python functional_tests/route_tests/test_route_blueprint_policy_inventory.py (12/12), test_route_unauthenticated_policy_contract.py (7/7), test_route_policy_test_coverage.py (2/2): passed
  • python functional_tests/test_governance_enforcement_logic.py, test_governance_activity_logging.py, test_mcp_destination_governance_and_preconfigurations.py, test_inbound_mcp_governance_and_tools.py, test_content_screening_admin_settings_fix.py, test_pytest_return_false_guard.py: passed
  • python -m pytest functional_tests/test_v2_admin_governance_parity.py functional_tests/test_governance_enforcement_logic.py functional_tests/test_mcp_destination_governance_and_preconfigurations.py functional_tests/test_v2_admin_inbound_mcp_parity.py (one process): 38 passed
  • python scripts/build_docs_inventory.py (inventory unchanged), python functional_tests/test_docs_app_surface_coverage.py (7/7), python functional_tests/test_docs_site_quality.py (6/6): passed
  • Pre-existing failures, unchanged by this PR: test_governance_route_and_wiring_coverage.py 3/4 (marker missing from the untouched route_frontend_workspace.py), test_ai_connection_embedding_defaults_api.py (classic save KeyVaultSecretStorageError NameError), test_logging_tag_standardization.py (existing Workflow* tags)
  • Manual: Playwright visual pass at 1440px light and 390px dark (no overflow, no console errors); impeccable design detector reported no findings; an independent code review, whose two findings are fixed above

Documentation

  • Release notes updated, or not needed (not yet: the v0.261.260 entry is still to add)
  • Feature documentation updated, or not needed (docs/explanation/features/V2_ADMIN_GOVERNANCE_SETTINGS.md; docs/admin/governance.md rewritten; tie-in notes in docs/admin/agents-actions.md and docs/admin/ai-models.md)
  • Fix documentation updated, or not needed (docs/explanation/fixes/V2_ADMIN_RUNTIME_FLAG_FIELD_VISIBILITY_FIX.md)

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security()) (both new routes also require @login_required and @admin_required)
  • Settings sent to non-admin frontends use sanitize_settings_for_user() (no non-admin settings payloads changed)
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS
  • No secrets, keys, connection strings, or local-only artifacts are included (the environment readout returns booleans and a count, never the configured patterns)

Paul Lizer (paullizer) and others added 2 commits October 6, 2026 23:02
The V2 admin page had no governance section: only a fallback switch
labelled "Mcp destination governance". Bring the whole classic
governance surface into V2, following the V2 admin design language.

- Declare the five Governance sections. Governance switches warn and
  keep their value while the feature they govern is off, rather than
  being cleared as the classic save does.
- Editors on the governance API: inline feature policies with their
  enforcement state, a shared delegated item policy list and editor
  (duplicate, inverse, move, delete), and an MCP destination pattern
  builder that refuses patterns that can never match, such as
  transport:streamable-http.
- The review endpoint takes several entity types and one exact item;
  new admin routes resolve and search group and public workspaces and
  list the MCP destination catalog.
- Record V2 governance switch changes in the governance audit log, as
  the classic save does, and report the deployment's MCP destination
  restrictions without exposing its patterns.
- Tie-ins: related governance on Agents & Actions permissions, an
  inbound MCP source policy shortcut, and Manage access on AI
  connections.
- Unsaved inline policy edits lock category navigation and search, and
  a policy dialog stays open while its save is in flight.
- Fix fields gated on a runtime flag being dropped, which left the
  Inbound MCP card empty.

Version 0.261.260.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ce settings to 0.261.273

Resolve conflicts with the Data Lifecycle, Operations, Enhanced extraction,
global agents and actions, and admin category rail work now on the base.

- Keep the Governance and Data Lifecycle schema sections whole. A three-way
  check confirmed every schema section matches the side that changed it.
- Take the base's runtime-flag plumbing in SettingsSection, which fixed the
  same Inbound MCP visibility bug, and drop this branch's duplicate check
  and its fix doc.
- Keep related_section beside related_settings, and both guide and
  onNavigate on section cards.
- Re-express the unsaved feature-policy navigation lock on governanceDirty
  alone, since the base removed delegationDirty with the old delegation
  manager.
- Add governance to the fully described groups beside Workspaces, Data
  Lifecycle, and Operations, and renumber this branch's version references
  to 0.261.273.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread ui_tests/fixtures/v2_admin_governance.py Fixed
…ted list

GovernanceSettingsFixture reassigned self.endpoints after AdminSettingsFixture
had already set it, which CodeQL flags as overwriting an attribute defined in
the superclass. Append to the list the base fixture starts empty instead. Its
routes read that same list, so behaviour is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit 485d51a into microsoft:paullizer-react-v2-ui Oct 7, 2026
11 checks passed
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Oct 7, 2026
…ity to 0.261.274

The Governance group landed as 0.261.273, so this work moves to the next free
patch: VERSION, its release-note section, and the version markers in this
branch's tests, fixture and feature doc. Governance's own 0.261.273 markers
are unchanged.

Governance also added in-page navigation for prerequisite links, through
SettingsSection's onNavigate and the page's navigateToSetting, which leads to
the section owning a hidden target's condition. The notice now uses that
implementation, so this branch's isSectionAvailable gate, navigateWithin and
availableSectionIds are removed. The "Used by" line keeps its dependents prop
and links through the same navigateToSetting.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit that referenced this pull request Oct 7, 2026
…61.274

Brings in the Governance group (#1680), which took 0.261.273, so this
branch moves to 0.261.274. Four conflicts, each resolved by keeping both
sides:

- SettingsSection.tsx: the section-status provider still wraps the body,
  and requirement notices now pass the base's onNavigate through.
- AdminSettingsPage.tsx: the Help catalogue helpers sit beside the base's
  navigateToSetting and effectiveSettings.
- test_v2_admin_capability_placement.py and test_v2_admin_settings_schema.py:
  both history lines are kept, and invariant 1 lists Governance and Help.

The schema docstring now lists Governance among the fully described
groups. This branch's own version references move to 0.261.274; the base's
0.261.273 governance lines are left as they are.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants