Before you run
Data & scope
- Required tables
- Time window
- 14 baseline days + 1 complete UTC analysis day, ending 1 day before today's UTC boundary
- Microsoft Copilot data connector populating CopilotActivity, with applicable Copilot licensing and Microsoft Purview auditing enabled.
- At least 16 days of retained and consistently collected data; Analytics query access for the full baseline interval.
- OrganizationId and ActorUserId populated for the activity under investigation; unidentified actors are excluded rather than merged.
Documentation review by Codex (AI). No live-tenant execution or detection-performance claim. Validate schema, data coverage and expected results in your workspace.
// Hunting starter. Documentation checked 2026-11-13; not tenant-tested.
let analysisEnd = startofday(now()) - 1d;
let analysisStart = analysisEnd - 1d;
let baselineStart = analysisStart - 14d;
let minimumAnalysisRows = 25;
let minimumRatio = 3.0;
CopilotActivity
| where TimeGenerated >= baselineStart and TimeGenerated < analysisEnd
| where isnotempty(OrganizationId) and isnotempty(ActorUserId)
| summarize BaselineRows = countif(TimeGenerated < analysisStart),
AnalysisRows = countif(TimeGenerated >= analysisStart),
BaselineActiveDays = dcount(iff(TimeGenerated < analysisStart,
startofday(TimeGenerated), datetime(null))),
ActorNameSamples = make_set(ActorName, 3),
AnalysisRecordSamples = make_set_if(RecordId,
TimeGenerated >= analysisStart and isnotempty(RecordId), 3)
by OrganizationId, ActorUserId, Workload, RecordType, AppHost
| where AnalysisRows >= minimumAnalysisRows
| extend BaselineDailyMean = todouble(BaselineRows) / 14.0
| extend VolumeRatio = iff(BaselineRows > 0,
todouble(AnalysisRows) / BaselineDailyMean, real(null)),
ComparisonState = iff(BaselineRows == 0,
"Not observed in available baseline", "Compared with fixed 14-day daily mean")
| where BaselineRows == 0 or VolumeRatio >= minimumRatio
| project AnalysisStart = analysisStart, AnalysisEndExclusive = analysisEnd,
OrganizationId, ActorUserId, ActorNameSamples, Workload, RecordType, AppHost,
AnalysisRows, BaselineRows, BaselineActiveDays,
BaselineDailyMean = round(BaselineDailyMean, 2),
VolumeRatio = round(VolumeRatio, 2), ComparisonState, AnalysisRecordSamples
| order by AnalysisRows desc, VolumeRatio desc
| take 200
Read-only query. Run in your own authorized workspace after checking prerequisites.
Use this hunt to identify a substantial change in an actor’s observed Copilot audit volume before reviewing individual events. It compares one complete UTC day with the daily mean from the preceding 14 complete days. Workload, normalized record type and host application remain separate, so a change in one activity class is not hidden inside a single cross-product total.
The table documents ActorUserId and ActorName. The query keys identity by organization and ActorUserId, retaining a few names only for context. It excludes blank identifiers instead of inventing a UserId field, treating a display name as an immutable key, or combining all unidentified actors into one “user.” CopilotActivity schema.
Compare complete windows
The analysis day ends one day before today’s UTC midnight. For a run on November 13 UTC, it examines November 11; November 12 is the intentional arrival buffer. Both baseline and analysis use event timestamps. The buffer reduces immediate incompleteness but does not guarantee that all delayed events have arrived. The date boundaries use startofday.
The baseline denominator is always 14, including days with zero observed events. Dividing only by active days would compare a complete day with a different population and exaggerate or suppress changes inconsistently. BaselineActiveDays gives additional context for a sparse history; it is an approximate distinct-day count, not proof of collection coverage.
The defaults require at least 25 analysis rows and either a threefold increase over the daily mean or no baseline rows. Zero-baseline groups receive an explicit state and a null ratio rather than an infinite numeric score. “Not observed” means absent from the available baseline, not a newly created account or proven first-ever product use.
Investigate the change
Open the sample record IDs and inspect the actual event type, actor and product context. Determine whether the workload represents user interactions, administrative activity, automated behavior or another supported audit class. The same number of audit records can represent different underlying actions across products. Microsoft documents both user and administrative Copilot auditing. Audit scope.
Compare the increase with rollout dates, license assignment, training sessions, seasonal work, new agents and approved automation. Review the relevant resource or permission context where warranted, using authorized access to the underlying audit evidence. This query does not inspect prompt contents, identify sensitive information, prove exfiltration or measure successful business actions.
Tune and validate
The ratio and row floor are investigation defaults, not validated detection thresholds. A weekday/weekend pattern, holiday, leave period or low baseline can produce a large ratio without suspicious activity. For an established production workload, evaluate comparable weekdays or a longer reviewed model before promoting this recipe into an alert.
Counts represent ingested rows and do not deduplicate RecordId. Replays or duplicate collection can inflate both periods. A connector outage can depress the baseline and manufacture a spike after recovery. Confirm source continuity using the Microsoft Copilot connector, including whether the required history and actor fields are populated.
The result is capped at 200 actor/activity groups. This read-only hunt was checked against documentation and has not been tenant-tested. Validate a stable actor, an expected increase, sparse history and incomplete collection before making operational decisions from the output.
Verify the source
Microsoft references
- Microsoft Learn — CopilotActivity table schema ↗
- Microsoft Learn — Microsoft Copilot Sentinel connector ↗
- Microsoft Learn — Audit logs for Copilot and AI applications ↗
- Microsoft Learn — Kusto startofday function ↗
- Microsoft Learn — Kusto countif aggregation ↗
- Microsoft Learn — Kusto dcount aggregation ↗
Measure normal activity, validate known test cases, account for ingestion delays, choose a threshold and entity mapping, and assign an owner. Results require investigation.
Follow the detection learning path →