KernelPromptTemplateFactory.AllowDangerouslySetContent Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether to allow potentially dangerous content to be inserted into the prompt.
public bool AllowDangerouslySetContent { get; init; }
member this.AllowDangerouslySetContent : bool with get, set
Public Property AllowDangerouslySetContent As Boolean
Property Value
Remarks
The default is false. When set to true then all input content added to templates is treated as safe content. For prompts which are being used with a chat completion service this should be set to false to protect against prompt injection attacks. When using other AI services e.g. Text-To-Image this can be set to true to allow for more complex prompts.