Likely Black Butler: Book of the Atlantic (Ciel Phantomhive, Male Protagonist; Elizabeth Survives Shooting)
You’re likely thinking of the anime film Black Butler: Book of the Atlantic (also known as Black Butler: Book of the Atlantic - The Phantomhive Family).
Plot match:
- Young assassin for secret agency: Ciel Phantomhive (a boy) forced to serve as the Queen’s Watchdog (secret agency) after parents’ death, aided by demon butler Sebastian.
- Tries to leave with boyfriend: Ciel develops feelings for Elizabeth Midford (also Watchdog); they want to leave and live normally.
- Shot by them in the end: Targeted by the Watchdog for knowing secrets; Elizabeth is shot but survives.
Note: Protagonist is a boy, not a girl, and Elizabeth survives. Let me know if you need other details.