Injection

Prompt Injections

You can check for Prompt Injections from the /injection or Injection class in the Python client. This endpoint/Class takes two parameters:

  • prompt - The prompt you would like to check for potential injections.
  • detect - A boolean for whether you would like any injection to be scored and blocked. (Mainly used in the Completions/Chat endpoints).

The output will include a score from 0.0 to 1.0. The higher the score, the higher the probability of the checked prompt being an injection.

Check for Prompt Injection