Moved agent-handling into a policy.