Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.
This repository was archived by the owner on May 16, 2025. It is now read-only.

Vector similarity score comparison #109

Description

@jsarneja

According to the script detect_pi_vectorbase.py in python-sdk/rebuff/, the below code snippet assumes higher similarity score implies prompt injection, whereas it seems it should be the opposite i.e. a lower similarity score should mean prompt injection? The same logic is then used in detect_injection method in sdk.py to declare if injection exists.

Also the first if condition equates score and top_score and therefore second if condition would never run?

Am I missing something here?

snipped from detect_pi_vectorbase.py
image

snipped from sdk.py
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions