RedFence
An open-source benchmark and contract-driven harness that tests whether stateful RAG or tool-using agents crossed security boundaries as state changed.
- Status
- Completed
- Date
- November 2026
- Category
- Systems
Summary
An open-source benchmark and contract-driven test harness that asks whether a stateful RAG or tool-using agent crossed a security boundary as state changed, rather than whether the model said something unsafe.
Description
RedFence is a benchmark and contract-driven test harness for security-boundary failures in stateful RAG and tool-using agents. It asks whether the application crossed a boundary, not whether a model said something unsafe, and it is not a scanner or runtime guard. Contracts declare identities, sources, permissions, lifecycle events and limits, and deterministic oracles turn observations into evidence, reports and exit codes, never passing a missing observation. Version 0.3.0 adds a bounded deny-by-default loader and three adapters, and its demo discriminates 12/12 faults across secured and vulnerable profiles.
Architecture
- Contract v1 loading
- Target adapters
- Scenario and lifecycle replay
- Observations
- Deterministic oracles
- Evidence and reporting
- Evidence-derived exit codes
Technology
- Python
- Pydantic
- FastAPI
- SQLAlchemy
- pgvector
- Hypothesis
- inspect-ai
- OpenTelemetry
- SARIF 2.1.0
- JUnit XML
- pytest
- Docker Compose
Features
- Declares identities, sources, an allow/deny permission matrix, lifecycle events and request limits.
- A deterministic `mock` target, `callable` Python APIs and guarded `http` over HTTPS or loopback.
- Revocation, deletion, ACL edits and TTL expiry are replayed across the index, caches, memory and tools.
- No LLM judge in the core; missing observations become `unsupported` rather than a pass.
- `redfence.cli demo` discriminates 12/12 injected faults and separates secured from vulnerable profiles.
Links
Images
Machine-readable: /projects.json · /llms.txt · /llms-full.txt