From Hidden Frontier
Starfleet Security is a branch of Starfleet responsible for maintaining security.
Aboard Starfleet-run facilities and vessels, security personnel serve functions both defensive and offensive, ranging from security patrols on board a starship, to guarding prisoners, to firing the ship's weapons, to providing protection during landing party/away team missions, and more. In the 24th Century the officer in charge of security on a starship was given the title of Security Chief.
Starfleet Security is not only responsible for Starfleet security, but also some Federation outposts, starships, and facilities. In this function, they are analogous to local and regional police agencies. The agency is responsible for maintaining and enforcing Starfleet Security regulations, procedures and policies on all Starfleet and affiliated facilities, outposts, and vessels. In addition, this agency is responsible for security clearances of all Starfleet and Federation personnel.
The agency, in close cooperation with Starfleet Intelligence, is responsible for counter-intelligence operations. The agency is also responsible for the security of the Federation President, as well as members of the Federation Council and visiting dignitaries.