CNN National Security Analyst John Kirby is a retired rear admiral in the US Navy who served as a spokesman for both the State and Defense departments in the Obama administration. The views expressed in this commentary are his own.

(CNN) President Trump made two comments Thursday in the company of his most senior military leaders. One was a rebuke. The other was a threat.

Both were incredibly irresponsible.

Let's set the stage a bit first. Every three months all the top US military commanders and service secretaries get together for an event they call the Senior Leaders Conference. They've been doing this since at least the days of former Defense Secretary Donald Rumsfeld.

It's an opportunity for the secretary of defense to lay out his vision, goals and objectives on issues that cut across many institutional lines. And the agenda is fairly tight as the group covers things like budget demands, contingency plans, and deployment operations.

As you might expect, the leaders also spend some time discussing the world's hotspots, which these days are fairly obvious: North Korea, Iraq, Syria, Iran, Afghanistan, the South China Sea and Ukraine to name a few.

About once a year it is customary for conference attendees to also visit the White House, so they can hear directly from the commander in chief and he can hear directly from them. There's a roundtable meeting closed to press where the actual business gets done and then there's usually a social dinner in the evening that offers a more relaxed and informal setting for conversation and camaraderie. Spouses are welcome, if not encouraged, to attend the dinner.

It was in the context of these two gatherings that President Trump made his unwise comments. The first came in the roundtable meeting earlier in the day when, in the presence of reporters and cameras, the President admonished his military leaders to more quickly bring him military plans and options.

Here's what he said: "Moving forward, I also expect you to provide me with a broad range of military options when needed at a much faster pace. I know government bureaucracy is slow but I am depending on you to overcome the obstacles of bureaucracy."

He read this off a sheet of paper. So, clearly it was premeditated. But even if his complaint has merit -- all presidents want more options -- it was completely inappropriate for him to publicly rebuke his military leaders in this fashion.

Trust and confidence

The military culture thrives on many virtues. Two of them are trust and confidence. And when you reach the rank of an admiral or a general, it doesn't take much criticism from your superiors for you to begin to question the degree to which you retain his/her trust and confidence.

To whomever wrote that line for President Trump, it may have seemed like a neat way to exert his authority or prove who's boss. To those senior officers around the table, it must have felt like a gut punch.

They don't need any reminders about who the boss is. They know very well.

And if they needed reminders about being quicker to provide options to the boss -- and that's a big "if" given what I know about Secretary of Defense James Mattis and the other leaders around that table -- those reminders should have been proffered privately, away from the cameras.

For crying out loud, Mattis doesn't even like to talk openly about the numbers of troops he deploys to operational theaters, so worried is he that he might tip off the enemy. What sort of message does it send our adversaries when the President of the United States says he isn't getting military options fast enough?

And then there is just the whole propriety of the thing. I learned as a young ensign aboard my first ship the central leadership maxim that a good officer praises in public and criticizes in private.

Would that our commander in chief do the same.

'Calm before the storm'

The second irresponsible comment uttered by President Trump came right before the dinner as photographers were grabbing shots of his guests. Surrounded by all those stars and medals and ribbons, he just couldn't resist.

"You guys know what this represents?" he asked playfully. "Maybe it's the calm before the storm."

The calm before what storm? He wouldn't say. Could be North Korea, Iran, a new push against ISIS in Syria. Then again, it could also be nothing -- a show for the cameras.

Remember, this was a dinner party not a war council. We have to allow for the very real possibility that, finding himself up there in that glittering dining room amidst all those glittering uniforms, Mr. Trump decided on a whim to wrap himself up in a jingoistic cloak.

Follow CNN Opinion Join us on Twitter and Facebook

Either way -- at a time when thousands of American troops serve in harm's way, when ISIS still poses a real and credible threat to us and to our allies, when tensions are at their worst on the Korean peninsula, and when nation-state competitors like China and Russia continue to pursue every possible advantage over us -- the man with his finger on the nuclear codes, the man ostensibly in command of the most powerful armed forces the world has ever known shouldn't make vague and idle threats about anything.

Incredibly irresponsible, both the rebuke and the threat.