Ensuring trustworthy and ethical behaviour in intelligent logical agents