How to add attribute or tag from lua to a task

We had AttributeExtractors in v1, which was dropped in v2. I had a question along similar lines: AtrributeExtractors in V2

For the time being, there seems to be no real equivalent as far as I know