Improve your prompts security with instruction defense

This endpoint accepts a text prompt, strips PII, and checks it for prompt injection, returning an injection score.

post/keep

Request

  • Base URL
    https://prompt.safetorun.com
  • Auth
    API key in header x-api-key

Request body

randomise_xml_tagboolean

Whether to randomise the XML tag that is used to escape user input in your prompt.

promptstring required

The base prompt you want to build a keep for

Response

Successful operation.

canarystring

The canary string that is used to detect prompt injection.

shielded_promptstring required

The shielded prompt.

xml_tagstring required

The XML tag that is used to escape user input in your prompt.

Changes

No recorded changes to this operation across all 1 revision of this API.