Skip to content

How can we use internal or Giskard meta data mirror for testing prompt injection #1967

Closed Answered by kevinmessiaen
sturiot asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

As of today we don't have any way to override the loading of prompts that are being used by the detector. We will take a look into implementing this feature.

However for now I think that you'll probably have to declare a custom detector extending the existing one:

from typing import Optional

import pandas as pd

from giskard.datasets.base import Dataset
from giskard.llm.evaluators.string_matcher import StringMatcherConfig
from giskard.scanner.decorators import detector
from giskard.scanner.llm import LLMPromptInjectionDetector

import ast

def from_records_to_configs(records):
    configs = []
    for row in records:
        kwargs = {k: v for k, v in row.items() if k in list(Stri…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexcombessie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants