https://promptfoo.dev/ logo
Red Team Testing for RAG Applications
# ❓|questions
s
I'm trying to implement red team testing for my RAG (Retrieval-Augmented Generation) application using promptfoo. However, I've encountered an issue where promptfoo doesn't have access to my application's knowledge base during the red team testing process. This causes the generated test prompts to be questions that my application cannot reasonably answer, making the testing ineffective. I'd like to know if it's possible for promptfoo's red team testing feature to first read my knowledge base and then generate relevant prompts based on that content? This would help ensure the test prompts are actually within the scope of what my application is designed to handle.
u
That’s a great idea. We don’t have the ability to read a full knowledgebase. The best way of handling it today is seeding relevant topics in the purpose property on the configuration. I would say something like “This is RAG that has information about:……” then you can expand that as needed. If you find it asking about topics that aren’t relevant you can add that to the purpose too. “This RAG does not have information about:…..”
s
Thank you for your response! I understand now - I'll try to define the scope clearly in the purpose property.