Wireless sensor networks (WSNs) do not have a fixed infrastructure and consist of sensor nodes that perform sensing and communicating tasks. The WSNs have large application spectrum such as habitat monitoring, military surveillance, and target tracking, where sensor nodes may operate distributed in highly dynamic environments. Battery-constrained sensor nodes may aggregate the sensed data, localize themselves, and route the packets in an energy-efficient and decentralized manner to enable running the applications. Agents are capable of independent and autonomous action, so that they can successfully carry out tasks that have been delegated to them, thus agent-based approaches are very suitable to apply as the solution of the problems occurring in WSNs. So far many agent-based approaches were proposed for WSNs. This paper surveys the agent technologies for sensor networks by providing a classification, objectives and costs of these approaches with the open research problems. To the best of our knowledge, this is the first study that covers the intersection of the agent technology and sensor networks from a wide perspective.