Content Security Policy
Talk it through out loud with your AI coach.
The problem
- medium
- Pro
After a cross-site scripting scare, a colleague suggests adding a Content Security Policy. Explain what a Content Security Policy is, how it limits the damage of injected scripts, and how you'd roll one out without breaking the site.
What a strong answer covers
- What the policy is and who enforces it.
- How it stops injected scripts from running, while legitimate ones still work.
- Rolling it out gradually without breaking pages.
- Why it backs up safe output encoding rather than replacing it.
Common mistake: Allowing inline scripts everywhere to make errors go away, which removes most of the protection.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud