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
15 stars 10 forks source link

Prevent mutating state reset template #798

Closed chriswilty closed 7 months ago

chriswilty commented 7 months ago

Description

There was a problem that we only saw in remote deployment, in which the state object we were using in resetting the game progress could be mutated, resulting in chat persisting even after a reset. The first reset worked ok, but all subsequent ones would be corrupted, due to the way module loading works.

I have corrected the "fresh state template" object to be a function that always returns a new copy.

Resolves #787

Checklist

Have you done the following?