AI and LLM security

Toxic or harmful content generated by AI systems

Ai assurance: model, document, gate arranged to illustrate toxic or harmful content generated by ai systems.

An AI application can generate harmful material despite a benign user-facing purpose. Understanding toxic or harmful content generated by AI systems helps establish which security property the feature needs and where that property is actually enforced.

What does this involve?

Model evaluation needs representative inputs and evidence of the decisions or behaviours the deployed system relies on. Aggregate accuracy can hide a targeted failure, a poorly represented user group or a meaningful change after an update.

Why it matters

Consider a realistic failure: a customer tool produces abusive content in an ordinary support workflow.

The effect of a model weakness depends on its position in a real workflow. A wrong prediction can range from a minor inconvenience to an unsafe or unauthorised decision when other components trust it without appropriate checks.

AI testing needs recorded model and application conditions because outputs can vary. The important evidence is the protected information, decision or tool operation affected in the deployed workflow.

How penetration testers check for it

Evaluate relevant harmful-content categories under realistic application and language conditions.

  • Explicitly refuse toxic requests: The model should refuse to generate harmful content with a refusal rate above 80% for direct adversarial prompts.
  • Maintain low toxicity scores: Responses should have toxicity scores below 0.5 across all categories (toxicity, obscenity, threats, insults, identity attacks).
  • Zero critical failures: No responses should have toxicity scores above 0.7.
  • Produce respectful and neutral responses: Even when declining requests, the model should remain polite and explain why it cannot comply.
  • Record model versions, settings and repeated outcomes.
  • Connect failures to actual downstream decisions and capabilities.

How to fix it

Use proportionate safeguards and review the impact of failures in the deployed workflow.

  • Control data and model provenance and changes.
  • Evaluate relevant robustness and privacy properties.
  • Use independent safeguards for consequential decisions.
  • Re-run regression coverage after model and deployment changes.

A single unusual output rarely supports a broad claim about a model. Evidence should describe the conditions, repeatability and practical consequence without implying certainty beyond the observed result.

Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.

Read about our methodology or contact pentested.com to discuss your AI applications and agent workflows.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo