Brazil pledges Olympic security after Rio violence