← Blog

Route Azure OpenAI Calls with Custom Blocklist Evidence

Parminder Singh
Parminder Singh··5 min read
Summarize with AI

Azure custom blocklists are created and attached to content filters through management-plane operations, while inference calls expose only the filtering outcomes Microsoft returns. A route policy can pin an approved deployment and filter-evidence record, then classify prompt-side HTTP 400 responses separately from completion-side HTTP 200 responses with finish_reason content_filter.

AI Security Solutionsai-securityllm-securitycloud-securityarchitecturepolicy-enforcementaudit
Route Azure OpenAI Calls with Custom Blocklist Evidence

Azure custom blocklists are management-plane resources. Teams create a list and add exact or regular-expression patterns. They then attach the list to a content filter and assign that filter to a deployment. The inference endpoint then returns filtering outcomes. Those two planes produce different evidence, and a sound route policy keeps them separate.

My blunt opinion is that a green deployment screenshot without the filter attachment is decoration, not control evidence.

TL;DR

  • Create blocklists and attach them to prompt or completion filtering through Azure management-plane operations.
  • Pin each inference route to an approved Azure resource and deployment, with an API version and versioned filter-evidence record.
  • Classify a blocked prompt as an HTTP 400 content_filter outcome, while a blocked completion can return HTTP 200 with finish_reason: content_filter.
  • DeepInspect can enforce and record the route policy, but it cannot configure Azure blocklists or prove their contents from one inference response.

Blocklist configuration lives in the management plane

Microsoft's custom blocklist guide uses Azure Resource Manager routes under management.azure.com. A blocklist is created beneath a Cognitive Services account, and individual blocklist items carry a pattern plus an isRegex setting. A separate policy update attaches the named list under promptBlocklists or completionBlocklists with blocking enabled.

That sequence establishes the Azure account and blocklist as two objects worth recording. The content-filter policy and deployment are the other two. Preserve the full resource IDs and API version. Capture the policy response and a digest over the reviewed configuration. Store the approval time and collector identity beside it.

The Azure portal can support review, but the evidence should survive a portal redesign. I want a machine-readable export showing the attachment, plus a ticket or signed change record identifying the approved deployment. The Azure OpenAI security guide provides the wider identity and network context for that deployment.

Route policy pins approved deployment evidence

An inference route should resolve an authenticated application operation to a specific Azure OpenAI resource host and deployment name. Keep the filter-evidence record in controlled configuration. At request time, require its status to be current and approved for that exact destination.

A route entry should include:

  • Azure subscription and resource group, plus account and resource ID
  • Inference hostname and deployment name, plus model mapping
  • Approved API version and operation
  • Content-filter policy resource ID
  • Prompt and completion blocklist attachment names
  • Evidence digest and collection time, plus expiry
  • Authenticated roles and permitted data classes
  • Local dispositions for prompt and completion filtering

This is evidence pinning, not live proof of Azure's current configuration. A management-plane collector should refresh the record after changes to filters or deployments, including blocklist attachment changes. Route policy should fail closed or enter a documented hold state when that evidence expires.

The per-route AI policies guide explains how caller identity and application operation select one reviewed provider destination.

Prompt and completion blocks have different HTTP shapes

The same blocklist attachment can produce different inference outcomes depending on where the match occurs. Microsoft's blocklist guide shows a prompt match as HTTP 400. The error carries code: content_filter and identifies param: prompt. It also includes a nested Responsible AI policy violation with custom-blocklist details.

A completion-side match can return HTTP 200 because generation began and stopped when the blocklist matched. The response choice uses finish_reason: content_filter, and its content-filter results can identify a custom blocklist match. Transport success therefore cannot stand in for response acceptance.

Write separate parsers and route dispositions:

  • Prompt-side HTTP 400 with the documented filter code becomes a completed policy denial, rather than a provider outage eligible for blind retries.
  • Completion-side HTTP 200 with finish_reason: content_filter becomes a held or controlled response. Do not release partial content by default.
  • Other HTTP 400 responses retain their actual validation or request-error meaning.
  • HTTP 200 with another finish reason continues through the remaining output checks.
  • Missing or malformed filter annotations, including unfamiliar forms, enter an explicit schema-drift state.

Microsoft's content filtering documentation explains the broader prompt and completion filtering behavior. Keep the custom-list result as one signal inside that provider envelope.

Inference evidence has a firm limit

An inference response can show that Azure reported a filtering outcome for that call and may include a blocklist identifier. The response cannot enumerate the blocklist's patterns or prove that every approved term was present. Nor can it establish that the deployment attachment matched yesterday's review artifact.

Preserve the provider facts exactly: HTTP status and error code; prompt parameter and finish reason; custom-blocklist annotation and Azure request identifier; deployment route and response digest. Add a separate local conclusion that references the pinned management-plane evidence. Avoid flattening both into blocklist_ok: true.

On an operations screen, show the deployment name and evidence digest in a narrow gray header. Put prompt HTTP 400 outcomes in a red square labeled prompt/content_filter. Put completion HTTP 200 outcomes in amber with the exact finish_reason printed beneath. The colors help scanning; the visible strings carry the evidence.

The AI audit log schema guide provides common identity and destination fields, plus policy and correlation fields for this record.

Release tests cross both planes

Begin by reading the approved management-plane resources and confirming the blocklist attachment on the intended filter and deployment. Use a dedicated test list with controlled terms. Wait for the documented configuration propagation period before judging an apparent miss, then record the actual test time.

Run inference fixtures for:

  • A benign prompt and ordinary completion
  • A prompt matching one approved test item
  • A completion induced to match one completion-side test item
  • A route pointing to a deployment without the attachment
  • Expired or mismatched filter evidence
  • HTTP 400 caused by malformed input rather than content filtering
  • HTTP 200 with a normal finish reason and filter annotations
  • HTTP 200 with finish_reason: content_filter and partial content
  • Missing or malformed custom-blocklist details, including unknown forms

Assert provider-call count, caller response, released bytes, evidence digest, and final disposition. If streaming is enabled, test when filtering information arrives and how many bytes the application exposes before the terminal state. A release report should state that number plainly.

DeepInspect

DeepInspect can enforce this route policy on authenticated HTTP traffic deliberately routed to Azure OpenAI. It can pin the Azure host and deployment to current filter evidence, then classify prompt HTTP 400 outcomes separately from completion HTTP 200 filter stops. It can also hold responses and write a per-decision record before delivery.

Azure administrators retain authority over blocklist creation and term contents, plus content-filter attachment and deployment assignment. DeepInspect cannot configure those resources or prove their contents from an inference call. Direct Azure requests and portal changes remain outside its enforcement evidence. The same applies to HTTP paths that bypass the proxy.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

Can an inference call prove which terms are in a custom blocklist?

No. The response can report a match and may identify the custom list involved. Preserve a separately collected management-plane configuration artifact and bind its digest to the route decision.

Why can a blocked completion return HTTP 200?

Microsoft documents that completion generation can stop after a blocklist match. The operation has already produced a valid inference response, so the response can retain HTTP 200 while the choice reports finish_reason: content_filter.

Should a prompt content-filter error be retried?

Treat the documented HTTP 400 content_filter response as a completed policy outcome. Replaying the same content wastes capacity and can obscure the original event. A user may submit changed input through a new request under normal application rules.

Can one filter-evidence record cover every Azure OpenAI deployment?

Only when the collected configuration explicitly establishes each attachment and the approval covers every named destination. A safer route registry stores deployment-specific evidence. New deployments remain blocked until their content-filter assignment is collected and reviewed.