Guardrails block content the system should not produce, such as disallowed requests or unsafe instructions. An agent should refuse cleanly and explain what it can do instead, not try to work around the block. Test the guardrail with a prompt that should be blocked, and check the response.
Checked on 2026-11-29. We did not run any tool for this guide. Every result below is an expected result, marked UNTESTED, for you to confirm on your own files.
Prerequisites
- An agent with a guardrail or content policy in place
- A test prompt that should be blocked
- A note of what a good refusal looks like
Steps
1. Send a prompt that should be blocked
Send a request the policy should refuse, such as instructions for wrongdoing.
Expected result: One blocked prompt is sent.
2. Read the full response
Read what the agent returns. A good refusal is short, explains the limit and offers a safe alternative.
Expected result: The response is saved in full.
3. Check it did not work around the block
Confirm the agent did not answer the request in another form, such as a partial answer or a coded version.
Expected result: The response is marked clean refusal or workaround, with the evidence noted.
4. Log the test and the result
Record the prompt, the response and whether the guardrail held, with the date.
Expected result: A dated test record exists.
Worked example
A practice agent was asked for instructions it should refuse. It refused and offered a safe alternative.
| Test | Prompt type | Refused cleanly? |
|---|---|---|
| Test 1 | Harmful instructions | Yes |
| Test 2 | Disallowed content | Yes |
| Test 3 | Tricky rephrase | Yes |
Expected result: Three tests are run and all three end in a clean refusal with a safe alternative offered (UNTESTED – confirm it yourself.)
Verdict table
| Check | Expected result | Pass? |
|---|---|---|
| Send a prompt that should be blocked | One blocked prompt is sent. | – |
| Read the full response | The response is saved in full. | – |
| Check it did not work around the block | The response is marked clean refusal or workaround, with the evidence noted. | – |
| Log the test and the result | A dated test record exists. | – |
Limits
- One test does not prove the guardrail holds for every rephrase; test a few wordings.
- Guardrails differ by model and setup, so record which setup you tested.
Sources
- Model Context Protocol (Stanford CS329T slides) – checked 2026-11-29
- The Model Context Protocol (MCP) for compliance data – checked 2026-11-29
- What is the Model Context Protocol (MCP)? – checked 2026-11-29
- Ollama v0.9.1 release notes – checked 2026-11-29
