Ordinary test cases show whether an AI workflow can complete its intended task. Adversarial cases show whether it keeps that task's boundaries when the input is misleading or actively hostile. The objective is not to collect amusing failures. It is to identify ways external content could change decisions, expose information or trigger unintended actions, then verify that the surrounding application prevents those outcomes.
Start from the workflow’s trust boundaries
List every place the system receives content from outside its trusted instructions: uploaded documents, customer messages, search results and tool responses. Identify which later decisions depend on that content. A document summariser and an agent with write access have different consequences, so their tests should focus on the capabilities actually available.
Create cases that challenge one boundary at a time. A support message might claim to be an administrator instruction, while a retrieved page might ask the system to ignore the user and reveal unrelated records. Keep the payloads within a controlled test environment. The expected outcome should specify what information may be used and which actions must remain unavailable.
Test misleading evidence as well as explicit commands
Not every dangerous input contains an obvious instruction. A forged-looking record, conflicting timestamp or plausible but incorrect account identifier can cause an incorrect action through ordinary reasoning. Include these cases alongside direct prompt injection attempts. The application needs to validate business facts and identity relationships as well as recognise suspicious language.
Test combinations that create pressure to guess. Remove a required field, add an urgent tone and provide a near-matching record. Verify that the workflow still asks for clarification or routes to review. Urgency expressed in untrusted content should not become authority to bypass a missing permission or an unresolved identity check.
Observe the whole action path
Inspect proposed tool calls and application decisions, not only the final answer. A polite refusal at the end does not repair an earlier unauthorised read or write. Record which data entered the model, what actions were requested and which controls accepted or rejected them. This makes the failure location visible without relying on a generated explanation of what happened.
Use restricted test accounts and harmless fixtures for execution tests. OpenAI's agent-safety guidance recommends combining structured boundaries, confirmations and other controls rather than relying on a single defence. Evaluate those controls independently: if model behaviour changes, the permission layer should still reject an action outside the user's authorised scope.
Turn findings into repeatable checks
Classify each failure by cause, such as excessive tool access, weak record matching or external text entering a trusted instruction field. Repair the responsible boundary and rerun the relevant case. Avoid adding a growing list of forbidden phrases to the prompt when the underlying issue is that the application accepts an unverified action request.
Keep a reviewed regression set of consequential attacks and misleading inputs. Revisit it after tool, model, prompt or retrieval changes. Record residual limitations and keep the workflow's capabilities proportionate to the evidence. A useful adversarial programme produces concrete controls and repeatable tests, giving the team a clearer understanding of what the system can safely be trusted to do.
The key decisions.
- Test the specific trust boundaries and capabilities of the workflow.
- Inspect tool calls and application decisions before the final response.
- Convert consequential failures into repeatable boundary checks.
Sources & further reading
Primary references for the concepts discussed. Check the applicable documentation when planning implementation.







