US cyber attacks would be public, because other countries are always looking to point out that the US does this too, to help justify their bad behavior. And the USG typically leaks what it does anyway, to get control of the narrative. For example, the 2019 cyber attack against Iran for attacking Saudi oil fields:
The United States carried out a secret cyber operation against Iran in the wake of the Sept. 14 attacks on Saudi Arabia's oil facilities, which Washington and Riyadh blame on Tehran, two U.S. officials have told Reuters.
www.reuters.com
And then there's the famous Stuxnet attack on Iran centrifuges over a decade ago, but you can search around for a long time and you will see very few reports of cyber attacks by USG agencies.
But the evidence shows the US is mostly the country attacked, not the attacker. And we're so lame that we still have completely inadequate defenses. Why is critical infrastructure on the public internet? So dumb...