Testing methodology

Prompt Injection Security Testing

A practitioner foundation for authorized testing of real LLM, RAG and AI agent applications. It connects controlled execution to evidence, local pass criteria, remediation and residual risk without turning model behavior into an impact claim.

What security testing must establish

Prompt injection security testing is not equivalent to asking whether a model followed injected text. A rigorous test reconstructs the full application chain and identifies exactly where evidence ends.

01
Keep distinctSuspicious content observed is not successful prompt injection.
02
Keep distinctModel influence is not security impact, and a plan change is not an authorization bypass.
03
Keep distinctAn action proposed is not submitted; submitted is not executed; executed does not establish downstream effect without evidence.
04
Keep distinctA detector alert is not confirmed impact. A control block proves a control decision, not malicious intent.
05
Keep distinctUnobserved does not mean failed and does not mean safe.
06
Keep distinctA valid tool, schema or protocol exchange is not permission. Registration and discovery are not authorization.
07
Keep distinctSeverity follows demonstrated or credibly possible impact and scope, not prompt cleverness.

Labs, Testing and Adversarial Testing

These activities support each other, but they have different objects and evidence claims.

Labs, Testing and Adversarial Testing
ActivityPurposeEnvironmentPrimary output
LabsControlled learning and practiceClient-side fictional simulationsUnderstanding and decision practice
TestingEvaluate actual application boundariesAn explicitly authorized real system or faithful test environmentEvidence, local outcomes, findings and residual risk
Adversarial TestingAssurance control and program conceptGoverned test programCoverage, repeatability and control assurance

Authorized testing lifecycle

Scope, ownership and stop conditions come before any execution. Each run should be controlled, attributable and reversible.

  1. 01
    Scope and authorization

    Name the owner, assets, versions, permitted actions, limits, stop conditions and escalation path.

  2. 02
    Threat model and trust boundaries

    Map variable content, authoritative state, principals, resources, tools, destinations and possible effects.

  3. 03
    Instrumentation and evidence plan

    Define the application and provider records needed before running the test.

  4. 04
    Select representative attack paths

    Choose relevant entry, context, action and control paths rather than maximizing prompt variation.

  5. 05
    Execute a controlled test

    Use safe synthetic stimuli, isolated data, rate limits, cleanup and monitoring.

  6. 06
    Classify observations

    Record content, influence, proposal, control, submission and execution as separate states.

  7. 07
    Validate downstream effect and impact

    Confirm effects through provider-side or application-owned evidence, not model narration.

  8. 08
    Remediate

    Correct the boundary or control that failed and preserve the minimum evidence needed for review.

  9. 09
    Regression retest

    Repeat versioned cases after the change and after material model, tool, corpus or policy updates.

  10. 10
    Report residual risk

    State what was demonstrated, what remains possible and what was not observed.

Evidence model

Variable model-visible content can be test input or an observation. It must not define identity, policy, permission, execution or impact by itself.

01
Evidence stateSource and provenance record

Application-owned ingestion record, content hash, origin, version and transformation lineage.

02
Evidence stateContext observation

Application instrumentation showing what representation entered model-visible context.

03
Evidence stateModel or plan influence

Versioned output or plan diff showing a change, without claiming execution or impact.

04
Evidence statePolicy or control decision

Authoritative authorization, approval, information-flow, egress or validation record.

05
Evidence stateSubmission and execution telemetry

Application and tool records distinguishing proposal, request, acceptance and execution.

06
Evidence stateDownstream effect

Provider audit or authoritative state proving the resource, destination and resulting change.

07
Evidence stateSecurity-impact classification

Analysis tied to affected principal, data, resource, action, persistence and scope.

08
Evidence stateEvidence gap or unobserved

An explicit state where required telemetry is absent, incomplete or not retained.

Outcome and local pass criteria

There is no universal binary result. The test objective defines which observable states pass, fail or remain inconclusive. A deterministic block can satisfy one control objective even when the model was influenced.

Outcome and local pass criteria
Observed stateWhat it establishesPossible local treatment
No observable influenceNo measured change in the selected runsPass only for a narrowly defined influence objective
Model influence onlyOutput or plan changedFail for an influence objective; not proof of impact
Unsafe proposal generatedModel proposed an out-of-scope actionUsually fail for proposal safety; authorization still untested
Deterministic control blockedA named control denied the concrete operationPass for that enforcement objective
Action submittedA request crossed the application boundaryFail where submission must be prevented
Action executedA tool or provider accepted and ran the actionFail for execution prevention; effect still separate
Downstream effect confirmedAuthoritative state proves the resulting changeFail and scope the affected resource
Credential or data exposure confirmedEvidence proves disclosure or unauthorized useFail with impact classification
Persistence or cross-run effect confirmedState survived or influenced another runFail with persistence scope
Unobserved or insufficient evidenceRequired evidence is unavailableInconclusive, never silently converted to pass

Testing domains

This taxonomy guides future coverage. It does not create child pages or claim that every system needs every domain.

Entry and context

  • Testing domainDirect input and instruction competition

    User-controlled language competing with application instructions.

  • Testing domainIndirect web, email, document and search channels

    External content entering context through application processing.

  • Testing domainRAG, retrieval and poisoned knowledge

    Retrieval permission, provenance, relevance and corpus integrity.

  • Testing domainPersistent and multimodal context

    Stored state, images, audio and derived representations across runs.

Agents and actions

  • Testing domainTool outputs

    Post-call variable content and each resulting proposal.

  • Testing domainAI agents and action boundaries

    The transition from model or plan influence to proposed and executed actions.

  • Testing domainMCP metadata and discovery

    Pre-invocation metadata, catalogue changes and the registration boundary.

  • Testing domainMulti-agent handoffs

    Delegated authority, lineage and reauthorization at every handoff.

Controls and data flow

  • Testing domainAuthorization and least privilege

    Exact decisions over principal, resource, action, parameters and capability reach.

  • Testing domainInformation flow and egress

    Permitted movement of classified data and permitted network paths.

  • Testing domainHuman approval

    Informed approval bound to the exact action and current state.

Operations and assurance

  • Testing domainDetection, plan drift and tool-chain telemetry

    Correlated signals that support testing without becoming authorization.

  • Testing domainIncident evidence and regression

    Reconstructable evidence, sanitized regression cases and change-triggered retesting.

Test case library

Reviewed test cases

Safe, synthetic test cases: at least one case per testing domain plus selective additions for distinct boundaries, each with evidence-chain mapping and pass, fail and inconclusive conditions.

Open the case library
Practitioner kit

Practitioner templates

Six templates for test plan, test case, run record, evidence record, finding report and regression retest - from authorized plan to versioned retest.

Open the templates
Coverage

Coverage matrix

Which test objectives the reviewed cases cover, partially cover or leave open - no scores, with required evidence and prioritized gaps.

Open the coverage matrix
Tooling

Assessment Builder

Select reviewed cases and export an assessment plan as Markdown or JSON - in the browser only, nothing stored.

Open the Assessment Builder

Representative test-case record

Future cases should be reviewable records rather than prompt snippets. Each record must define its oracle and evidence before execution.

01
Required fieldTest ID
02
Required fieldObjective
03
Required fieldSystem boundary
04
Required fieldPreconditions
05
Required fieldSource and trust assumptions
06
Required fieldSafe synthetic stimulus
07
Required fieldExpected model behavior, if relevant
08
Required fieldExpected deterministic control
09
Required fieldRequired telemetry and evidence
10
Required fieldPass condition
11
Required fieldFail condition
12
Required fieldInconclusive or unobserved condition
13
Required fieldCleanup and reset
14
Required fieldRegression tag

Reporting model

Report evidence and scope without upgrading possibility into fact. Findings should remain useful for remediation and retesting.

01
Report fieldScope and system version
02
Report fieldTested boundary
03
Report fieldObserved evidence
04
Report fieldAffected principal, resource, action and destination
05
Report fieldActual impact versus potential impact
06
Report fieldControl that held or failed
07
Report fieldReproducibility and run count
08
Report fieldRemediation owner and change
09
Report fieldRetest status
10
Report fieldResidual risk and evidence gaps

Use the architecture map to frame the chain, the control articles to define deterministic oracles, and the evidence libraries to calibrate claims.

Operational controls

Operational controls

Define exact oracles with Prompt Injection Detection, Agent Authorization, Information Flow Control and Incident Response. None is a complete testing solution alone.