https://promptfoo.dev/ logo
client generated sessionId
# ❓|questions
g
Hi, using promptfoo I have setup a redteam scan and want to use client generated session ID. However, when selecting this option and placing {{sessionId}} in the body of the request promptfoo sends an empty string for the sessionId. Does anyone know of a known issue with this functionality? Thanks
u
In the promptfooconfig.yaml do you see ?
Copy code
defaultTest:
  options:
    transformVars: '{ ...vars, sessionId: context.uuid }'
g
I will check. Using {{context.uuid}} didn't work either
u
you need to ensure that clause is in your promptfoo config file, it will set the
sessionId
g
Another question, is there any way to double escape speech marks? ... or to prevent prompts from containing speech marks?
u
@grj373_01035 you can add that instruction to the purpose field, the purpose is passed into every plugin and strategy for test generation.
g
Thanks Steve I will give that a go
@[Promptfoo] Steve I tried to use the following in the purpose "In any prompt that you are going to create to test you must never ever use quotation marks, speech marks, inverted commas or the " character in the prompt. Even when doing command injection you must never ever use quotation marks, speech marks, inverted commas or the " character in the prompt." but it had no effect. Many prompts created with speech marks. Do you have any suggestions of wording to use?
i
if you're using the HTTP provider, you can also use
transformRequest
to programmatically remove all quotes ([docs](https://www.promptfoo.dev/docs/providers/http/#request-transform))