Great question.
The answer is it depends.
The idea is to pick the logic behind what WHICH is referring to. If there is no confusion then it is okay:
The box of toffees, which are made of caramel, is kept on the table --> CORRECT
The box of toffees, which was gifted to me, is kept on the table --> CORRECT
Here are a few official examples.
1) "Which" referring to the object of the prepositional phrase:
https://gmatclub.com/forum/construction ... 95982.html2) "Which" referring to the subject of the prepositional phrase:
https://gmatclub.com/forum/emily-dickin ... 10142.htmlHope this helps,