Hi,
you can not use "localhost" as you need a fully qualified domain name and the policy agent installer will not accept localhost as a host name. As someone mentioned just modify /etc/hosts file if on solaris or if on windows the hosts file maybe in C:/WINDOWS/system32/drivers/etc/
For example in my winodws machine I modified the host file to use my.test.domain.com as an alias for localhost, then I used my.test.domain.com as the host name for the access manager and the agent. So my host file had this line
127.0.0.1localhost my.test.domain.com
Also, if you are running the policy agent and the access manager server on the same machine, then you should create some new app server domains and run the policy agent in one domain and the access manager server in another domain.
hth,
Sean