Section 31 is a covert organization within Starfleet Intelligence with the purpose to protect The United Federation of Planets by any and all means they deem necessary. Officially they do not exist and Starfleet has been reluctant to admit to any knowledge of them. Section 31 claims to solve problems within the Federation that no one even knew existed. They will often also do the "dirty work" of the Federation, dealing with known problems in ways that are unacceptable to the Federation.
The group has no headquarters or base of operations, making it hard to identify the members. It has very few members and even of those very few know the extent of their operations. they do appear to have access to near limitless resources and unchecked total access to all of the Federation and Starfleets inner workings.
Recruitment of new agents had to be done in secret. One method they employ for recruitment is use personal problems of potential recruit as a weapon. Most often Section 31 will be fully or partially responsible for creating these problems without the knowledge of the recruit. Then they will show up and offer what appears to be an easy solution where no one else will help.
Section 31 was founded somewhere during the 22nd century. Section 31 took its name from Article 14, Section 31 of the Starfleet charter, which allowed certain rules of conduct to be "bent" during times of extraordinary threat.
Section 31's activities in the 23rd century are largely unknown as the organization was not revealed to non-31 personnel until a century afterwards.
During the 24th century the inner machinations of Section 31 were brought into the open several times.