---
name: iblai-connect-microsoft-sentinel
description: "Read and write Microsoft Sentinel data through the Microsoft Sentinel REST API (Microsoft.SecurityInsights) and Azure Monitor Logs query API and expose it to an ibl.ai agent as an MCP tool. Use when the user asks an agent to work with Microsoft Sentinel data, or to set up a Microsoft Sentinel MCP connection on ibl.ai."
metadata:
  kind: guide
---

# Microsoft Sentinel connector for AI agents

> A starting point maintained on ibl.ai at https://ibl.ai/developer/connectors/microsoft-sentinel — not part of the iblai/base repository. Checked against Microsoft Corporation's documentation on October 20, 2026; test it against your own Microsoft Sentinel setup before you rely on it.

Microsoft Sentinel is a cloud SIEM on a Log Analytics workspace. It stores security logs queried with KQL, plus incidents with their alerts, entities, bookmarks and comments, analytics rules and automation playbooks.

## Auth & conventions

- **API:** Microsoft Sentinel REST API (Microsoft.SecurityInsights) and Azure Monitor Logs query API (REST (Azure Resource Manager)). ARM operations on a workspace: list, get, create or update and delete incidents, list an incident's alerts, entities and bookmarks, and run a playbook (api-version 2025-09-01). The Logs query API runs KQL at api.loganalytics.azure.com/v1/workspaces/{id}/query.
- **Base URL:** https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.OperationalInsights/workspaces/{workspace}/providers/Microsoft.SecurityInsights/
- **Access:** Issued by your administrator. The customer's Azure tenant registers a Microsoft Entra app and grants it a role on the Sentinel workspace; the workspace owner decides what the app can read and change.
- **Auth:** Microsoft Entra ID OAuth 2.0 (client credentials); Microsoft Entra ID OAuth 2.0 (authorization code with PKCE). ARM calls use an Entra token with the user_impersonation scope or an app role assignment. The Logs query API takes a Bearer token from client credentials or auth code with PKCE; new role assignments can take minutes to apply (403 meanwhile).
- **Limits:** Incident lists return at most 1,000 items per page via $top, then nextLink with $skipToken. The Logs query API enforces per-workspace limits on concurrency, result size, query duration and throttling rate.
- Keep Microsoft Sentinel credentials in environment variables or the ibl.ai credential store. Never print a token in chat and never commit one to a file.
- Destructive or outward-facing calls are marked **Confirm with the user first** — do.

## Reads

- **Incidents** — GET .../incidents with $filter, $orderby and $top (max 1,000 per page; follow nextLink).
- **Incident alerts and entities** — List Alerts and List Entities on an incident, plus its bookmarks.
- **Log data (KQL)** — POST a KQL query and timespan to the Logs query API; results return as tables of columns and rows.
- **Incident details** — Severity, status, owner, classification, tactics, alert count and related analytics rule IDs.

## Writes

- **Assign or update an incident** — Create Or Update sets owner, severity, labels or status to Active.
- **Close an incident** — Create Or Update with status Closed and a classification such as FalsePositive. **Confirm with the user first.**
- **Delete an incident** — Incidents - Delete removes the incident. **Confirm with the user first.**
- **Run a playbook** — Run Playbook triggers an automation playbook on an incident, which can change other systems. **Confirm with the user first.**

## Expose it to an ibl.ai agent (MCP)

Microsoft Corporation publishes an official MCP server, Microsoft Sentinel MCP server (https://learn.microsoft.com/en-us/azure/sentinel/datalake/sentinel-mcp-overview). Register it below as-is, or host your own server that wraps the calls in this skill.

First install the ibl.ai platform skills and connect your organization (writes `IBLAI_ORG`, `IBLAI_USERNAME` and `IBLAI_API_KEY` to `.env`):

```bash
npx skills add iblai/base --all
# then, in your coding agent:
/iblai-api-login
```

Every call below sends `Authorization: Api-Token $IBLAI_API_KEY`.

1. **Register the server** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-servers/` with `name`, `url`, `transport` (`sse` | `websocket` | `streamable_http`) and `auth_type` (`none` | `token` | `oauth2`). Capture the returned `id`.
   - Microsoft Sentinel supports per-user OAuth: `auth_type=oauth2` with `auth_scope=user` and a linked `oauth_service` makes each person connect their own account in the chat. It needs an `auth_{provider}` credential in the organization's credential store first.
2. **Create the connection** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-server-connections/` with `server`, `scope` (`platform` | `mentor` | `user`), `auth_type`, and either `credentials` + `authorization_scheme` or a `connected_service` id for OAuth. Credentials are masked on read; never send a masked value back.
3. **Enable it on the agent** — `GET https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mentors/{agent_id}/settings/`, add `mcp-tool` to `tool_slugs` and the server id to `mcp_servers`, then `PATCH` the full lists back. They are replaced, not merged.

Full reference: https://ibl.ai/developer/platform/mcp/mcp-connections and the `/iblai-api-agent-mcp` skill.

## Example prompts

- "List new High-severity incidents from the last 12 hours, newest first"
- "Summarize the alerts and entities on incident 3177 for the shift handoff"
- "Run KQL to count sign-in failures per user over the past day"
- "Draft a weekly report of incidents closed as false positives, by analytics rule"

## Guardrails

- Sentinel logs and incidents reveal an organization's systems, users and weaknesses. Grant agents least-privilege workspace roles and keep their actions in the Azure activity log.
- Request the narrowest Microsoft Sentinel scopes or role the task needs, and prefer a read-only credential for agents that only answer questions.
- Return the fields the user asked for, not whole records; do not paste personal data into chat that the user did not request.
- Before any write, show the user exactly what will change and wait for a yes.
- Respect the documented limits above: page through results and back off on rate-limit responses instead of retrying in a loop.

## References

- Sentinel Incidents REST API: https://learn.microsoft.com/en-us/rest/api/securityinsights/incidents
- Azure Monitor Logs query API overview: https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/overview
- Microsoft Sentinel MCP overview: https://learn.microsoft.com/en-us/azure/sentinel/datalake/sentinel-mcp-overview
- Microsoft Sentinel MCP server: https://learn.microsoft.com/en-us/azure/sentinel/datalake/sentinel-mcp-overview
- This connector on ibl.ai: https://ibl.ai/developer/connectors/microsoft-sentinel
- ibl.ai MCP server connections: https://ibl.ai/developer/platform/mcp/mcp-connections
