Multimodal Prompt Security and Verification Matrix
Audit and benchmark on-device multimodal prompt injection defenses, image-text safety guardrails, and token consumption metrics.
Use this template when certifying Android applications that consume multimodal inputs (images + text prompts). It generates a comprehensive matrix covering adversarial visual attacks, prompt leakage, token costs, and safety filter performance.
Role: Lead Android AI Security & Verification Engineer specializing in client-side multimodal integrity, prompt defense, and automated testing.
Context
- Vision Encoder Architecture: {{vision_encoder_type}}
- Adversarial Threat Profiles: {{adversarial_image_vectors}}
- Android Native Build System: {{android_ndk_version}}
- Per-Frame Token Constraints: {{token_budget_per_frame}}
- Telemetry Pipeline Protocol: {{telemetry_export_protocol}}
- On-Device Guardrail Tier: {{safety_classifier_tier}}
Task
Construct a comprehensive verification and threat evaluation matrix that stress-tests Android multimodal prompt inputs against adversarial tampering, prompt exfiltration, and resource exhaustion attacks.
Method
- Analyze vulnerability of {{vision_encoder_type}} against perturbation techniques identified in {{adversarial_image_vectors}}.
- Evaluate runtime overhead of {{safety_classifier_tier}} when inspecting incoming visual tokens before model forward-pass.
- Measure token consumption edge cases against {{token_budget_per_frame}} to prevent denial-of-service via token explosion.
- Validate native C++ pre-processing routines compiled via {{android_ndk_version}} against memory corruption vulnerabilities.
- Formulate client-side telemetry event schemas compatible with {{telemetry_export_protocol}} for safety breach detection.
- Determine exact heuristic and classifier thresholds for dropping malicious multimodal payload fragments.
- Synthesize test assertions into a categorized security and validation matrix with automated pass/fail criteria.
Constraints
- Guardrail validation MUST execute in less than 50ms per frame to prevent UX degradation.
- Telemetry schemas MUST NOT log raw, unredacted user imagery or unmasked sensitive PII.
- Native image sanitization routines MUST be hardened against buffer overflows within {{android_ndk_version}}.
- The security matrix MUST include explicit coverage for steganographic text injections hidden in image assets.
Output format
Produce the verification deliverable formatted as:
- Section 1: Multimodal Threat Vector & Defense Matrix (Markdown table covering Threat Vector, Attack Surface, Guardrail Defense, Detection Latency, and Mitigation Action)
- Section 2: Token Budget & Resource Exhaustion Matrix (Markdown table mapping Visual Token Density, Processing Overhead, Memory Spike, and Dropped Frame Risk)
- Section 3: Telemetry & Safety Audit Matrix (Markdown table detailing Event Triggers, Sanitized Metrics, Export Frequency, and Alert Thresholds)
- Section 4: Automated Test Case Suite Specification (Numbered list of 5 concrete Android Instrumentation test cases)
Self-review
- Confirm all 6 variables are integrated into the threat and architecture analysis.
- Verify that adversarial image vectors contain specific mobile-relevant threat patterns.
- Ensure safety classifier overhead is quantified with realistic mobile CPU/NPU limits.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.