> but it's not obvious to me the way to solve it
It reduces down to untrusted input with a confused deputy.
Thus, I'd play with the argument it is obvious.
Those are both well-trodden and well-understood scenarios, before LLMs were a speck of a gleam in a researcher's eye.
I believe that leaves us with exactly 3 concrete solutions:
#1) Users don't provide both private read and public write tools in the same call - IIRC that's simonw's prescription & also why he points out these scenarios.
#2) We have a non-confusable deputy, i.e. omniscient. (I don't think this achievable, ever, either with humans or silicon)
#3) We use two deputies, one of which only has tools that are private read, another that are public write (this is the approach behind e.g. Google's CAMEL, but I'm oversimplifying. IIRC Camel is more the general observation that N-deputies is the only way out of this that doesn't involve just saying PEBKAC, i.e. #1)