In this paper, the automatic customization of an agent-based medical system is approached by means of ontologies. The particular case of Home Care studied and developed in the EU K4Care project, is presented. The customization is achieved by means of generating individual versions of a reference ontology, called Actor Profile Ontology, which defines the behaviour of the actors in the multi-agent system. The paper, analyses the usability and advantages of this customization in order to add flexibility and adaptability to the system. It also shows how the personalized ontology is able to represent the liabilities and permissions of a particular user, providing the base for automatically generating the behaviour of the corresponding personal agent. A tool, called ATAPO, is also presented. It has been designed to assist the user in the personalization process. The way how this tool interacts with the system to permit the online modification of the behaviour of the agents is also discussed....