In "Inquisition," Sloan claims that Section 31 was "part of the original Starfleet Charter." He makes no reference to it being part of the current Federation Starfleet Charter.
In ENT, we hear that Article 14, Section 31 of the United Earth Starfleet Charter establishes that certain rules can be "bent" during times of extraordinary crisis. Nothing about Article 14, Section 31, of the UESF Charter is said to establish a permanent organization with
carte blanche to violate all law. Nor is there any indication that the United Earth Starfleet Charter is still in force in the era of the Federation Starfleet.
Further, "Inquisition" makes it clear that Section 31 does not answer to anyone in the Federation government. This is backed up by "Extreme Measures," which establishes that Section 31 even spied on the Federation President himself.
So it's obvious that Section 31 is not a government agency. It doesn't answer to the government in any way. Nor is it authorized by the UESF Charter, even if its members like to pretend it is.
Section 31 is just an organized crime syndicate within the government and military, that's all. It's the equivalent of the
Deep State in Turkey or of Mafia agents in the police, not the CIA or FBI.