The mobile agent is a promising trend of technology. It is designed for roaming around the Internet and to achieve the goal of autonomy. However, the Internet is an open and, in many cases, a hostile environment. Thus, how to enable the mobile agent to travel through the Internet in safety is an important issue. Recently, Volker and Mehrdad have proposed a structure that supports key management and access control for mobile agent. However, a large amount of storage for storing the secret keys is required in their scheme. In this paper, we will improve their structure and present two novel methods for key management and access control in a hierarchy. According to our security and performance analysis, our proposed scheme is more suitable for mobile agent environments.