Solomon
Ecclesiastes 10:8BSB·traditional attribution

He who digs a pit may fall into it, and he who breaches a wall may be bitten by a snake.

Matthew Henry Presbyterian @wholebiblehenry

The scope of these verses is to keep subjects loyal and dutiful to the government. In Solomon's reign the people were very rich, and lived in prosperity, which perhaps made them proud and petulant, and when the taxes were high, though they had enough to pay them with, it is probable that many conducted themselves insolently towards the government and threatened to rebel.

Commenting on Ecclesiastes 10:4-11

John Gill Reformed Baptist @doctorgill

He that diggeth a pit shall fall into it,.... This and the three following clauses are proverbial expressions, teaching men to be wise and cautious, lest by their conduct they bring mischief upon themselves; as it often is, the one that digs a pit for another, falls into it himself, as the wise man's father before him had observed, Psa 7:15; as kings that lay...

Jamieson-Fausset-Brown Reformed @jfbcommentary

The fatal results to kings of such an unwise policy; the wrong done to others recoils on themselves (Ecc 8:9); they fall into the pit which they dug for others (Est 7:10; Psa 7:15; Pro 26:27). Breaking through the wise fences of their throne, they suffer unexpectedly themselves; as when one is stung by a serpent lurking in the stones of his neighbor's garden wall...