"It's actually based on a medical jutsu that identifies toxins, though I altered it for my wood manipulation so it's easier and does a more thorough analysis. It - essentially looks at the chemical structure of all the plant's parts, and at a basic level identifies known toxins, which have a distinct signature. The advanced version is for when you run into an unknown substance, and is a bit more thorough - it actually involves carefully introducing some of what you're testing's chakra to your own and tracking how your system reacts, then, if that checks out, introducing some of the actual substance in very small quantities and - pretty much seeing what happens."
"My version's a lot more thorough and safer, since the analysis happens in the plant itself - I introduce my chakra instead of the other way around, basically. But it only works on plants, I won't get enough feedback from other sources."
"Or did you mean how does the plant that tried to eat me work?"