Agent randomly fails with: This interaction was blocked by a safety and security control in this asset's Foundry guardrail.

Nuno Monteiro 0 Reputation points
2026-05-06T17:35:00.19+00:00

Hello,

I have two Foundry agents with the same instructions, tools and guardrails (Microsoft.Default). One processes car data, and the other processes motorcycle data.

The car agent works consistently, but the motorcycle agent randomly fails with:

This interaction was blocked by a safety and security control in this asset's Foundry guardrail.

In Kusto/Application Insights I can only see:

"error.type": "content_filter"

I cannot find the actual reason for the block: no category, severity, intervention point, or indication of whether it was triggered by the input, tool call, tool response, or output.

Where can I see the detailed guardrail/content filter result for a blocked agent interaction? How can I identify what part of the request is causing the issue?

Thank you
Best Regards

Content Safety in Foundry Control Plane
Content Safety in Foundry Control Plane

An Azure service that enables users to identify content that is potentially offensive, risky, or otherwise undesirable. Previously known as Azure Content Moderator.


2 answers

Sort by: Newest
  1. Anshika Varshney 15,625 Reputation points Microsoft External Staff Moderator
    2026-05-11T17:48:06.32+00:00

    Hi Nuno Monteiro,

    Thanks for sharing the details. This type of error “this interaction was blocked” usually happens because of safety filtering in Azure AI / Foundry Agents, not because your agent logic is wrong.

    Let me explain and guide step by step.

    1. Why this error happens

    In Azure AI, every request goes through content safety checks before and after the model runs.

    • Your input is checked first
    • Then the model output is also checked

    If anything looks risky or sensitive, the system blocks the interaction. [learn.microsoft.com]

    Even normal prompts can sometimes get blocked because the system is strict and may detect a false positive.

    Also, in some cases this block happens before model execution, which is why:

    • no tokens are generated
    • request looks like it failed randomly

    This behavior is seen in Foundry Agents as well.

    2. Common triggers (even if your intent is valid)

    From experience, these are common reasons:

    • Certain keywords that look sensitive (even in normal context)
    • Prompts related to security, calculation, system actions, etc.
    • Multi-step or unclear prompts that confuse the filter
    • Slight variations in wording (same intent but different phrasing works)

    This is because Azure evaluates content using categories like:

    • violence
    • harmful actions
    • unsafe instructions

    and blocks anything above threshold. [oneuptime.com]

    3. How to troubleshoot this

    You can try below steps:

    Check the exact prompt

    • Try simplifying the prompt
    • Remove sensitive or ambiguous words
    • Test small variations of the same request

    Test in model playground vs agent

    • If it works in model but fails in agent
    • then it is likely agent-level safety or guardrails

    Break your request into smaller parts

    • Instead of one big prompt, try step-by-step queries
    • This reduces chances of triggering filter

    Review logs or traces (if enabled)

    • Look for status like “blocked” or “content filtered”
    • This confirms it is safety layer, not runtime issue

    Retry logic

    • Sometimes this happens intermittently
    • Retry may work due to probabilistic evaluation

    This is expected platform behavior:

    • Azure AI uses built-in content filtering and Responsible AI policies
    • It is designed to block anything that might be unsafe
    • So occasional false positives can happen

    These filters act as a protective layer for all requests. [learn.microsoft.com]

    5. Best practice going forward

    • Use clear, specific prompts
    • Avoid ambiguous or sensitive wording
    • Add context like “for educational purpose” when relevant
    • Design your app to handle blocked responses gracefully

    Hope this helps clarify the behavior. Do let me know if you have any further queries.

    Thankyou!

    Was this answer helpful?


  2. Babafemi Bulugbe 4,025 Reputation points MVP
    2026-05-07T05:53:05.63+00:00

    Hello Nuno Monteiro

    Thank you for reaching out to the Microsoft Q&A forum.

    Foundry does not currently expose detailed guardrail/content‑filter results (risk category, severity, intervention point, or triggering text) for blocked agent interactions. Only the high‑level "error.type": "content_filter" appears in logs.

    To diagnose the root cause, you must use manual isolation, intervention‑point logging, and custom guardrails to surface more detail.

    The safest practical approach is to add application level tracing around the agent run. Log the user input, retrieved data, tool call arguments, tool response, and final output candidate. Then replay failing examples while relaxing one control at a time to identify whether the trigger is from the motorcycle input, the retrieved or tool data, or the generated output.

    Let me know if this helps.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.