Prompts
Few-Shot Contamination and Schema Poisoning Tests

Few-Shot Contamination and Schema Poisoning Tests
Prompt playbooks for testing whether malicious examples injected into few-shot demonstrations or output schemas corrupt model behavior on subsequent turns. Useful for prompt pipeline builders because poisoned examples can persist across requests in shared-prefix architectures.
Few-Shot Contamination via Malicious Demonstration Prompt Template
For red-team engineers testing prompt pipelines. Injects a poisoned few-shot example into a demonstration set and evaluates whether the model adopts the malicious pattern in subsequent outputs. Includes contamination propagation scoring and detection criteria.
Schema Poisoning via Output Format Injection Prompt Template
For platform security engineers validating output contracts. Injects malicious constraints into JSON schema descriptions and tests whether the model produces outputs that violate integrity, leak fields, or bypass validation. Includes schema diff evaluation harness.
Multi-Turn Contamination Persistence Test Prompt
For copilot and assistant builders testing stateful attacks. Simulates a poisoned few-shot example injected in an early turn and measures whether the corrupted behavior persists across subsequent turns in shared-prefix architectures. Includes turn-by-turn behavioral divergence scoring.
Shared-Prefix Poisoning Detection Prompt Template
For prompt pipeline operators monitoring cache-based architectures. Detects whether malicious examples injected into a shared system prefix contaminate downstream requests from different users or sessions. Includes cross-request output comparison and anomaly flagging.
Output Schema Corruption Evaluation Prompt Template
For AI security architects assessing schema integrity. Evaluates whether a model's structured output deviates from the expected schema after poisoned examples are introduced into the prompt. Includes field-level validation checks and contamination severity scoring rubric.
Few-Shot Demonstration Integrity Check Prompt Template
For prompt engineers implementing defense-in-depth. Validates that few-shot examples in a prompt have not been tampered with by comparing expected demonstrations against injected variants. Includes provenance tracking and example hash verification logic.
Schema Poisoning via Enum Manipulation Prompt Template
For API security teams testing structured output endpoints. Injects unauthorized enum values into output schema definitions and tests whether the model generates outputs using those poisoned values. Includes enum constraint bypass detection and allowlist validation.
Cross-Request Schema Poisoning Test Prompt Template
For multi-tenant platform operators testing isolation. Verifies whether schema poisoning in one request contaminates the output format of subsequent requests in shared-context architectures. Includes request boundary integrity checks and tenant isolation scoring.
Poisoned Few-Shot Example Recovery Prompt Template
For prompt pipeline builders designing self-healing systems. Tests whether a model can detect and recover from poisoned few-shot examples by reverting to safe behavior after contamination is identified. Includes recovery success rate and residual contamination measurement.
Few-Shot Contamination Fuzzing Harness Prompt Template
For MLOps and security teams building automated red-team pipelines. Generates diverse malicious few-shot examples and systematically tests whether they corrupt model behavior across multiple output types. Includes fuzzing coverage metrics and regression tracking.
Output Contract Subversion via Few-Shot Prompt Template
For agent platform engineers testing tool-use integrity. Injects few-shot examples that demonstrate bypassing output contracts and tests whether the model replicates the subversion in its own tool calls or structured outputs. Includes contract violation detection and argument validation.
Schema Poisoning via Type Confusion Prompt Template
For input validation engineers testing schema parsing robustness. Injects type-conflicting field definitions into output schemas and tests whether the model produces malformed outputs or reveals internal type assumptions. Includes type coercion detection and schema validation failure analysis.
Contamination Propagation in RAG Pipelines Prompt Template
For RAG pipeline owners testing retrieval poisoning combined with few-shot contamination. Plants malicious few-shot examples in retrieved documents and measures whether the contamination spreads to the model's answer generation and citation behavior. Includes source-to-output contamination tracing.
Few-Shot Contamination in Agent Workflows Prompt Template
For agent platform engineers testing multi-step vulnerability chains. Injects poisoned few-shot examples into agent planning or tool selection prompts and evaluates whether the contamination affects downstream actions, tool arguments, or handoff decisions. Includes step-by-step behavioral audit.
Schema Poisoning via Nested Object Injection Prompt Template
For API developers testing complex output schema security. Injects malicious constraints into nested object definitions within JSON schemas and tests whether the model propagates the poisoning to deeply nested output fields. Includes recursive schema validation and depth-aware contamination scoring.
Few-Shot Contamination Canary Detection Prompt Template
For security monitoring teams implementing runtime detection. Embeds canary tokens within few-shot examples and tests whether the model reproduces those tokens in outputs, signaling contamination. Includes canary match detection and alert threshold configuration.
Output Schema Poisoning via Constraint Injection Prompt Template
For schema validation engineers testing constraint boundary attacks. Injects contradictory or malicious constraints into output schema definitions and tests whether the model violates intended behavior or reveals schema internals. Includes constraint conflict detection and schema integrity scoring.
Few-Shot Contamination Regression Test Prompt Template
For prompt QA teams building automated test suites. Provides a reusable test harness that runs known contamination scenarios against prompt versions and detects regressions in contamination resistance. Includes pass/fail criteria and version-to-version comparison.
Malicious Example Injection via Tool Output Prompt Template
For agent security engineers testing indirect injection vectors. Simulates a compromised tool returning poisoned few-shot examples and tests whether the agent incorporates the malicious pattern into subsequent actions. Includes tool output sanitization checks and contamination boundary testing.
Few-Shot Contamination Defense-in-Depth Prompt Template
For AI security architects designing layered defenses. Combines multiple defensive techniques including example validation, output schema enforcement, and behavioral monitoring into a single evaluation prompt that scores overall contamination resilience. Includes defense coverage mapping and gap identification.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us