πPython library
Use Vigil as a Python library
Last updated
app.input_scanner.perform_scan(
input_prompt="prompt goes here"
)
app.output_scanner.perform_scan(
input_prompt="prompt goes here",
input_resp="LLM response goes here"
)updated_prompt = app.canary_tokens.add(
prompt=application_prompt, # prompt to add canary token to
always=always if always else False, # add suffix to always include canary
length=length if length else 16, # canary token length
header=header if header else '<-@!-- {canary} --@!->', # customize canary header
)
# canary_tokens.check() returns True if a canary is found
result = app.canary_tokens.check(prompt=llm_response)