Enforce tool governance on local surfaces for Duo Agent Platform

Resolves #606343

Admin tool rules (local_access) were never applied to Duo Agent Platform tool approvals on local surfaces (IDE, CLI, Chat): both JWT claim mint sites fell back to the :web surface, and client-supplied agent privileges bypassed governance resolution entirely.

Two commits:

  1. Clamp client-supplied agent privileges to the governance resolution on local surfaces (most restrictive wins, fail closed).
  2. Resolve local environments as their own governance surface in Ai::ToolRules::GovernanceSurface, behind the disabled-by-default feature flag duo_workflow_local_tool_governance. The flag is the deliberate enforce-on switch so enforcement timing can be coordinated with client adoption.

All touched specs green locally (governance surface, ws request, create/update workflow services, context generation).

Merge request reports

Loading