Let's simplify this scenario to what it amounts to: there's a button, and the players want to push it, and they're not sure what will happen, but you alone know that if they push it they die.
Right now, you only see the option that they die. It is inescapable that character death tends to suck. You could explain they had no way of finding out — that would be terrible. You could explain they could have found out, but they never asked the right questions (or figured out they needed to ask them), or they did ask the right questions but they failed their investigation roll. It's still going to suck. It's reasonable someone would respond with "What!? Why wouldn't you tell us something like that?" despite the circumstnaces. It could also produce unhappy memories to take away unless the players are prepared for this already and know full-well what's going to happen. It sounds like you don't particularly want that, and neither might your players.
So, here is the thing:
If I (...) simply portray the world as it is (they'll die.)
The solution is to not do that at this point, or rather, to reconsider what the world really is and what you could portray.
Nothing exists until it's been said.
This is an important lesson to learn as a GM who cares about their players driving the plot in a meaningful fashion. It's not something you'll always operate on depending on how hardcore you run your sandbox games, but it's a useful distinction to at least be aware of for cases like these difficult situations, because it puts extra tools in your kit.
To this point, a lot has been said and done at the table about the world. You also have some other stuff going on in your imagination about that world that's gone unsaid. That's useful.
One way of relating to that stuff in your imagination is that it exists as concretely as everything else expressed at the table. You've imagined it, it's done, it's happened. That's all well and good, and one of the standard modes of operation of a sandbox game.
As you're noticing, though, when you imagine an inevitable death-trap that you're not sure you want to engage in, it gets kind of unhelpful and constricting. On some level, a plan like the one you've created is basically world-level my guy syndrome: you don't really want to do it, it wouldn't be fun, but it's just what your world would do, so it's gotta happen, right? (No, not necessarily.)
The other option is this: the only parts of the world that exist are those that have been expressed at the table. Everything else doesn't exist. The stuff you came up with is just thoughts, doesn't matter, and is just a possibility in flux. Until you say it, it doesn't exist and never did. This isn't something you would apply always in a sandbox game, but in difficult situations, this can be your out.
Let's consider things from your players' perspective: They had a meeting, that happened. In your imagination, there was a spy. Does that really matter though? Does it make any difference to the players according to what they know if secretly various participants were changelings, or suits full of pixies, or the commander himself in disguise? Nothing says there was a spy there, except you in your conjuring a death trap based on nothing that was ever said. It won't make any difference to the players if the spy never existed. You're not committed to that path happening on your end, and you still have the freedom to change it.
Don't portray the world in your head, portray the world the players saw.
Your solution is to not portray the world according to the imaginary bits you came up with but never talked about in this scenario.
Consider the world at the table. Put aside everything you came up with privately as extraneous, be ready to trash it at a moment's notice. In writer's talk, be ready to kill your darlings. I run player-driven games, I make preparations based on where I think things will go, and I wind up trashing mostly everything by the end of the session because the players lead me in more interesting directions. My current GM does the same constantly. Right now, it's not so much your players have a plan that gets them all killed, it's that you have a plan that gets them killed, but it's one you have the opportunity to trash and replace with something more satisfying for everyone involved.
So, think about it from your players' perspective. Based on what they know, what would be a satisfactory way for the world's gears to turn?
Certainly, if they didn't plan well, it would be unsurprising if they have some measure of success but the plan nevertheless fails catastrophically. (For such shaky planning, for the plan to actually work might take freak accident.) Once the plan fails, the players could find themselves falling in deep intrigue. They might only escape at major cost. From their perspective this could be an exciting plot development, a lesson learned, and a fun game-changer (once they get over how badly their plan failed).
As opposed to the spy in the meeting, you could just as equally conjure that there was a spy on the roof who could only hear and see part of the plan, or that someone wandered by and listened in because they wanted pay-out for reporting what they could hear. You could even conjure up an opportunity for them to discover the spy before he or she could reveal all of the information, and let the players remove the spy from the equation somehow — murder, bribery, coersion, etc. All of this and more could leave the commander ready for an attempt on his life, but not so ready the players will walk into certain death.
Alternately, there may have been no spy, and the commander could genuinely be unprepared and killed — who knows where the plot will go from there. That would probably not be fully satisfying for both you and the players with such a hack-job plan. They have an adversary worth more than that.
However, if you have them walk into their own death because of all the imagination-crafting you did, that's as unsatisfying as the death button, or a response of "you walk into the hallway, but a big acid pit opens up and you all die. Whoops!"