For use in this quest, here is a reference of some bullet points regarding the code of conduct for the townguard's training. This will be covered in the handbooks given to you by Councilman Grue.
Guard Code of Conduct
-Entrapment: It is NOT entrapment to lay a trap for a criminal already pre-disposed to breaking the law, while it is when using methods of coercion to do so. Examples: Offering to sell contraband to somebody who accepts and arresting them is NOT entrapment. Telling them that you'll kill their loved ones if they don't comply certainly IS.
-Breaking the Law: No laws shall be broken without first clearing immunity with superiors or property owners. If one wanted to entrap a vandal, they may perform acts of vandalism themselves only if the owner of the property consents to the defilement of his property.
-Torture of individuals: Torture must be conducted in the city dungeons by a registered dungeon-keeper only. The only exception is in times of immediate peril endangering the life of an innocent. The immediate danger must be obvious to all, such as a burning house with people trapped inside or an active hostage situation. Torture in order to find out who is a spy or who is harboring a criminal is not... unless the proper paperwork is filed and the subject is detained in the dungeons proper.
-Taxes, Tolls & Duties:
Tolls: Tolls may be collected by any member of the guard so witnessing transport of the subject across lawful toll roads, bridges, gates, ports and waterways. They may not be gathered for entrance to private buildings or public areas designated as free zones. (parks, main streets, taverns, marketplaces)
Duties: Duties must be collected on site in Ports, Harbors, Gates, Warehouses and Markets. This is to be done immediately following proper inspection of all goods in transport. Upon payment of duties a receipt is to be issued. Duties may be collected only by licensed collectors bearing a silver badge or higher.
Taxes: Taxes are gathered quarterly by gold badged guards or official tax clerks of the city only. These may be collected at the estates or businesses of the subject or paid forward in the courts or the local branches of the Bank of Layonara.
Fines are to be paid to the courts only as to fully document all restitution. Fines must be issued via tickets and receipts will be issued upon payment. All guards copper or above may issue fines, only gold may collect.
(hopefully this helps to determine when the guards you encounter are legitimate or acting outside their roles, as well as to keep yourselves out of prison)