In a medium saucepan, combine the tamari (or soy sauce), sake (or vegetable stock), mirin, brown sugar, chopped onion, sliced ginger, and chopped garlic.
Bring the mixture to a boil over high heat, then reduce the heat to low and let it simmer gently for 10 minutes to allow the flavors to meld.
In a small bowl, whisk together the arrowroot powder (or cornstarch) and cold water until a smooth slurry forms with no lumps.
Pour the slurry into the simmering sauce, stirring constantly.
Continue to cook and stir frequently for another 3 minutes, or until the sauce has thickened to your desired consistency.
Remove the saucepan from the heat and carefully pour the sauce through a fine-mesh strainer to remove the onion, ginger, and garlic pieces, ensuring a smooth finish.
Use the sauce immediately on your favorite dishes, or let it cool completely and store it in an airtight container in the refrigerator for up to several weeks.
Add a pinch of red pepper flakes along with the other in step 1 if you'd like to introduce a gentle kick of heat to your sauce.