I believe that the ideas or concepts at the heart of most of the Torah laws were sent by God to the prophets who wrote the Torah. But I believe that those prophets, as human beings with flawed understandings, limited comprehension, and free will to interpret, wrote the laws in the forms that we have.
Furthermore, when it comes to depictions of God's behavior in the narrative sections of the Tanakh, I think it is necessary to remember that they are either metaphorical and poetic, or so interpretive as to be literary supposition. The stories are written by people, about their ancestors' interactions with God: there may be certain grains of truth at the heart of the stories, but they are not there either to serve as a history or science book, nor to accurately and literally depict the true nature of the One God. They are there to teach moral, ethical, and spiritual lessons, using the language and narrative structuring of people living 3000 years ago. Thus, they require extensive interpretation to be understood relevantly, and cannot simply be read in a vacuum, like a newspaper article.
In short, God may have been the source of the law, but the laws as we know them were shaped by mortal men.