run = async (
  entrypoint,
  policyOrPolicyPath,
  {
    dev = false,
    trustRoot,
    projectRoot,
    readFile = nodeFs.promises.readFile,
    log = defaultLog,
    ...options
  } = {}
) => {
  await Promise.resolve()

  /**
   * @remarks
   * This is a typescript-ism.
   * @type {LoadPoliciesOptions}
   */
  const loadPoliciesOptions = {
    readFile,
    projectRoot,
    ...('policyOverride' in options
      ? {
          policyOverride: options.policyOverride,
        }
      : {
          policyOverridePath: options.policyOverridePath,
        }),
  }

  const policy = await loadPolicies(policyOrPolicyPath, loadPoliciesOptions)

  // because we have a merged policy, we don't need to provide overrides to `toEndoPolicy`
  const endoPolicy = await toEndoPolicy(policy, { projectRoot })
  // this must be done against the merged policy, not the original.
  assertTrustRootMatchesPolicy(policy, entrypoint, trustRoot)

  /** @type {ExecuteOptions} */
  const executeOptions = {
    Compartment: makeExecutionCompartment(globalThis),
    modules: {
      [DEFAULT_ATTENUATOR]: {
        attenuateGlobals: makeGlobalsAttenuator({
          policy,
          scuttleGlobalThis: options.scuttleGlobalThis,
        }),
        attenuateModule,
      },
    },
    policy: endoPolicy,
    dev,
    log,
    readPowers: makeReadPowers(options),
  }

  return execute(entrypoint, executeOptions)
}
Runs a module or script with provided LavaMoat policy

Allows creation of read powers from raw interfaces; see {@link makeReadPowers}

@privateRemarks
Mainly a wrapper around {@link execute}
@template [T=unknown] Exports of module, if known. Default is `unknown`
@param {string | URL} entrypoint Entry point of application
@param {LavaMoatPolicy | string | URL} policyOrPolicyPath LavaMoat policy
@param {RunOptions} [options] Options
@returns {Promise<T>} Exports of executed module