Watching parents or aunts and uncles trying to get out of sticky social engagements as a kid taught me that prearranging a code is very helpful indeed. Any mention among the adults of “Aunt Jo” at a social functions was code for one of the kids to develop a severe tummy ache.
The child I raised was given two code phrases one meaning ‘things are fine’ the other meaning ‘get me outta here!’ They were actually meant for a Liam Neeson moment in Taken and thankfully were never needed. One of them was used far too frequently in this way: “Gary’s mom has asked me to stay for dinner and have liver! And guess what, their umbrella is dry!”
In addition, ironically just this morning I was reading my new copy of The Three Musketeers translated by Lawrence Ellsworth in chapter XLVIII A Family Affair when the protagonists were at the siege of La Rochelle and needed to communicate by letter and after several failed suggestions the poet, future churchman, and temporary Musketeer wrote the most innocent epistles which conveyed dire warnings and direct instructions in the words of small talk to minor characters who were superficially insignificant to the intrigue at hand and which would escape notice by even the most suspicious prosecutor.
I also seem to recall from decades ago that Twain had Tom and Huck hiding in a cave with desperate men who would and could do them harm if they were discovered. One boy had a horrible itch and the other a strong need to sneeze but escaped after what seemed like days of denying themselves the release they needed. I cannot help in that kind of situation, I am just not clever enough. But if ideas can be exchanged by characters talking to anyone other than who they NEED to communicate with there are a thousand devices. For example, the two friends fighting each other is overused and painfully transparent but could be adapted I would think.