Gracie has been training with Ally Cowan at the Wind River Bear Institute. Today they're trying to herd five sheep into a wooden corral, in a grassy valley a few hours south of Glacier National Park in Montana.

"Getting a border collie to drive, basically stay behind and push forward is a bit tougher," Cowan says. "For Gracie, we are working against that instinct a little bit, because for a wild goat, we don't want her bringing them closer to people; we want her pushing them away."

The 2-year-old border collie with icy blue eyes is part of a pilot program funded by the Glacier National Park Conservancy. Encounters between visitors to national parks and wild animals can go awry. Sometimes, it's the visitors who approach the animals, but just as often it's the animals that approach the visitors. So rangers here tried something new this summer: canine "Bark Rangers." It's Gracie's job to train wildlife to stay away from popular areas in the park and teach park visitors about safely viewing wildlife.

"We did see a lot of crazy stuff up there. People getting way too close, trying to take pictures, or surrounding a goat with a kid on the outside running around crying, trying to get to mom but, you know, there's 15 people around mom taking a picture," says park ranger Mark Biel, Gracie's handler. "That's kind of unacceptable."

Mountain goats especially have taken to congregating at a parking lot at Logan Pass — the most remote and highest point you can reach in the park by car — to lick up sweet-tasting, but poisonous, antifreeze and eat the salty snacks tourists leave behind. Biel says that's a problem for the animals and for people.

"Some people don't necessarily make the connection they're still wild animals," he says. "They see them in such close proximity, they assume they're tame."

According to Dennis Madsen, who works in Waterton Lakes National Park in Canada, "this is a natural behavior that reinforces their natural instinct to behave as a prey species and show respect to the predators."

Madsen's park started using collies in 2009 around aggressive deer protecting their newborn fawns.

"Like, for everybody involved, the deer and the dogs, it only took a day or two to figure out what their role was, and after the first week, the deer really came to understand that that was the new reality in the town site," Madsen says.

Within a few years, hostile encounters between deer and people in Waterton fell from 40 each season to just four.

On a foggy morning at Glacier's Logan Pass, park interns Aleta Forkum and Marisa Morrison treat Gracie like part of the team as she and Ranger Biel make their rounds of the parking lot. They stop often to pose for selfies with visitors. Gracie even has her own Instagram account, @barkrangernps.

Gracie's popularity helps Biel connect with visitors to talk about a range of safety issues, not just encounters with wildlife.

"No one wants to talk to me, but if they see her they come up and pet her, then I've got you," he says.

Biel says Gracie is doing a good job. Goats and sheep move away farther and stay away longer than they do when Biel uses other hazing methods, like firing empty shotgun shells or waving bags. The duo visit the parking lot only once or twice a week so the wildlife doesn't get used to Gracie.

"To us she's a pretty little border collie, but to them she's a fuzzy little wolf-like thing," he explains.

Copyright 2016 Montana Public Radio. To see more, visit Montana Public Radio.