I was in error. Section 31 is actually a department of Starfleet.
No, it isn't. Section 31 is a rogue organization that has no authorization to exist.
They claim that they have, but they are lying. All that the actual Section 31 of the Earth Starfleet Charter - the EARTH Starfleet Charter, I might add, not the Federation Starfleet Charter - ever said, was that allowances can be made for bending the rules in times of dire emergency. It gave NO authorization for the existence of the organization we know as Section 31.
They are Federation citizens, part of Starfleet, working on behalf of the Federation's interests.
They are working on behalf of their OWN interests, nothing more. They literally do whatever they want. They have no oversight, no accountability to the Federation government. Hell, they once had a SPY inside the President's cabinet!