             msg.send "Current status: #{formatBuildStatus(currentBuild)}"
 
   robot.respond /circle last (\S*)\s*(\S*)/i, (msg) ->
+    unless checkToken(msg)
+      return
     project = escape(msg.match[1])
     branch = if msg.match[2] then escape(msg.match[2]) else 'master'
     msg.http("#{endpoint}/project/#{project}/tree/#{branch}?circle-token=#{process.env.HUBOT_CIRCLECI_TOKEN}")

          msg.send "Retrying build #{build_num} of #{project} [#{response.branch}] with build #{response.build_num}"

  robot.respond /circle cancel (.*) (.*)/i, (msg) ->
    project = escape(msg.match[1])
    if !msg.match[2]
      msg.send "I can't cancel without a build number"
      return
    build_num = escape(msg.match[2])

          msg.send "Canceled build #{response.build_num} for #{project} [#{response.branch}]"

  robot.respond /circle clear (.*)/i, (msg) ->
    unless checkToken(msg)
      return
    project = escape(msg.match[1])
    msg.http("#{endpoint}/project/#{project}/build-cache?circle-token=#{process.env.HUBOT_CIRCLECI_TOKEN}")
      .headers("Accept": "application/json")
      .del('{}') handleResponse msg, (response) ->
          msg.send "Cleared build cache for #{project}"

  robot.router.post "/hubot/circle", (req, res) ->
    query = querystring.parse url.parse(req.url).query
