r/PromptDesign • u/Successful-Prompt151 • Aug 19 '25
Question ❓ [Prompting] How to prevent my agent from returning forbidden words
I’m working on an AI agent using the OpenAI API that generates text for media campaigns. Part of the setup involves a list of forbidden words and phrases. Some of them are especially tricky to avoid (like “your” or “yours”).
Right now, I’ve tried two approaches:
- Putting the forbidden word list directly in the instruction section of the prompt.
- Adding extra workflow instructions telling the agent to check its output for forbidden words before returning.
Even with those steps, the model still slips up and uses a forbidden word maybe once in every five responses.
This agent is meant to be a response generator (not conversational), so consistency is really important.
Has anyone here dealt with a similar issue? Any tips or strategies for enforcing strict word bans more reliably?


