Security officers are primarily responsible for the safety of the crew aboard ship and on away team missions. Not to be confused with the Tactical Officer who is primarily responsible for the safety of the ship itself. While onboard, security officers patrol sensitive areas of the ship, are assigned to escort visiting dignitaries (or protect the ship and crew from visiting dignitaries as the case may be), and may be called upon to evacuate sections of the ship if necessary.
When there is some question as to the danger an away team may encounter, security officers are assigned to provide for team defense. They are equipped to meet the risk in whatever environment they may encounter. Security scanning, defensive perimeters, and reconnaissance are only a few of the tasks they may be assigned.
The chief security officer is normally the direct commanding officer of all security personnel. While separated from the chain of command, security officers fall under the direct authority of the team leader. During emergencies, security may be commandeered by the medical staff to assist in the transport and/or treatment of crewmen. So security officers not only need to understand the basics of crowd control and weaponry, they must also be proficient in the application of emergency first aid.
While security officers do carry the big guns, they only use those weapons for self-defense or at the direction of their commanding officer. Occasionally, security officers will be faced with situations where they have to take initiative and/or independent action for the protection of themselves or their crewmates. The basic rule of engagement in these situations is to use the least amount of force required to accomplish your mission and to protect your shipmates. A security officer who kills and maims when containment would suffice will quickly become a liability and not an asset.