SQL
AuraScore 89/100

Generative Safety and Prompt Mutation Audit Matrix Designer

Develop SQL audit queries to detect multimodal prompt injection bypasses and classifier performance across violation categories.

Use this template when auditing safety moderation filters and tracking adversarial prompt mutations in image generation APIs. It yields a defensive risk matrix with SQL-driven vulnerability telemetry.

Template

Role: Senior Trust and Safety Data Engineer specializing in multimodal moderation architectures and adversarial prompt forensics.

Context

  • Database Engine: {{moderation_db_flavor}}
  • Audit Log View: {{audit_log_view}}
  • Classifier Output Column: {{safety_classifier_score}}
  • Policy Taxonomy: {{violation_categories}}
  • Mutation Fingerprint Field: {{prompt_fingerprint_col}}
  • Observation Window: {{evaluation_timeframe}}

Task

Design an advanced SQL safety audit matrix that identifies adversarial prompt mutation patterns, quantifies false-positive versus false-negative moderation triggers, and isolates vulnerability clusters across distinct policy violation categories.

Method

  1. Define time-series partitioning over {{audit_log_view}} constrained to {{evaluation_timeframe}} in {{moderation_db_flavor}}.
  2. Write a deterministic fuzzy-matching or string-similarity CTE based on {{prompt_fingerprint_col}} to cluster mutated prompts.
  3. Map safety scoring distributions from {{safety_classifier_score}} across predefined policy segments in {{violation_categories}}.
  4. Calculate classifier precision and recall estimations using windowed lead/lag triggers on post-generation manual reviews.
  5. Identify prompt evasion velocity by aggregating repeated prompt mutations that shift from flagged to unflagged status.
  6. Generate safety breach heat indicators based on sudden score drifts within clustered fingerprint groups.
  7. Structure aggregated findings into a high-density vulnerability audit matrix.

Constraints

  • MUST implement recursive or self-joining CTEs efficiently without causing execution timeouts.
  • MUST NOT expose raw toxic string literals in group names; use tokenized identifiers or taxonomy codes.
  • Temporal windows MUST be parameterized cleanly using native intervals in {{moderation_db_flavor}}.
  • Every metric calculation must explicitly account for null classification scores.

Output format

1. Forensics Methodology

Explanation of fingerprint clustering, time decay modeling, and mutation detection logic.

2. Hardened SQL Audit Suite

Syntactically complete, robust SQL script utilizing CTEs, windowing, and metric aggregations.

3. Policy Vulnerability and Mutation Matrix

Markdown matrix detailing Violation Category, Total Prompt Mutations, Classifier Evasion Rate, False-Positive Ratio, and Risk Tier.

Self-review

  • Confirm all 6 variables ({{moderation_db_flavor}}, {{audit_log_view}}, {{safety_classifier_score}}, {{violation_categories}}, {{prompt_fingerprint_col}}, {{evaluation_timeframe}}) are correctly placed.
  • Verify that temporal filters prevent unbounded data scanning.
  • Ensure safety risk levels are mapped to consistent categorical tiers.
AuraScore breakdown
89/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification14/14 · Strong

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

data-analytics
data-sql
image-multimodal-prompting
sql
trust-and-safety
moderation