NFL Commissioner Roger Goodell, shown earlier this year, has an elaborate security network in place that is supposed to protect the league’s reputation from legal incidents like the ones in the news this week. (John Raoux/AP)

Larry Wansley convinced himself long ago that three hours’ sleep is plenty. His thoughts kept him up anyway, but even if he did drift off, the chances were good that the phone — always next to his ear, whether at home or in a hotel room — would ring.

Sometimes it would be a contact in the Dallas Police Department; other times there’d be a nightclub owner on the other line. So rather than close his eyes and take his chances, the Dallas Cowboys’ longtime security director learned to stay up and wait.

“All my professional life,” Wansley said, “has basically been on call, responding to situations that take place and addressing them, resolving them.”

Wansley is one member of a vast network of problem solvers who work security in one capacity or another for the National Football League. America’s most popular sports league is also one of its more valuable companies, generating about $10 billion in annual revenue, and behind the scenes is an intricate and largely secretive three-layered security force — mainly comprised of former federal agents — in charge of staying in front of the league’s problems.

Its emphases are swiftness and thoroughness, its tentacles reaching into states even without an NFL team, its code mostly one of silence. And while its agents can help keep bad actors from ever getting to the league by vetting them beforehand, they are equally if not more valuable in funnelling information back to the league office once problems occur to help make sure NFL leaders are not caught off guard.

At the first game since Ray Rice's release from the Baltimore Ravens, female fans share mixed reactions to the video that showed him knocking out his then-fiancee and the NFL's treatment of the former-star player. (Whitney Leaming/The Washington Post)

But this past week, something somehow slipped through the fine mesh barrier of “The Shield’s” shield, apparently catching even the NFL by surprise — something that, by design of its security apparatus, should never happen.

Ray Rice, the former Baltimore Ravens running back, punched his then-fiancee during a February dispute in an Atlantic City casino elevator; this much the Ravens and the league office knew. On Monday the Web site TMZ published previously unreleased — and, the league has insisted, unseen by anyone in its office — video from inside the elevator.

Rice was subsequently released by the Ravens and suspended indefinitely by the league, which suffered another black eye Friday when news surfaced that a grand jury had indicted Minnesota Vikings running back Adrian Peterson for allegedly striking his 4-year-old son with a tree branch. Peterson turned himself in, posted bond and was released 30 minutes later.

The NFL and its commissioner, Roger Goodell, faced heavy scrutiny this past week because of the incidents themselves — but also for how they collect information and what is done with it.

‘It’s set up just like the FBI’

The uppermost level of the NFL’s security department is based at the league’s New York City headquarters and is comprised of about a dozen employees — the NFL won’t give a precise number — most of them decorated former law-enforcement officials. Jeffrey Miller, its chief security officer, was once Pennsylvania’s state police commissioner; his lead investigator is John Raucci, a former assistant director of the Federal Bureau of Investigation, where he was the bureau’s top agent in London and helped coordinate the 2012 Olympics. Despite the bona fides, only the most potentially damaging cases — Michael Vick’s involvement in a dog fighting ring, former Ravens linebacker Ray Lewis’s connection to a double murder in 1999, the New England Patriots videotaping opposing teams’ signals in 2007 — typically lead to loafers-on-the-ground investigations by the league office’s security staff.

Another specialist within the league office, a former FBI agent, oversees security for the NFL draft and the Super Bowl, the league’s most visible events, often making preliminary plans years in advance. Another official supervises security at each of the league’s 32 stadiums, according to an individual familiar with the staff’s organization.

On top of the FBI flavor inside the league office, a former FBI director will now be taking a deep look into how the NFL handled evidence in the Rice case: On Wednesday, the league appointed Robert S. Mueller III, who led the Bureau for a dozen years, to oversee an independent investigation.

The Post Sports Live crew looks at which games will be the ones to watch for in Week 2. (Post Sports Live/The Washington Post)

Before Miller was elevated to senior vice president in 2011, the league’s three previous security directors — Jack Danahy, Warren Welsh and Milt Ahlerich — were all former FBI executives, and when they built the second, considerably broader level of the NFL’s security machine, they used a familiar blueprint.

Each NFL team is assigned a contractor, along with an associate investigator, to act as the league’s eyes and ears (many teams hire their own in-house security experts to protect their interests). Of the consultants assigned by the league, many have experience in federal law enforcement agencies — most commonly the FBI — and their directive is to establish knowledge of and comfort within the local legal setting. They get to know the area’s information brokers, and after player arrests or potential incidents of misconduct, the representative ferrets out information — often details that would never be made public — with the intention of sharing it with the league office.

“You were the liaison between the league and the team,” said Bill Mattingly, a retired FBI agent who served as the NFL security representative to the Indianapolis Colts for more than two decades until 2008. “If players got arrested you’d find out the details and tell the league.” Mattingly has also done work for the National Basketball Association.

Each consultant is assigned a broader geographical area to monitor in addition to the confines of each team’s headquarters. The league stations a representative in both Honolulu and Las Vegas because, though there’s no team within hundreds of miles of either city, players might visit and could be tempted to find trouble. It’s also helpful to the league if its envoy is familiar with the local courts — any advantage to reach its prime directive: protecting the reputation of the league.

“It’s set up just like the FBI,” said another former NFL team official. “Think of the 32 teams as field offices.”

The official, like more than a half-dozen other current and former people involved in NFL security interviewed for this story, spoke on condition of anonymity so he could talk more openly about an organization that rarely shares specifics about how it operates.

Many of the NFL security representatives contacted declined to talk about what they did for the league, referring all questions to the league office. An NFL spokesman declined to make league security staff members available for interviews.

One current team consultant said he spends most of his time offering guidance to players: which parts of town to avoid, the restaurants or bars where an athlete is more likely to find trouble, which friends or family might be stealing the player’s money or using his name to acquire favors. “You’re there to protect the players, to keep them out of trouble and make sure they don’t get scammed,” Mattingly said.

Another team’s consultant said he spends much of his time at the stadium on game day helping with security.

If a player is arrested, it’s the security contractor’s job to monitor the proceedings but also to be hands-on: pull police reports, work his legal contacts for insight that might not be made public and, as quickly as possible, a former team official said, contact the league office to “report anything that’s serious and potentially embarrassing.”

One current representative referred to himself as a kind of risk manager, an operative in a high-level business that sees facts as invaluable — particularly when they’re acquired and delivered before the situation is in full view of the public. Most of those contacted by The Post refused to discuss the Rice case, but one former league official expressed confusion as to how the NFL found itself in such a bind. The confusion was only deepened by the fact that the incident occurred inside a casino.

‘Assets protection’

To be sure, the NFL in recent years has found itself trying to manage situations that exploded out of control: Vick went to prison in 2007 for dogfighting, and former New England Patriots tight end Aaron Hernandez has spent more than a year in jail as he awaits a trial for his alleged role in multiple murders. Both players were vetted before their respective drafts, a former security official said, but teams took chances on them nonetheless.

“It sounds trite when one or two of them screw up,” the former official said, “but the expectations are so damned high on NFL players, the public expects: ‘Why can’t they just behave?’ ”

When they do misbehave — and NFL players have been arrested 38 times so far this year, according to a USA Today database — the league puts an emphasis on knowing and evaluating its challenges before anyone else. “There’s so much information that’s rumored every day about players and conduct, and part of what’s important is to evaluate what’s real and what isn’t,” said a current team contractor.

Although the Rice case and its aftermath raised questions about coverups and whether the NFL is interested only in information that supports its public-relations message, the league-assigned contractor insisted he has never been pressured by team or league officials to bury information or corrupt an investigation. Sure, there are favors, he said, adding that they’re minor: a heads-up to the assigned team’s executive or coach about a looming player suspension, for instance. “Nobody likes to be blindsided,” he said.

The NFL security consultant said he feels loyalty to the players, too, and if an athlete faces a legal problem the liaison might broker a meeting with a trustworthy attorney or, if the player is considering an investment, offer to investigate a company. Another day might send him to a college town in his territory to begin vetting a potential draft pick, and from there the report would be part of a prospect’s profile before a team decides whether to avoid him or take a chance. The work is expected to be thorough and fast, drawing little attention. “They’re not calling up the media,” said one person who spent years inside the system. “You would be fired. It’s confidential work.”

It’s also reliant on impressive credentials. According to examinations of many consultants’ backgrounds, one team-appointed liaison spent years in the Drug Enforcement Administration, another in the California justice department; two others were formerly deputy police chiefs in New Orleans and Charlotte, and others oversaw high-level investigations in Massachusetts, Tennessee and Michigan. Although law enforcement training is not required, according to someone familiar with the system, understanding of law enforcement is. It doesn’t hurt to have a hefty résumé when seconds count.

“When you walk into the local police department and you’re either former FBI or NYPD,” the former NFL team official said, “it can open doors.”

Occasionally, though, such a sprawling web finds itself in tangles. Teams are encouraged to hire their own in-house security director, such as Wansley with the Cowboys, though the league does not mandate qualifications and rarely vets potential candidates, sometimes leading to confusion about jurisdiction. The NFL does not forbid teams from bringing in a player whose background shows red flags, though the league itself carries much of the blame when a player breaks the law.

Wansley was a former undercover FBI operative who, during a hiatus from the Cowboys, oversaw global security for American Airlines. Although his priorities are different from those working to protect the interests of the league — Wansley’s boss is Cowboys owner Jerry Jones, not Goodell, and the team has its own brand and philosophies to consider — he said his job description is similar to the representative assigned to Dallas by the NFL.

“Assets protection,” said Wansley, who once pulled Hall of Fame Coach Tom Landry off the sideline and strapped a bulletproof vest to him after a series of death threats. “It’s players, but everyone included in the organization. I hate to put it that simply, but it is. And that includes the integrity of the organization, the business itself, and it’s simply that straightforward.”

Wansley, who said he rarely attempts sleep before 3 or 4 a.m., said that in his line of work he must always be ready to confront surprises. The goal each day and night, he and others said, is to get in front of every potential threat — ideally even before they happen.

“If the program is working, you’re serving everyone the same,” the league-assigned security consultant said. “If you can be proactive, and if you can prevent a guy from screwing his life up or screwing up the brand, whether it be the [team] or the league, that’s the purpose.”