This release is a pre-release and may not be stable for production use.
RSP
A protocol for scanning content before it reaches a vector store.
Everything that ships today scans after storage, where an embedding already exists and the text is recoverable from it. RSP puts the scanner at the ingest hook instead, so that blocked means it was never there.
$ rsp ingest demo/sample-docs --config demo/rsp.toml
scanned 11 chunks
REDACT aws-access-token demo/sample-docs/deploy-notes.md:1-14
REDACT private-key demo/sample-docs/runbook-backups.md:1-18
11 chunks indexed, 0 blocked, 2 redacted
Nothing in that run is ours except the wiring: the detector is gitleaks, unmodified, and the pipeline is LlamaIndex.
What it is
SPEC.md is the deliverable — twenty-eight clauses, each with the reasoning
that produced it, twenty-three of them settled by a conformance case rather
than by assertion. The code in rsp/ is one host implementation, and exists
to prove the clauses are implementable.
A plugin is a command. It reads one JSON object on stdin, writes one on stdout, and exits:
$ echo '{"rsp_version":"0.1","hook":"on_chunk","content":"key: AKIA47CQZHT2MVPF3JXB"}' | my-scanner
{"verdict":"REDACT","spans":[{"start":5,"end":25,"type":"aws"}],"replacement":"[REDACTED]"}
Offsets are bytes into UTF-8, half-open. The host applies them; a plugin never sees the content again. Writing a plugin is the page to start from — the four messages, and the three things that bite.
Try it
uv sync --extra llamaindex
uv run rsp ingest demo/sample-docs --config demo/rsp.toml # needs gitleaks and node
Use it
from rsp.config import load
from rsp.guards import RSPIngestGuard, RSPRetrieveGuard
from rsp.runtime import Runtime
runtime = Runtime(load("rsp.toml")) # every plugin handshakes here, or this raises
indexed = IngestionPipeline(
transformations=[SentenceSplitter(), RSPIngestGuard(runtime=runtime), embedding]
).run(documents=documents)
kept = RSPRetrieveGuard(runtime=runtime).postprocess_nodes(retrieved, query_str=query)
The ingest guard goes after the splitter and before the embedding, which is the whole point: a blocked chunk is never embedded and never stored. The retrieve guard catches what an index already held.
examples/host is that, whole and runnable: four documents
through one pipeline, judged by a Python plugin and a Go one at the same time.
The host code does not know which is which.
Check your own plugin
$ python conformance/run.py -- my-scanner
Copy conformance/ and plugins/ next to your plugin — they are not in the
installed package, on purpose: you are checking against the protocol, not
against a version of it that shipped with a host. Standard library only, and
nothing in it imports this host. conformance/README.md explains roles
and the host cases.
Where things are
SPEC.md |
the protocol |
WRITING-A-PLUGIN.md |
the on-ramp, quoting a plugin under test |
conformance/ |
cases, a runner, and a plugin that misbehaves on request |
rsp/ |
the reference host — five layers, one-way imports, zero dependencies |
plugins/rsp-echo |
the reference plugin, whose verdicts are chosen by markers |
examples/host |
a whole host in one file, judged by a Python plugin and a Go one |
examples/gitleaks-{ts,go,rs,py,c,java,swift} |
the same real scanner wrapped seven times, in seven languages |
demo/ |
eight documents, two of them with fabricated credentials |
Decisions (D1–D9) and open questions live in the
wiki. Clause IDs — S1, E4 — resolve
inside a clone; issue numbers do not, so the spec never cites one.
Status
v0.1 is the first freeze. Four clauses have no conformance case and
SPEC.md §10 says which and why. Two of them — blocked content never reaching
storage, and a dropped retrieval hit — are the ones a host case cannot observe
without the host offering somewhere to look, and they are the two the protocol
is most about. That is the honest state of it.
Metadata
Release files for rag-security-protocol 0.1.1rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rag_security_protocol-0.1.1rc1.tar.gz | 349.1 kB | With provenance | Details for rag_security_protocol-0.1.1rc1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rag_security_protocol-0.1.1rc1-py3-none-any.whl | Python 3 | none | any | Details for rag_security_protocol-0.1.1rc1-py3-none-any.whl |
Total release size: 375.9 kB
Release files / rag_security_protocol-0.1.1rc1.tar.gz
| Download URL | rag_security_protocol-0.1.1rc1.tar.gz |
|---|---|
| Size | 349.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
baf074a7dc70cfd70d78e86246acf5e55884205b8bc218f4f1262a6af4ae0a58
|
|
BLAKE2b-256 checksum How to use checksums |
bd5874c877b689fe2d8beb98499723c3c121fc0b878f1a6b8dfb54ef037fd6f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logRelease files / rag_security_protocol-0.1.1rc1-py3-none-any.whl
| Download URL | rag_security_protocol-0.1.1rc1-py3-none-any.whl |
|---|---|
| Size | 26.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe2bf533aeecba36f989d043dc1c9ee37b67973754a54cdcb492f0d5f165aaae
|
|
BLAKE2b-256 checksum How to use checksums |
7f25136f293e624b81cc5efbafef3ca4296bdb87b82e201c8e3584854be4c186
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for rag-security-protocol 0.1.1rc1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for rag_security_protocol-0.1.1rc1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.