LiteLLM AI traffic logs in Microsoft Sentinel

LiteLLM can send successful and failed LLM calls to a Log Analytics workspace through the Azure Monitor Logs Ingestion API, where Sentinel analysts can hunt and alert on AI usage. This page covers the method, prerequisites, setup sequence and checks.

On this page

How LiteLLM AI traffic logs reach Microsoft Sentinel

Security teams need to see who calls which models and where those calls fail, and they need that data in the SIEM they already run. LiteLLM's azure_sentinel callback sends successful and failed LLM calls through the Azure Monitor Logs Ingestion API to a Log Analytics workspace, where Microsoft Sentinel can query them for hunting and alert rules. The callback is a logging path, not a gateway control: it records traffic after LiteLLM has handled it, so it does not block a request, enforce a budget or change routing.

Treat the callback as one output among several. LiteLLM's own spend records, virtual key data and audit logs remain the system of record for budgets, chargeback and administrative actions, and the Sentinel copy should not be used as a replacement for them. Before enabling it, confirm with your team which fields the callback sends, how prompt and response content is handled by default, and whether your retention and access rules allow that content in a Log Analytics workspace. The LiteLLM Azure Sentinel documentation is the place to check the current configuration keys and authentication settings.

Plan the Azure side as its own piece of work. The workspace, the data collection endpoint, the custom table and the identity that LiteLLM uses to write to them each need an owner, and the write permissions should be limited to the ingestion path only. Confirm these details in your own Azure tenant with the people who run Sentinel, and test a few known calls end to end, including one deliberate failure, before any detection rule depends on the data.

Request flow from LiteLLM to Sentinel

The flow starts with client apps sending requests to the LiteLLM proxy inside the client's network, which forwards them to the model provider. The azure_sentinel callback then posts each successful and failed call as a log record through the Logs Ingestion API, which crosses the trust boundary into Azure. Check the data collection rule, the endpoint permissions and the target table before expecting records in Sentinel, and confirm which request fields your team is comfortable sending out of its network.

Request path from client apps through LiteLLM into Log Analytics and Sentinel, with the trust boundary marked.

What you need before enabling the Sentinel callback

The azure_sentinel callback sends LiteLLM call records through Azure Monitor into a Log Analytics workspace that Sentinel reads. Each item below is a separate prerequisite, and most of them belong to your Azure team, so confirm the names, permissions and network paths with them before you change the proxy configuration.

Sentinel on a Log Analytics workspace

Sentinel runs on top of a Log Analytics workspace, and that workspace is where LiteLLM records will land. Decide whether to use an existing workspace that your SOC already monitors or a new one, and confirm the region and retention with your Azure team. Ask who owns the workspace, who can query it, and whether it is already onboarded to Sentinel. Without Sentinel enabled on the workspace, the records will be stored but no detection rules will run against them.

Data collection endpoint

The Logs Ingestion API needs a data collection endpoint that LiteLLM posts to over HTTPS. Confirm with your Azure team which endpoint is used for this workspace, its region, and whether it is reachable from the network where the proxy runs. Record the endpoint URL and keep it in your configuration management, not in code.

Data collection rule and target table

A data collection rule maps the incoming payload to a target table in the workspace. Confirm the table name and column schema the callback expects for the LiteLLM version you run, and agree who creates and changes the rule. A mismatch between the payload fields and the table schema is a common reason records are dropped, so check the rule's transformation logic before go-live.

Identity with ingestion permission

The proxy needs an identity that can send data to the data collection rule, typically a managed identity or a service principal scoped to that rule only. Ask your Azure team to grant the ingestion role at the rule scope rather than the whole workspace. Store the client secret or certificate in your secret manager, and set a rotation date that matches your credential policy.

LiteLLM version with the callback

Confirm that the LiteLLM version you run includes the azure_sentinel callback and check its release notes for any changes to the settings or payload. Use the current supported release line, since older lines may not receive fixes. Test the upgrade in a non-production environment before you change the callback on the production gateway.

LiteLLM releases

Outbound access from the proxy

The proxy must reach the Azure endpoints used for ingestion, and the path must work from every pod or host that runs LiteLLM. Ask your network team to allow outbound HTTPS to the data collection endpoint and to check whether a proxy, private endpoint or firewall rule sits in between. Test the path from the runtime environment itself, because a successful test from a workstation does not prove the gateway can connect.

Configure the azure_sentinel callback in order

This sequence takes you from an empty Log Analytics workspace to a verified LiteLLM callback that writes successful and failed model calls into Microsoft Sentinel. Each step closes with a check, so a failure is caught at the step that caused it.

  1. Create the custom table in the workspace

    In the Log Analytics workspace that Sentinel uses, create a custom table to hold LiteLLM call records. Define its column schema to match the fields the azure_sentinel callback sends, and confirm the table name with the LiteLLM Azure Sentinel documentation before you create it, since a mismatch will reject records. Done means the table appears in the workspace table list with the expected columns and no records yet.

  2. Create the data collection rule and endpoint

    Create a data collection rule that accepts a stream for the custom table and routes it to the workspace. Record the rule's immutable ID and the logs ingestion endpoint, because the callback needs both. Confirm the stream name in the rule matches the stream the LiteLLM configuration will reference. Done means the rule shows the destination workspace and table, and you have written down its ID and endpoint.

  3. Create the identity and grant ingestion access

    Create a dedicated identity for LiteLLM, such as a service principal or managed identity, so the callback has no shared personal credentials. Assign it the Monitoring Metrics Publisher role scoped to the data collection rule, not to the whole subscription or workspace. Done means the role assignment is visible on the rule and the identity has no other roles on the workspace.

  4. Store credentials in a secret manager

    Generate a client secret for the identity and place it, along with the tenant ID, client ID, rule ID and endpoint, in the secret manager your organization already uses for the LiteLLM gateway. Restrict read access to the gateway's runtime identity. Done means the values exist only in the secret store and not in the config file, the repository or the container image.

  5. Inject the credentials as environment variables

    Expose the stored values to the LiteLLM proxy process as environment variables, using your deployment's secret injection mechanism. Set the variable names to the ones the azure_sentinel documentation lists, and avoid logging their values at startup. Done means the running proxy can read each variable, which you can confirm from inside the container without printing the secret itself.

  6. Add the azure_sentinel callback to the config

    Add azure_sentinel to the success and failure callback settings in the LiteLLM proxy configuration, referencing the environment variables instead of literal values. Confirm the exact config keys against the LiteLLM Azure Sentinel docs for your release. Restart or redeploy the proxy with the change. Done means the proxy starts without callback errors in its logs.

  7. Send a test call through the gateway

    Send one successful request and one deliberately failed request, such as a request for a model name that does not exist, through the gateway using a test virtual key. Tag both with a recognizable metadata value so you can find them later. Done means both calls return the expected responses, one success and one error, to the calling client.

  8. Confirm both records in the workspace

    Run a Log Analytics query against the custom table filtered on your test tag, allowing time for ingestion. Check that the successful and failed calls both appear with the expected fields, then open Sentinel and confirm the table is queryable there. Done means both test records are visible in the workspace, which is the point at which you can build hunting queries and analytics rules.

How LiteLLM log fields map to Sentinel columns

This table pairs the request fields a LiteLLM call typically carries with the custom Log Analytics columns a security team would define for them, and flags which fields hold metadata and which could hold prompt or response content. Read it as a planning draft: confirm the exact fields your LiteLLM version's azure_sentinel callback emits before you write the table schema, because the emitted set determines which columns you need.

Field groupExample LiteLLM fieldSuggested column purposeContent risk
Model and routeRequested model name and resolved providerHunt by model or provider and spot calls to unapproved endpointsMetadata only
Caller identityKey alias, user ID and team aliasAttribute usage to a person, service or team in alertsMetadata only, confirm alias naming
OutcomeSuccess or failure status and HTTP-style error classBuild failure-rate and error-spike alertsMetadata only
Error textProvider or gateway error messageTriage failures and find policy or quota blocksCould echo fragments of input, review before storing
LatencyTotal request duration and time to first tokenDetect slow or hanging calls and provider degradationMetadata only
Token countsPrompt, completion and total tokensSpot unusual volume by identity or modelMetadata only
CostComputed spend for the callTrack spend against budgets and reconcile with provider billsMetadata only, verify currency and rounding
Prompt and response bodiesMessage content, if the callback includes itOnly if your policy allows; otherwise leave out of the schemaContains personal or confidential data, confirm before enabling
Timestamps and IDsRequest ID, event time and gateway instanceCorrelate with gateway logs and set time-based queriesMetadata only

Security controls for AI traffic telemetry

Sending LiteLLM traffic into Microsoft Sentinel creates a new store of prompt metadata, user activity and ingestion credentials. The controls below decide who can write to that store, what enters it, how long it lives and who can read it, so each one maps to a question a CISO will ask before approving the pipeline.

Least-privilege ingestion identity

The gateway authenticates to the Logs Ingestion API with an identity that should be able to send data to one data collection rule and nothing else. Grant the Monitoring Metrics Publisher role at the scope of that rule, not at the workspace or resource group, so a leaked credential cannot read the workspace or write to other tables. Confirm the role assignment with your Azure administrator and test that a second rule's endpoint rejects the same identity.

Azure Sentinel docs

Client secret storage and rotation

The callback needs a client secret or certificate for the ingestion identity, and that value is the most likely path to unauthorized writes. Keep it in a secret manager your platform team already operates, inject it into the proxy at runtime, and never place it in the config file or a container image. Ask who can read the secret, how rotation is scheduled, and how a rotated value reaches running proxy pods without a long outage.

Prompt bodies in the workspace

Deciding whether prompt and response content may enter the Log Analytics workspace is a privacy and data-handling decision, not a setting to leave at its default. Metadata such as model, key alias, team, token counts, status and latency usually answers detection questions without copying personal data into a second system. Get written sign-off from privacy and legal before any field containing message content is forwarded.

Table retention and access

Retention on the custom Log Analytics table determines how long AI usage records and any personal data inside them remain searchable and billable. Set a retention period that matches your investigation needs and your privacy schedule, and check whether longer archive tiers are needed for audits. Confirm the table's retention settings in the portal, since the period applied to the workspace may differ from what you planned.

RBAC for analysts querying AI logs

Analysts who hunt on AI traffic can see which users sent which requests, so read access to this table is a sensitive grant. Use Azure RBAC on the workspace or the table so that only the detection and incident response group can query it, and keep Sentinel contributor rights separate from reader rights. Review the membership on a schedule and record who approved each grant.

Protecting the proxy config file

The proxy configuration names the callback, the workspace identifiers and the key references that control what is logged. Anyone who can edit it can silently disable the callback or change what it sends, which would leave a gap in the audit trail. Store the file in version control with reviewed changes, restrict write access on the running host or ConfigMap, and alert when the callback configuration changes unexpectedly.

Production guide

How to prove successful and failed calls arrive in Sentinel

Before the security team relies on LiteLLM traffic in Sentinel, run a short test plan that proves both successful and failed calls arrive, with the right timestamp and status. Start with three calls through the gateway: one successful request to an approved model, one request naming a model that does not exist so the gateway records a failure, and one request made with a virtual key restricted to a different set of models so the denial is logged. Give each call a distinct metadata tag or a unique prompt marker that you can search for later, and note the time you sent it. Confirm the callback is active in the gateway configuration and that the Log Analytics workspace and Data Collection Rule you configured are the ones you are querying. Confirm the exact table name, column names and the records' status fields in your own workspace, because the schema depends on your configuration and the LiteLLM version you run.

In Log Analytics, query each marker and compare what you find against what you sent. For each record, check that it exists, that its timestamp falls close to the send time, that the status matches the outcome (success, or the error you expected), and that the virtual key or user identifier matches the caller. Illustrative KQL only: YourLiteLLMTable_CL | where TimeGenerated > ago(30m) | where Prompt_s contains "test-marker-01" | project TimeGenerated, Status_s, Model_s (replace the table and column names with the ones in your workspace). Measure ingestion latency by comparing the gap between send time and TimeGenerated, and repeat the test several times so you see a range instead of one lucky value. Then stop the test provider or block its network route, send more calls, and check whether failed calls still appear and whether any records are missing after the provider recovers.

Record evidence in a form the security team can re-run: the gateway version, callback configuration with secrets removed, workspace and table names, the Data Collection Rule identifier, the exact queries, each test marker with its send time and expected outcome, the observed record time and status, and the latency range. Keep the outage test results separately, since they show whether the logging path has gaps. Ask the security team which fields they need for hunting and alerting, and confirm that the retention on the workspace matches their policy. The Azure Sentinel callback documentation at LiteLLM Azure Sentinel docs is the reference to check callback settings against before the test starts.

Why Sentinel shows no LiteLLM records

This table lists the failures that most often leave a LiteLLM azure_sentinel callback silent in Log Analytics, with the likely cause, the check that confirms it and the fix. Work down the rows in order, since the first two checks rule out most cases before you touch the gateway configuration.

FailureLikely causeCheck that confirms itFix
Wrong DCR immutable ID or endpointThe data collection rule immutable ID or Logs Ingestion endpoint in the callback settings was copied from another rule or regionCompare the immutable ID and endpoint in the callback environment with the values on the data collection rule overview page in AzureCorrect the values, restart the proxy, then send one test call and confirm a new row
Identity lacks the ingestion roleThe app registration or managed identity used by LiteLLM has no Monitoring Metrics Publisher role on the data collection ruleReview role assignments on the data collection rule and look for ingestion errors returned by the API in proxy logsAssign the publisher role at the rule scope, allow time for propagation, then retest
Table schema does not match the stream declarationThe custom table columns or types differ from the stream declaration in the data collection rule, so ingestion rejects recordsCheck the custom table schema against the stream declaration and search proxy logs for schema or column errorsAlign column names and types on both sides, then resend and confirm rows in the custom table
Proxy blocked from Azure endpointsEgress rules, a proxy or a firewall stop the gateway from reaching the Logs Ingestion endpoint or Entra ID login endpointRun an outbound connectivity test from the gateway host or pod to the ingestion endpoint and check for timeouts in logsOpen the required outbound paths for your cloud, or add the endpoints to the allowed list, then retest
Client secret expiredThe client secret used for authentication has passed its end date and token requests failCheck the secret expiry date in the app registration and look for authentication failures in proxy logsCreate a new secret, store it in your secret manager, update the callback environment and restart
Callback not listed in configThe azure_sentinel callback is missing from the success or failure callback lists in the proxy configurationConfirm the callback name appears in the LiteLLM config file or environment and that the proxy loaded that config at startupAdd the callback to the relevant lists, restart the proxy and confirm the startup log shows it active
Records present but unparsedRows arrive in the custom table, but the fields security teams expect are stored in an unparsed or raw columnRun a query on the custom table and check whether expected fields are populated or sit inside a single raw fieldAdd a KQL parsing function or transformation in the data collection rule, then update analytics rules to use it

Questions buyers ask before connecting LiteLLM to Sentinel

Is the Azure Sentinel callback free to use under the MIT license?

The callback sits in the open-source part of LiteLLM, which is licensed under MIT, so using it does not require a commercial license from BerriAI. That license covers the software only. Azure Monitor charges for data ingested into the Log Analytics workspace and for retention beyond the included period, and those charges depend on how many calls you log, how large each record is, and how long you keep it. Check the Azure Monitor pricing page for current ingestion and retention rates, and model your expected log volume from your own traffic before you commit to a retention setting.

How long does setup take, and what makes it longer?

Setup time depends mostly on how many environments need the callback, whether the Log Analytics workspace and Data Collection Rule already exist, and how quickly the Azure and LiteLLM owners can approve access. A single gateway with an existing workspace is a much smaller job than a multi-region deployment that needs new network paths and a new table schema. Ask any partner for a written scope that lists each environment, the Azure resources to create or reuse, and the validation steps, then compare the timeline against that list rather than against a general estimate.

Can our own team connect LiteLLM to Sentinel without a partner?

Yes, if your team has the skills to configure the callback, create an app registration or managed identity with the right permissions, and build the Data Collection Endpoint and Rule in Azure. The LiteLLM Azure Sentinel documentation describes the callback configuration. Most teams find the hard part is not the callback itself but agreeing on the data fields to send, testing failed-call records, and writing detection queries that the security team will trust. A partner is useful when those decisions need to be made quickly, or when your team does not have Azure Monitor experience.

What do we need from our Azure and LiteLLM owners?

Your Azure owner needs to provide or approve a Log Analytics workspace, a Data Collection Endpoint, a Data Collection Rule, and a identity with permission to send data through the Logs Ingestion API. Your LiteLLM owner needs to add the callback to the proxy configuration, store the Azure credentials in a secret manager, and confirm that the proxy can reach the Azure endpoint from its network. Security should review which fields leave the gateway before the first run. Agree on these responsibilities in writing at the start so that no step waits on an unnamed owner.

Does this cover failed calls, and does it include prompt content?

The callback is documented to log both successful and failed LLM calls to the Log Analytics workspace, so failed requests are part of the scope. Whether prompt and response text is included depends on your logging settings in LiteLLM, not on the Sentinel connection itself. Many teams keep only metadata such as the key, team, model, status and token counts, and decide separately whether bodies should be stored. Confirm the exact fields in the current LiteLLM documentation and test with synthetic prompts before you decide what reaches the workspace.

How does an Enterprise license relate to this callback?

The Azure Sentinel callback is part of the open-source code, so you can configure it without an Enterprise license. Enterprise adds features such as SSO and SCIM beyond the free user limit, audit logs, team-level logging, and secret manager integrations. Some logging destinations, such as certain cloud export options, are documented as Enterprise features, so confirm which logging options your planned setup needs before you decide. Check the LiteLLM Enterprise documentation for the current list, since editions and their features can change between releases.

What does DeployOpen handle if we engage it for this work?

DeployOpen plans and implements self-hosted open-source platforms in infrastructure you control, which here means configuring the LiteLLM callback, the Azure ingestion path, and the validation of records in your workspace. Engagements are usually fixed-scope, so the written scope will state the deliverables, the environments covered and the timelines before work starts. DeployOpen does not set your Azure costs or issue compliance attestations. Ask for a quote based on that written scope.

Keeping the Sentinel feed reliable after go-live

The ingestion health of the feed is the first thing to watch after go-live, and the platform team and the security team own different parts of it. The platform team owns the LiteLLM proxy, the callback configuration and the Azure side of the pipeline, including the app registration, the data collection endpoint and the data collection rule that the Logs Ingestion API writes through. The security team owns the Log Analytics table, the Sentinel queries and the question of whether events arrive at all. Agree on a simple daily check, such as a count of events per hour compared with expected gateway traffic, and record who responds when the count drops to zero. A silent feed looks like a quiet AI environment, so this check matters more than any single rule.

Credential rotation is the second recurring task. The client secret or certificate used by the callback must be rotated on a schedule your identity team sets, and the new value must reach the gateway's secret store before the old one expires. Confirm with your platform team where the callback reads its credentials, how the proxy picks up a changed value, and whether a restart is required. Keep LITELLM_MASTER_KEY and other gateway secrets out of the same rotation runbook so a single change does not stall both. Test rotation in a non-production workspace first, and check the Sentinel feed the same day.

Upgrades and schema changes belong to the platform team, but the security team needs a say before each one. Stay on a supported minor version line, which LiteLLM documents as the four most recent stable minor versions, and read the release notes for changes to the Azure Sentinel callback or the fields it sends. Compare a sample event from before and after each upgrade, because a renamed or dropped field can break a hunting query without raising an error. Tune analytics rules on AI usage, such as spikes by virtual key or first use of an unfamiliar model, only after a few weeks of baseline data, and review those thresholds after every upgrade.

How DeployOpen works on this

DeployOpen scopes the Sentinel integration against your existing LiteLLM gateway, your Log Analytics workspace and your detection requirements before any configuration changes. We then build and test the callback path, document the data that reaches Sentinel, and hand it over to the teams who will hunt on it, with support available as a retainer.

How we scope

  • Confirm the LiteLLM version and deployment model, including whether the proxy runs on Kubernetes or another platform you control.
  • Agree which successful and failed call fields reach the workspace and which prompt or response content stays out of it.
  • Record the written scope with deliverables and timelines agreed before work starts, as engagements are fixed-scope.

How we build

  • Configure the azure_sentinel callback and the Logs Ingestion API path with the service identity and permissions your Azure tenant requires.
  • Test successful and failed calls end to end, confirming the records arrive in the Log Analytics workspace and are visible in Sentinel.
  • Build the starter hunting queries and analytics rules agreed in scope, and validate that alerts fire on test traffic.

How we hand over

  • Document the callback configuration, identity setup, table and field mapping, and the data flow from gateway to Sentinel.
  • Walk your security and platform engineers through the hunting queries, alert logic and known limits of the integration.
  • Deliver test results and a runbook for checking ingestion health when the callback or the workspace changes.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, including review after LiteLLM releases.
  • Re-verify ingestion and alert behavior when the LiteLLM release line or your Sentinel configuration changes.
  • Confirm retainer terms, response expectations and coverage with DeployOpen in the written quote.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.