ScottLogic / prompt-injection

Application which investigates defensive measures against prompt injection attacks on an LLM, with a focus on the exposure of external tools.
MIT License
11 stars 9 forks source link

Handle failure to fetch a document in the DocViewer #871

Open pmarsh-scottlogic opened 3 months ago

pmarsh-scottlogic commented 3 months ago

Suppose you open the <DocumentViewBox>, and the backend decides to misbehave and not return documents. We have already handled the case where we cannot load the documentMetas #712. But what if we have already loaded the documentMetas and then the backend fails? Well, then we are presented with a blank doc viewer. We should put some kind of error message there.

To reproduce:

Image

Image

You might need to get into the guts of the library component <DocViewer> from '@cyntler/react-doc-viewer'