An Azure service that enables users to identify content that is potentially offensive, risky, or otherwise undesirable. Previously known as Azure Content Moderator.
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!