SANTA CLARA, Calif. -- The San Francisco 49ers have had a rocky offseason with key players dealing with off-the-field issues.

As the team left its mandatory three-day minicamp Thursday -- a break that will last until July 23, when veterans report for training camp -- coach Jim Harbaugh gave his players a pointed message.

"Beware with whom you associate," Harbaugh said of his message to players. "It's very important to know your surroundings. Friend or foe? There always seem to be a foe. Get in football position. See around corners, under doors, and anticipate. But mainly surround yourselves around good people."

Before the San Francisco 49ers broke from minicamp, coach Jim Harbaugh delivered a pointed message after an offseason in which key players dealt with off-field issues. Christian Petersen/Getty Images

Harbaugh's words resonated with quarterback Colin Kaepernick. Earlier this month, Miami police ended a two month-plus investigation of a possible sexual assault by not charging Kaepernick along with 49ers receiver Quinton Patton and Seattle receiver Ricardo Lockette. There was no evidence of wrongdoing found in the investigation.

Asked if he is more careful of his surroundings, Kaepernick said: "A lot more."

"Since I've really started playing, it's something I've been more aware of, and especially in the past few months, it's something obviously you have to be very aware of," he said.

Pass-rusher Aldon Smith is set to be sentenced on three felony gun charges on July 25, which is the 49ers' second day of training camp practices. Smith said Harbaugh's message was a strong one for everyone on the team.

As for his sentencing and a potential NFL suspension, Smith said: "I don't know what's going to happen.

"I'm going to enjoy my month. I'll work out and stay here."