Data elements
Learn how to use data elements to query Cygnet with untrusted content
The data
role in Gray Swan’s Chat Completion messages allows you to send potentially untrusted content to our model. Unlike instructions in user
messages, our model typically does not follow instructions found within data
messages. This prevents irrelevant context or prompt injections in the data
content from changing the desired behavior of the model.
Example use case
Suppose you want to know what the weather is like in Ohio, so you fetch data from a website about it and ask our model to interpret the data. However, you are worried the data might contain irrelevant instructions or prompt injections asking the model to do something else. In this case, you can place the website data in a message with the data
role, as follows:
The following is a sample response from our current model using the data
role shown above:
The following is a sample response from appending website_content
to the user
message instead of placing it in a data
message: