This repository details the proposal to add a new API for determining the integrity of web environments:
const attestation = await navigator.getEnvironmentIntegrity("...");
The explainer goes gives a high level overview of the proposal.
The spec currently describes how this is being prototyped in Chromium.