Well, the generated code did correctly sandbox shell invocations exactly as I asked. Should have left that detail out from my comment though, as it’s irrelevant to the point I was trying to make whether the code was generated or handwritten. See sibling reply for context.