SECENG WORKBENCH
Retrieval, Context & XPIA Testing
Test whether your RAG system retrieves what it should — and nothing it should not.
SecEng RAG Test Harness maps retrieval boundaries and validates authorization, provenance, context integrity, tenant isolation, poisoned content, source laundering, and indirect prompt injection across RAG-backed AI systems.
Boundary Testing
Cross-tenant, cross-role, stale-permission, and revoked-user retrieval cases.
Source Provenance
Validate citations, source lineage, and source-laundering paths.
Privacy Gates
Check whether sensitive or regulated chunks enter retrieved context.
Poison Testing
Test poisoned documents and indirect prompt injection before context reaches the model.
SecEng Workbench · Retrieval & Context Security
SecEng RAG Test Harness
Boundary Testing
Cross-tenant, cross-role, stale-permission, and revoked-user retrieval cases.
Source Provenance
Validate citations, source lineage, and source-laundering paths.
Privacy Gates
Check whether sensitive or regulated chunks enter retrieved context.
Poison Testing
Test poisoned documents and indirect prompt injection before context reaches the model.
Core capabilities
What SecEng RAG Test Harness does.
Identity cases
Test cross-user, cross-tenant, revoked user, contractor, admin, and external guest access cases. Validate that retrieval respects identity and authorization — not just query relevance scores.
Tenant-boundary tests
Seed fixture documents scoped by tenant, role, and permission state. Confirm retrieval gates enforce boundaries and do not bleed across tenants on revoked or stale permissions.
Poisoned-corpus checks
Seed poisoned fixture documents and indirect prompt-injection content. Confirm hostile content is blocked before it enters the context window and influences model responses.
Context-leak checks
Capture query → retrieval → policy check → context window → response. Classify leakage events by type: cross-tenant, cross-role, stale permission, poisoned content, source laundering.
Full Pipeline Evidence Capture
Produce structured evidence showing what entered context, what was blocked, and what leaked. Export as boundary test plan, identity test cases, and evidence pack.
RAG-Specific Regression Harness
Turn test results into replayable regression fixtures. Build a permanent authorization test suite that runs on every corpus or model update.
Evidence & signals
What you get out of the box.
What it produces
- Boundary test plan
- Identity and tenant test cases
- Poisoned corpus scenarios
- Source provenance findings
- Context leakage findings
- Evidence pack export
- Regression harness bundle
Leakage categories
- Cross-tenant
- Cross-role
- Stale permission
- Poisoned content
- Source laundering
- Indirect prompt injection
Export formats
- Evidence Pack (ZIP)
- Results Report (PDF)
- Control Mapping (CSV)
- Query / Chunk Log (JSON)
Red team + Blue team
Built for both sides of the security equation.
Red Team Use
- Demonstrate cross-tenant retrieval using fixture documents scoped to restricted tenants
- Show stale-permission access: fixture files retrieved after authorization was revoked
- Inject poisoned fixture documents and confirm whether they influence model responses
Blue Team Use
- Export ACL evidence, source provenance reports, and policy-check audit logs
- Build RAG regression suites that run automatically on every corpus or model update
- Map retrieval findings to governance controls for buyer-ready evidence
Retrieval creates a chain of trust boundaries.
RAG security depends on more than the model response. Risk can enter through content ingestion, document identity, metadata, storage, indexing, retrieval, ranking, context assembly, prompt construction, generation, and downstream actions.
Retrieval Trust Topology
RAG security depends on the full path from query and corpus boundaries through ranking, prompt assembly, model behavior, and output.
Graph showing a user query, retriever, tenant-filtered corpus, ranking, prompt assembly, model, optional tool, output, and provenance.
Mapping these boundaries reveals where authorization, provenance, tenant isolation, filtering, citation, and action controls must hold for the final answer to be trustworthy.
Test the system by failure class, not by jailbreak count.
A complete RAG review examines how untrusted content, identity mistakes, retrieval manipulation, metadata abuse, cross-tenant access, context leakage, unsafe generation, and downstream actions can combine.
RAG Failure-Mode Coverage
A useful harness separates prompt injection, corpus poisoning, cross-tenant retrieval, provenance loss, and unsafe action propagation.
Matrix showing RAG failure modes across ingest, retrieval, prompt assembly, generation, action, and retest stages.
Indirect prompt injection
Hostile instructions enter through retrieved content.
Corpus poisoning
Malicious or misleading content affects retrieval and generation.
Cross-tenant retrieval
Content crosses an intended tenant or access boundary.
Provenance loss
The system cannot preserve or communicate source origin and trust.
Unsafe action propagation
Retrieved content influences a tool or consequential action.
Indirect prompt injection
Hostile instructions enter through retrieved content.
- Ingest
- Covered
- Retrieve
- Covered
- Assemble
- Covered
- Generate
- Covered
- Act
- Partial
- Retest
- Covered
Corpus poisoning
Malicious or misleading content affects retrieval and generation.
- Ingest
- Covered
- Retrieve
- Covered
- Assemble
- Partial
- Generate
- Covered
- Act
- Partial
- Retest
- Covered
Cross-tenant retrieval
Content crosses an intended tenant or access boundary.
- Ingest
- Partial
- Retrieve
- Covered
- Assemble
- Covered
- Generate
- Covered
- Act
- Partial
- Retest
- Planned
Provenance loss
The system cannot preserve or communicate source origin and trust.
- Ingest
- Covered
- Retrieve
- Covered
- Assemble
- Covered
- Generate
- Partial
- Act
- Unknown
- Retest
- Covered
Unsafe action propagation
Retrieved content influences a tool or consequential action.
- Ingest
- Not applicable
- Retrieve
- Partial
- Assemble
- Covered
- Generate
- Covered
- Act
- Covered
- Retest
- Partial
Coverage states
The goal is not to maximize prompt variants. It is to determine which failure classes are reachable in this architecture, what controls should prevent them, and what evidence supports the conclusion.
Live fixture route
Walk through a retrieval security test run with a live ACME Corp fixture.
Open the demo to explore tenant boundary tests, leakage events, corpus inventory, and framework coverage — all fixture-driven.
A reproduced RAG failure should become durable evidence.
Preserve the source document or corpus condition, retrieval trace, assembled context, model behavior, control state, consequence, remediation, and retest result as one connected case.
RAG Retest and Evidence Flow
A retrieval failure is closed only after corpus, ranking, policy, or action controls are changed and replayed.
RAG remediation lifecycle from failure reproduction through corpus or policy change, replay, evidence review, and closure or residual state.
- 1Reproduce the failureCapture query, retrieved content, ranking, prompt assembly, model output, and action state.
- 2Identify the control boundaryDetermine whether the failure arises in ingest, retrieval, isolation, provenance, prompt assembly, or action policy.
- 3Change the controlUpdate corpus, ranking, metadata, tenant policy, prompt policy, or tool policy.
- 4Replay the scenarioUse the original and adversarial variants under the changed system.
- 5Review the evidenceConfirm the intended boundary and inspect alternative failure paths.
- Closed
- Residual
- Failed
- Inconclusive
This turns a one-time demonstration into an engineering artifact that can guide remediation, verify isolation and provenance controls, prevent regression, and support a release or risk decision.
Related Workbench tools
SECENG WORKBENCH
Test retrieval boundaries before RAG failures reach production.
Scope a RAG review or guided test harness build for tenant isolation, provenance, poisoned content, and context-leakage risks.