## Summary Introduce an account-level OPA Policy-Based Gating Metrics Dashboard in Harness. The dashboard will provide centralized visibility into Open Policy Agent policy evaluations performed during pipeline executions, including successful evaluations, warnings, hard failures, affected pipelines, impacted teams, and the specific reason for each warning or failure. The dashboard must help platform engineering, security, compliance, and application teams quickly answer: * Which policies are generating the most warnings or failures? * Which pipelines, projects, organizations, environments, and teams are affected? * Why did a policy evaluation fail or produce a warning? * Which execution most recently encountered the policy result? * Are policy violations increasing or decreasing over the selected period? * Are policies operating in soft-gate or hard-gate mode? ## Problem Statement Harness currently provides policy evaluation information primarily within individual pipeline executions. Administrators and governance teams do not have an aggregated, account-level view of policy evaluation outcomes. As a result, users must inspect executions individually to understand: * Which OPA policies are frequently violated. * Whether violations resulted in warnings or execution failures. * The pipelines and teams affected by those violations. * The exact policy failure or warning reason. * Whether policy adoption and compliance are improving over time. This makes it difficult to manage policies at scale, identify recurring compliance issues, prioritize remediation, and measure the organizational impact of policy enforcement. ## User Story As a Harness account administrator, platform engineer, security engineer, or governance owner, I want an account-level dashboard showing OPA policy evaluation results across organizations, projects, pipelines, and environments so that I can identify policy violations, understand their causes, measure their impact, and direct remediation to the appropriate teams. ## Proposed Solution Create a dashboard titled Policy-Based Gating Metrics under the Harness Governance or Policy Management experience. The dashboard will aggregate OPA policy evaluation data for the user-selected scope and time range. It will contain: Global dashboard filters. Summary metric cards. A detailed policy evaluation table. A new Policy Failure Reason column. Navigation from dashboard records to the corresponding Harness pipeline execution and policy definition. --- ## Functional Requirements ### 1. Dashboard Scope The dashboard must support an account-level view of OPA policy evaluations. Users must be able to narrow the results to: * Account * Organization * Project * Environment * Pipeline * Policy set * Evaluation status * Time range All metric cards and table results must refresh based on the selected filters. The dashboard must respect Harness role-based access control. A user must see only the organizations, projects, pipelines, executions, environments, policies, and policy sets they are authorized to view. ### 2. Dashboard Filters The dashboard must provide the following filters: | Filter | Requirements | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | | Policy Set | Select one or more policy sets. The default value is all accessible policy sets. | | Evaluation Status | Support Success , Warn & Continue , and Failed . Multi-select must be supported. | | Time Range | Provide predefined ranges such as last 24 hours, 7 days, 30 days, and a custom date range. The default is last 7 days. | | Environment | Select one or more environments. The default is all accessible environments. | | Scope | Filter by account, organization, and project. | | Pipeline | Search for and select one or more pipelines. | | Policy Enforcement Type | Filter by soft gate or hard gate, if this information is available separately from evaluation status. | Changing any filter must update the metric cards and detailed table using the same filtered dataset. A Clear Filters action must restore the default dashboard state. Selected filters should remain intact when the user opens an execution and returns to the dashboard during the same session. ### 3. Summary Metric Cards The dashboard must display the following summary cards. #### Soft-Gated Pipelines Display the number of distinct pipelines that received at least one Warn & Continue policy result during the selected period. A pipeline must be counted only once, regardless of the number of warnings or executions. #### Hard-Gated Pipelines Display the number of distinct pipelines that had at least one execution blocked or failed by a policy evaluation during the selected period. A pipeline must be counted only once, regardless of the number of failed evaluations. #### Successful Evaluations Display the total number of successful policy evaluations during the selected period. This metric represents evaluation events, not distinct pipelines. #### Impacted Teams Display the number of distinct Harness teams associated with pipelines that received a warning or failure during the selected period. If reliable team ownership information is unavailable, this card may initially display distinct organizations or projects and must be relabeled accordingly. The dashboard must not infer team ownership from incomplete data. Each card should provide a tooltip defining its calculation method. Selecting a metric card must filter the detailed table to the corresponding evaluation category. ### 4. Policy Evaluation Results Table The dashboard must display a searchable, sortable, and paginated table containing policy evaluation information. The table must contain the following columns: | Column | Description | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------- | | Policy Set | Name of the policy set used for the evaluation. | | Status | Result of the evaluation: Success , Warn & Continue , or Failed . | | Policy Failure Reason | Human-readable reason returned by the policy evaluation for the most recent affected execution represented by the row. | | Count | Number of matching policy evaluations for the row within the selected filters and time range. | | Organization | Harness organization identifier or name. | | Project | Harness project identifier or name. | | Pipeline ID | Harness pipeline identifier. | | Pipeline Name | Display name of the pipeline. | | Environment | Environment associated with the pipeline execution, when applicable. | | Latest Execution ID | Identifier of the most recent execution represented by the row. | | Latest Evaluation Time | Date and time of the most recent policy evaluation represented by the row. | | Enforcement Type | Indicates whether the policy operated as a soft gate or hard gate. | The table should support: * Sorting by status, count, organization, project, pipeline name, and latest evaluation time. * Searching by policy set, policy name, organization, project, pipeline ID, pipeline name, execution ID, and failure reason. * Pagination or virtual scrolling for large result sets. ## Definition of Done The feature is complete when authorized Harness users can use a production-ready account-level dashboard to filter and review OPA policy evaluations, see the exact reason for warnings and failures, identify affected pipelines and organizational scopes, open the associated execution or policy, and export the filtered results while all security, performance, accessibility, and data-consistency requirements are satisfied.