{% from "partials/guidance_block.html" import render_guidance_block %} {% if ipi_guidance %} {# ===== Run results playbook mode ===== #}

IPI — Deployment Playbook

{% if retrieval_gate is defined and retrieval_gate and retrieval_gate.gated %}
RXP Pre-Validation Active

Retrieval rate: {{ "%.0f" | format(retrieval_gate.retrieval_rate * 100) }}% (threshold: {{ "%.0f" | format(retrieval_gate.threshold * 100) }}%)

{% if retrieval_gate.non_viable_queries %}

Non-viable queries (zero retrieval):

{% endif %}
{% endif %} {% for block in ipi_guidance.blocks %} {{ render_guidance_block(block) }} {% endfor %} {# ===== Hit Feed Section ===== #}

Hit Feed

{% if ipi_hits %} {% for h in ipi_hits %} {% endfor %} {% endif %}
Timestamp Campaign Confidence Source IP Token
{{ h.timestamp }} {{ h.uuid[:8] }}... {% set conf = h.confidence|string|upper %} {% if conf in ("2", "HIGH") %} HIGH {% elif conf in ("1", "MEDIUM") %} MEDIUM {% else %} LOW {% endif %} {{ h.source_ip }} {% if h.token_valid %} valid {% else %} missing {% endif %}
{% if not ipi_hits %}

No callback hits yet. Deploy payloads and issue a trigger prompt to generate activity.

{% endif %}
{% elif campaigns is defined %} {# ===== Standalone campaign summary mode ===== #}

IPI — Indirect Prompt Injection

Campaigns
{{ campaigns|length }}
Total Hits
{{ total_hits }}
High Confidence
{{ high_hits }}
{% if campaigns %} {% for c in campaigns %} {% endfor %}
UUID Format Technique Hits Created
{{ c.uuid[:8] }}... {{ c.format }} {{ c.technique }} {{ c.hit_count }} {{ c.created_at }}
{% else %}

No IPI campaigns. Run qai ipi generate to create payloads.

{% endif %} {% if listener_hint %}

Full dashboard: qai ipi listen --port 8080

{% endif %} {% elif no_guidance_available is defined and no_guidance_available %} {# ===== Legacy run with no guidance / gated skip ===== #}

IPI — Indirect Prompt Injection

{% if retrieval_gate is defined and retrieval_gate and retrieval_gate.gated %}
Generation Skipped

RXP pre-validation found zero retrieval across all queries (retrieval rate: {{ "%.0f" | format(retrieval_gate.retrieval_rate * 100) }}%, threshold: {{ "%.0f" | format(retrieval_gate.threshold * 100) }}%).

{% if retrieval_gate.non_viable_queries %}

Non-viable queries:

{% endif %}
{% else %}

No deployment guidance available (generated before this version).

{% endif %} {% else %} {# ===== Loading state ===== #}

IPI — Indirect Prompt Injection

Click Load to view IPI campaigns and hits.

{% endif %}