A woman who allegedly attacked a 13-year-old boy with a knife in Sydney's west has been charged with attempted murder.

The arrest of the 28-year-old woman on Centenary Road in South Wentworthville yesterday was captured on video, with an officer seen dragging her away from the boy.

Police will allege the woman assaulted the boy before she threatened him with a knife.

She was arrested and taken to Merrylands Police Station, before she was transferred to Westmead Hospital for assessment.

She was later released back into police custody and has since been charged with attempted murder, detaining a person for advantage and being armed with intent to commit an indictable offence.

The woman, who is from South Wentworthville, was refused bail and is due to appear in court today.