# Computational Accountability in MAS Organizations with ADOPT
## 4 The ADOPT Accountability Protocol
### Role Adoption  
The first phase of the protocol, reported in Figure 1, regulates the interaction that occurs when a new agent joins an organization by adopting an organizational role. The organization provides the context that gives significance to the actions that will be executed, thus satisfying Principle 1. Moreover, an agent will have an impact inside an organization only if the role adoption is successful, thus satisfying Principle 2. The interaction pattern follows the well-known Contract Net Protocol (CNP) [48; 49]. (In the description of the messages we omit those arguments of the FIPA speech acts that  
Figure 2: The second phase of the accountability protocol (goal agreement). are not strictly necessary to manage accountability.) There are two different types of agents, one initiator and one or more participants. CNP provides a means for contracting as well as subcontracting tasks, where the initiator is the agent willing to delegate the task and participants are contractors. In our case, the organization is the initiator, the agents in the system are participants and the task corresponds to role adoption. The messages that are exchanged in this phase are the following:  
* _call_for_proposal(adopt_role(Ag, R))_: this message notifies an agent \(Ag\) that the organization \(Org\) is looking for someone to play role \(R\). A specification of \(R\) is provided, including the set \(P_{R}\) of the powers a player of that role will be provided with. Such powers allow a role player to operate in the organizational context, and the role player will have to commit towards the organization for their use, thus becoming accountable to the organization (see _propose_). We invoke a knowledge condition, and stipulate that an agent can only be accountable for exercising the powers that are publicly given to it by the roles it plays, thus realizing Principle 3. * _refuse(adopt_role(Ag, R))_: with this message the agent declares that it is not interested in playing role \(R\). * _propose(adopt_role(Ag, R))_: this message is, instead, used by an agent to candidate for playing role \(R\). This amounts to creating a commitment \(C_{1}=C(Ag,Org,accept\_proposal(adopt\_role(Ag,R)),\bigwedge_{pwr_{k}\in P_{R}}C (Ag,Org,C(Ag,Z,pwr_{k}),pwr_{k}))\). In the following we denote by \(C_{2,k}\) the inner commitment concerning power \(pwr_{k}\). Note that this commitment amounts to a declaration of awareness by the agent to the organization of the powers it has, and also that it will exercise such powers when requested by the legal relationships it will create towards other principals. In this way, the agent's behavior becomes accountable towards the organization itself. * _reject_proposal(adopt_role(Ag, R))_: with this message the organization rejects the agent's proposal. * _accept_proposal(adopt_role(Ag, R))_: with this message the organization accepts the agent as a player of role \(R\). The commitment \(C_{1}\), having the organization as creditor and the agent as debtor, will be detached. * _inform(done(adopt_role(Ag, R)))_: this message from the agent notifies the organization that the agent has successfully adopted role \(R\), and creates all the commitments \(C_{2,k}\) with \(pwr_{k}\in P_{R}\). Commitment \(C_{1}\) is satisfied. * _failure(adopt_role(Ag, R))_: this message from the agent notifies the organization that the role adoption operation has not succeeded. This means that \(C_{1}\) will not be satisfied. We assume that _reject_proposal(adopt_role(Ag, R))_ is mutually exclusive with _accept_proposal (adopt_role(Ag, R))_, and also that _failure(adopt_role(Ag, R))_ is mutually exclusive with _inform (done(adopt_role(Ag, R)))_. This means that the occurrence of _reject_proposal(adopt_role(Ag, R))_ will make \(C_{1}\) expire. Instead, occurrence of _failure(adopt_role(Ag, R))_ will cause the violation of \(C_{1}\), neglecting what was previously stipulated. After the role-adoption phase is successfully concluded, the organization can request the agents to pursue goals.