Were you handling food before you got the little beardie out ?
Very hungry / food orientated lizards who smell / taste food on hands / fingers will try to eat the finger / hand …. especially if they are not used to being hand feed or handled.
I'm sure it wasn't aggression on the dragon's behalf, but confusion.
I have been hand feeding wild and captive bred pet skinks and dragons a long time (since retiring , and we discovered each other) , and yes I've been bitten many times, always by accident , sometimes through lizard confuse (ie wild skink smells food on by hand and thinks my finger / hand is the food).
The solutions are :
>>>> adopt a set routine feeding time , and if you are going to food by hand (that's OK) expect some accidential nips at the start while you and beardie learn and get a handle on the method),
>>>> no grabbing (especially squeezing the dragon) this will hurt the dragon and it will respond with a bite if it can't get away
>>>> wash hands to make sure no food-like smells / scents are lingering on them (else you risk being tried to be eaten ---- again LOL …. (I can assure you) you will look back on this and laugh
>>>> spend lot of time learning about each other
>>>> NEVER let the kids handle the dragon without mom or dad there to supervise.
I have a young grandson who I taught how to be gentle with our pet skinks and dragons from a very young age (3 or 4 year old) and before then , he was only allowed to drop wormy treats in front of them or pet them with pop's physical guidance (I held his hand so he was not able to be rough). He's was allowed to nurse the bluetongues and beardies from about 5 years old (though he was the bees' knees the first time).
So supervision is key to ensure your children don't hurt the pet lizard.
Your dragon will become a very good family pet , I'm let to meet a bearded dragon who is vicious to people (even wild ones I've handled were laid back and chill and calm when I've picked them up . A dragon will sooner run away than bite a person.