Writing tagged agents