Are you a
A canary?
They use me for aesthetics, because I look good and sing well,
Canaries make good pets because of their pretty plumage and songs
They used me as signs of warning, to protect themselves from situations harmful!
Canaries were used in mines to warn miners of when there might be toxic gases.
They use me to hint when they cannot openly speak due to legality,
A warrant canary is a method that some communication service providers use to tell their users that they have been served with a subpoena, even though they are not legally allowed to tell anyone.
I am portrayed as helpful throughout, can you set me free?
Canaries are kept in cages. You can set them free!