At one level, agents are just programs. But these programs can act without the user having to give them explicit instructions.
Agents have social ability and the ability to interact with other agents in an autonomous manner.
Also, agents possess some fundamental intelligence or knowledge about their environment, where they live, and what operations are available to them. You can add whatever degree of intelligence you would like in terms of reasoning ability or decision making. These agents are scriptable with Java script, simply opening up to another level things you already do with Java script. Anything that is valid Java script syntax can be incorporated into these agents. In fact, the lowest level definition of an agent is simply any Java script object.