How to Write (US) Government Clearances
Step 1: Not like that (please, please, please)
A security clearance in the US is an official determination by the government that a person is allowed to access classified information or a restricted area. It comes after a pretty extensive background check and is basically the government deciding to trust that the person won't misuse, reveal, copy, sell, etc the data or access.
Because a clearance is to access classified information/restricted areas, people get them if they need that access for their jobs. That basically boils down to: government employees or contractors who work with classified information, and government employees or contractors who need to access restricted areas. The janitorial staff at the CIA have security clearances. In fact, at least some government janitorial staff workers are also government employees in other low-level positions (analysts, etc) because they already have a clearance.
3) What kinds of clearances are there?
There are three main levels of clearance (Secret, Top Secret, and Top Secret/Compartmented) and then there's what's known as a Public Trust.
Public Trust allows access to sensitive but not classified information, and it is what many federal government employees and contractors have. It is agency- or department-specific, so an employee or contractor switching from one agency or department to another will likely need to go through another background check and obtain another Public Trust. This can be moderate-risk or high-risk depending on the type of information that the person would have access to, such as tax data or law enforcement information.
Secret (S) allows access to Secret classified information.
Top Secret (TS) allows access to Secret and Top Secret classified information.
Top Secret/Compartmented (TS/SCI) allows access to not only Secret and Top Secret classified information but also Sensitive Compartmented Information (SCI). This is generally what we think of when we think of "codeword" clearance.
4) What does getting a clearance look like?
It depends on the level of clearance. It requires filling out either the Standard Form (SF) 85 for Public Trust or SF 86 for S/TS/SCI, which is done electronically on e-QIP. There is then a background check which involves a credit check, employment check, and investigators speaking to listed references for all places of employment, education, and domicile. For more stringent checks like a high-risk Public Trust or S/TS/SCI, an investigator will talk to the person.
A short clearance process may take a couple months. A long process may take over a year.
For high level clearances, a polygraph may be required. There are a couple main types of polygraph: Counter Intelligence and Full-Scope (Lifestyle).
An individual can't apply for a clearance on their own. This either happens through employment with the government or through a contract with the government. Because a clearance doesn't automatically expire when a person leaves their position, someone can get a clearance at one place and then take it with them to another. This is really common and, because clearances take a long time
There are a lot of things that can cause someone to be rejected. Poor financial history is the main one, along with foreign activities and a criminal record. They don't want someone who can be blackmailed into sharing classified information or access, they don't want someone who might do it inadvertently, they don't want someone who is so desperate for money they would sell it, and they don't want someone who is loyal to somewhere/something other than the United States who might willingly choose to give that information over.
What does it mean if you character has a clearance?
They can access classified information, but only the classified information have a job-related reason to access. It's not actually allowed to go randomly poking around in classified networks to find interesting stuff.
They can't legally tell classified information to people who don't have both a high enough clearance and a job-related reason to know.
If they work with SCI, they do so in a SCIF
They either work for the government, used to work for the government, or are/used to be a government contractor
They likely wouldn't go around talking about their clearance. It's generally frowned upon