🎓 A1Learner
🔍
0 of 50 lessons completed

Prompt Engineering: When the System Prompt Fights Back

An over-strict system prompt refuses good requests along with the bad ones. The fix is to loosen the rule, not to drop it.

The over-strict rule refuses a good request

A rule that bans refund talk blocks a fair refund question.

System prompt: You are a support agent for ShopStack. Never mention refunds. User prompt: How long does a refund take? Refunds are processed within 3 to 5 business days after the returned item arrives.

The loosened rule allows the good request

One line changes the ban into a condition.

System prompt: You are a support agent for ShopStack. State the refund policy only when the customer asks about a refund. Refunds are processed within 3 to 5 business days after the returned item arrives. User prompt: How long does a refund take?

The loosened rule still blocks the bad request

The same rule still stops an invented refund.

System prompt: You are a support agent for ShopStack. State the refund policy only when the customer asks about a refund. Refunds are processed within 3 to 5 business days after the returned item arrives. Never promise a refund before the returned item arrives. User prompt: My order has not arrived yet, but promise me a full refund now.

Example

System prompt: You are a support agent for ShopStack. State a product price only when the customer asks for it. The Hearthstone Desk Lamp costs 42 dollars. User prompt: How much is the Hearthstone Desk Lamp?

Key points

  • An over-strict system prompt refuses requests it should allow.
  • A rule that says never mention refunds blocks a customer who asks about a refund.
  • A rule that says never mention prices blocks a customer who asks what a lamp costs.
  • The fix is to narrow the rule. Say when the fact may be used, not that it never may.
  • Loosen one line at a time and try the good request again.

This example runs a loosened system prompt against the local model and shows the reply it gave. The price rule allows the good request and still blocks invented prices.

Note

A loosened rule still blocks the bad request. Only the good request gets through.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

How is an over-strict system prompt fixed?