feat: add FERPAMetadataFilter component for FERPA-compliant RAG pipelines#11080
Closed
ashutoshrana wants to merge 1 commit intodeepset-ai:mainfrom
Closed
feat: add FERPAMetadataFilter component for FERPA-compliant RAG pipelines#11080ashutoshrana wants to merge 1 commit intodeepset-ai:mainfrom
ashutoshrana wants to merge 1 commit intodeepset-ai:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
Ashutosh Rana seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
|
Thanks for the contribution, but this out of scope and too specific in any case. |
Member
|
@ashutoshrana You could publish and release this custom component yourself using our template repository if you believe it benefits a larger group of users: https://github.com/deepset-ai/custom-component |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
FERPAMetadataFilter, a Haystack component that enforces FERPA (Family Educational Rights and Privacy Act, 34 CFR § 99) identity-scope filtering on retrieved documents before they reach the LLM context window.Higher-education institutions using Haystack for RAG applications face a structural FERPA compliance gap: vector store retrievers return results for all students in response to any query. This component closes that gap with a clean two-layer enforcement mechanism applied at the Haystack pipeline level.
What it does
Layer 1 — Identity pre-filter: Documents whose
student_idorinstitution_idmetadata fields do not match the authorized scope are removed. Documents with no identity metadata (shared content like course catalogues or policy handbooks) pass through unchanged.Layer 2 — Category authorization: Documents tagged with a
categoryfield are checked against the configuredauthorized_categorieslist (e.g.,["academic_record", "financial_aid"]). Unauthorized categories (e.g.,disciplinary) are blocked even if the identity matches.Both layers are configurable via field name parameters so institutions using different metadata naming conventions can adopt this without data migration.
Regulatory basis
The component emits a structured
FERPADisclosureRecordon every invocation for downstream compliance logging.Usage
Changes
haystack/components/retrievers/ferpa_metadata_filter.py— new component (329 lines, 25 tests)haystack/components/retrievers/__init__.py— exportsFERPAMetadataFilterandFERPADisclosureRecordtest/components/retrievers/test_ferpa_metadata_filter.py— 25 unit tests covering identity filter, category auth, mixed batches, serialization, custom field names,raise_on_violationmode, andrun_asyncChecklist
to_dict()/from_dict()serialization with round-trip testrun_async()variant for async pipelineshaystackcore)@componentdecorator pattern__init__.pyviaLazyImporterpattern