← Sentinel query library

Cloud control plane · Microsoft Sentinel

Investigate AI deployment and safety-policy management changes

Review recorded deployment and responsible-AI policy mutations under Cognitive Services accounts while separating management evidence from inference traffic.

Before you run

Data & scope

Required tables
AzureActivity
Time window
24 hours
  • Azure Activity export from the relevant subscriptions to AzureActivity in this workspace.
  • Query access and at least 24 hours of retained Administrative activity; portal Activity Log alone does not populate this table.

Documentation review by Codex (AI). No live-tenant execution or detection-performance claim. Validate schema, data coverage and expected results in your workspace.

Kusto Query Language
Download .kql
// Hunting starter. Documentation checked 2026-11-13; not tenant-tested.
AzureActivity
| where TimeGenerated >= ago(1d) and TimeGenerated <= now()
| where CategoryValue =~ "Administrative"
| where OperationNameValue in~ (
    "Microsoft.CognitiveServices/accounts/deployments/write",
    "Microsoft.CognitiveServices/accounts/deployments/delete",
    "Microsoft.CognitiveServices/accounts/raiPolicies/write",
    "Microsoft.CognitiveServices/accounts/raiPolicies/delete")
| extend ChangeFamily = iff(OperationNameValue has "raiPolicies",
    "Responsible-AI policy", "Model deployment")
| project TimeGenerated, ChangeFamily, OperationNameValue,
    ActivityStatusValue, ActivitySubstatusValue,
    SubscriptionId, ResourceGroup, ResourceId = coalesce(_ResourceId, ResourceId),
    Caller, CallerIpAddress, EventDataId, OperationId, CorrelationId
| order by TimeGenerated desc
| take 200

Read-only query. Run in your own authorized workspace after checking prerequisites.

Use this inventory when a model endpoint behaves differently, a deployment disappears, or a safety configuration changes outside the expected release process. It selects four explicit control-plane actions: deployment writes and deletions, and responsible-AI policy writes and deletions under Cognitive Services accounts. These permissions are documented in Microsoft’s AI role reference.

Know what the query does not infer

A deployment write may create or update a deployment. The operation name does not tell you whether its model, version, capacity or associated policy changed. A responsible-AI policy write likewise does not establish that filters became weaker. Recover the approved before-and-after configuration and inspect the actual differences.

This recipe is intentionally narrower than every resource carrying an “AI” label. It does not cover all Azure Machine Learning deployment families, hosted-agent objects or future provider operations. Extend the explicit list only after observing the relevant management action and checking the provider permission reference.

Inference calls, prompts, responses and actual downstream tool actions are not reconstructed by these management records. Do not interpret a deployment’s existence as evidence of usage, or its deletion as proof that previously returned data was removed elsewhere.

Reconstruct the release decision

Compare event times and callers with the approved deployment run. Confirm the intended account, deployment identifier and environment. Examine whether an unexpected identity could modify a serving dependency while bypassing application release checks.

Retain lifecycle status rather than collapsing all events into success. A Started or failed write can explain a disrupted rollout without proving that a new configuration became effective. Use operation and correlation identifiers to retrieve surrounding records, and read the authoritative current deployment state separately.

For a confirmed change, re-run the relevant authorization, retrieval and adversarial acceptance checks against the selected deployment. A model version change can alter behavior even when the application code is unchanged. Document the actual evaluated configuration and rollback decision.

Tune and validate

Expected model upgrades, scale adjustments and policy maintenance are common benign causes. Scope exceptions to approved deployment identities and targets, with a release record rather than a broad trust assumption.

Validate a historical successful write, a failed update and an approved deletion. Confirm each status remains distinguishable, then compare the returned resource with the service’s management inventory. The query scans 24 hours and returns up to 200 rows. It is documentation-checked but not tenant-tested, and it does not assess model quality, policy effectiveness or whether a prompt was unsafe.

Verify the source

Microsoft references

  1. Microsoft Learn — AzureActivity table ↗
  2. Microsoft Learn — AI resource permissions ↗
  3. Microsoft Learn — AI built-in role permissions ↗
Before turning a hunt into an alert

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 →