Federal courts have "inherent power" to sanction those who appear before them. This power, "shielded as it is "from direct democratic controls," is said to have vested in courts"by their very creation" under Article III. Typically constrained only by basic notions of procedural due process, federal courts may invoke their inherent power to hand out all manner of sanctions, including sua sponte dismissal of a case with prejudice.
Timothy K. Lewis & Bradley A. Nankerville, Redefining Inherent Power: Belated Thoughts on the Second Circuit's Decision in Reliastar, 7 Y.B. Arb. & Mediation 66 (2015).