Merge pull request #1030 from shenrie/master

Refactored agent policy for direct access
Move agent connection failure tests to better module.
Refinement to agent policies