The IRS recently agreed to share confidential tax return data with immigration enforcement agencies for criminal proceedings, saying the agreement complied with privacy laws, but tax and privacy experts said they had concerns that the deal was vague and lacked safeguards to ensure the information is lawfully used.