Work IQ Usage Detection — Nightly Classify Flow¶
Status: 0.1.0-preview. These are manual build instructions for a Power Automate cloud flow. Per the repository content policy, this solution ships documentation only — there is no exported flow JSON, connection reference, or environment-variable export to import. Build the flow in the Power Automate designer following the steps below and adapt names to your environment.
Purpose¶
A scheduled nightly flow that computes the canonical four-state Work IQ
observed-usage record for every agent by joining Tier-A configuration with Tier-B
telemetry, then writes fsi_wiqstate rows and an fsi_wiqkpi rollup. This
supports per-zone Work IQ feature-enablement governance (control 2.24) and usage
reporting (controls 3.2, 2.9). It does not, on its own, satisfy any regulation.
Authentication¶
Managed-identity-first. Run the orchestration from an Azure-hosted context (for example an Azure Automation runbook or Azure Function with a managed identity, invoked by the flow) so that Dataverse, Defender, Application Insights, and Purview calls use a managed identity rather than a stored secret. A client secret is acceptable only as a development fallback.
Prerequisites¶
copilot-agent-inventorydeployed andfsi_copilotagentpopulated.fsi_wiqstate,fsi_wiqkpi, and the fourfsi_wiq_*option sets created viapython scripts/create_wiq_dataverse_schema.py(dry-run first).- Tier-A detector (
scripts/Get-WorkIqConfigState.ps1) reachable from the orchestration host. - Tier-B queries (
scripts/kql/workiq-tierB-defender.kql,scripts/kql/workiq-tierB-appinsights.kql) and, optionally, the Purview audit companion collection.
Flow steps¶
-
Trigger — Recurrence. Schedule once per day (for example 03:00 local). Nightly cadence balances freshness against telemetry-ingestion lag.
-
Initialize run context.
- Generate a run GUID (used for
fsi_runidon every row this run). - Capture the scan timestamp in UTC (used for
fsi_scantime). -
Read the
WorkIqGa20260616feature flag. While the flag indicates preview, use the preview Work IQ tool identifier (use-work-iq); after GA, use the GA identifier. Re-validate the tool identifiers and telemetry field paths at GA (2026-06-16). -
Tier-A — configuration. Invoke
Get-WorkIqConfigState.ps1(via the Automation runbook / Function). It readsfsi_copilotagent, samplesbotcomponent(component types 18 / 15 / 16) andaipluginoperation, and returns one object per agent withconfiguredTier,configEvidence,configComponentType, andcreatedIn. Do not query abot.generativeaiconfigurationcolumn — it does not exist. -
Tier-B — telemetry. Run, in parallel:
- Defender
workiq-tierB-defender.kql(Advanced Hunting): direct Work IQ tool invocations (ExecuteToolByGateway). Use a 30-day lookback. - Application Insights
workiq-tierB-appinsights.kql: production Work IQ invocations (designMode == "False"excludes maker test-canvas traffic). Use a 7-day lookback for the business-user signal and a 30-day lookback for the invoked-30d signal. -
Purview (optional companion):
CopilotInteraction/AIPluginOperationrecords for Work IQ via the audit APIs. -
Join and classify. Join Tier-A and Tier-B on the agent identifier (
fsi_agentid), scoped by environment, and resolvefsi_observedstatususing the four-state truth table inarchitecture.md: NotConfigured→ Not configured.- configured + no signal → Configured-not-observed.
- configured + direct Work IQ tool signal → Observed-invoking.
-
native-configured + only adjacent connector activity → Exception-unknown (never Observed-invoking). Record the deciding
fsi_telemetrysource,fsi_lastobservedat,fsi_distinctusercount(count only — no UPNs, to limit PII), and the lookback used (fsi_lookbackdays). -
Upsert
fsi_wiqstate. Write one row per agent for this run. Use logical names in all OData (for examplefsi_observedstatus,fsi_configuredtier,fsi_invoked30d,fsi_invoked7dbybusinessusers). Setfsi_invoked30dandfsi_invoked7dbybusinessusersfrom the Tier-B signals. -
Compute and upsert
fsi_wiqkpi. Aggregate this run into one rollup row (optionally one per zone, with Unclassified = tenant-wide): fsi_configuredcount(KPI 1),fsi_invoked30dcount(KPI 2),fsi_invoked7dbusinessuserscount(KPI 3).-
The four-state distribution counts and
fsi_totalagents,fsi_lookbackdays. -
Alert / report (optional). Surface the rollup to a Teams channel or the compliance dashboard. Highlight new Exception-unknown agents and any natively-configured agents that remain Configured-not-observed beyond an expected review window.
Operational caveats¶
- Lookback false negatives. Low-frequency agents (for example quarterly reporting agents) can appear Configured-not-observed because their last invocation predates the lookback. Treat the invoked KPIs as a floor and widen the lookback when reviewing low-frequency agents.
- Telemetry ingestion lag. Defender / Application Insights / Purview data can lag several hours; the nightly cadence is recommended to allow ingestion to settle.
- Preview connectors. The Defender
CloudAppEventsconnector is preview for some tenants at scaffold time. If it is unavailable, run Tier-B from Application Insights and Purview, and record the reduced coverage infsi_notes.