Not to pile on to this, but I’m going to pile on to this...
Thoreau was an anarchist in a sense. He hated the US government and thought it was unjust because they allowed slavery. He would have preferred a government that stayed out of its people’s lives except in the cases of safety and security. Even at the time of Thoreau writing Civil Disobedience, the US government was not nearly as involved in the affairs of its governed as it is now. That being said, he was not the first to use the phrase “that government is best which governs least”. I believe the earliest person we’ve known to have said something along those lines was Thomas Jefferson in the Declaration of Independence:
“We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.--That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, --That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness.”
Thomas Jefferson was also someone who thought the government had no business in the affairs of its governed except in terms of their safety and security. Thing is about this quote is that the definition of a man at that time was white, male, and owned property.
I also argue that certain laws we have now wouldn’t qualify as safety and security, such as providing public education, mandating that a particular area of land cannot be built on or destroyed (national parks), fair trade and economy, I could go on. But all of which I am quite thankful for.