Apple's PR machine is the envy of Silicon Valley, in part because of its ability to keep new products under wraps until their official unveiling. How does the company avoid leaks that plague other tech heavyweights? Fortune editor Adam Lashinsky's looks into the "cultish" world of Apple in his new book (excerpted here), Inside Apple: How America's Most Admired — and Secretive — Company Really Works. Here, four ways Lashinsky says Apple manages to keep its secrets:

1. New recruits are kept in the dark

"Much of the orientation is standard big-company stuff: A welcome package with stickers saying you've joined Apple, HR forms, and the like," says Lashinsky at Fortune. But many new hires are brought in for "so-called dummy positions," or roles that aren't explained in detail until after new employees have signed a contract. "They wouldn't tell me what [the job] was," recalls one former engineer on his first day. "I knew it was related to the iPod, but not what [the position] was."

2. Employees are literally walled in

"Buildings will be physically changed to suit a new project," says Josh Lewnsohn at CNET. New walls are erected almost overnight, complete with doors and brand new security protocols — much to the chagrin of existing employees. Transparent windows are either blurred or removed entirely in order to keep prying eyes "in the dark." Apple calls these "lockdown rooms," says Lashinsky. "No information goes in or out without a reason." All existing employees can do is assume a new "highly secretive project is under way, and you are not in the know," he says. "Like a horse fitted with blinders, the Apple employee charges forward."

3. You have to sign your life over

The company warns employees up front not to reveal any secrets, and doesn't hesitate to fire anyone who breaks the rules. Says one former employee, "You had to sign extra-special agreements acknowledging that you were working on a super-secret project and that you wouldn't talk about it to anyone — not your wife, not your kids." Steve Jobs kept the onus on individual employees to keep their mouths shut. "Anything disclosed from this meeting will result not just in termination," he'd say, "but in the prosecution to the fullest extent that our lawyers can."

4. Apple borrows from the CIA

Apple even keeps tabs on employees outside of work hours. The company employs security officers disguised in plain clothes to patrol "loose talk at the pub across the street from the Cupertino campus," says Erick Schonfeld at TechCrunch. That's just one of many surveillance techniques that "sound like they were borrowed from the CIA or a 'terrorist organization.'" It's true, says another former worker. "At Apple, people are so committed that they go home at night and don't leave Apple behind them. What they do at Apple is their true religion."

Sources: CNET, Fortune, International Business Times, TechCrunch