Skip to content

Could you explain how does these lines protect against prompt injection? #129

Discussion options

You must be logged in to vote

Ultimately an app has to assume rogue input from both users and language models. You can create your own translator object that hardens against malicious user input in some way. That's not something we've worked on, but it would be interesting to see examples of where that's worked.

But instead of thinking about hardening against bad inputs, TypeChat really provides tools to help handle where things can go bad in case either the user or the language model act in a rogue way:

  1. The output produced must still be parsable. If it's not, then an app has to be able to gracefully handle the failure.
  2. The parsed output must be validated against your schema. If it's not, repair will take place, but …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AllanOricil
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