agent: Ensure the tag list doesn't include tabs or newlines