Residents have asked a judge to force agents to avoid deploying tear gas into crowds unless they are being threatened.