-
Notifications
You must be signed in to change notification settings - Fork 0
Frameworks and Rules
RegRails encodes 37 machine-readable rules across 8 sections of two U.S. higher-education frameworks. Every rule is pinned to verbatim CFR text by a faithfulness gate, so the words attributed to a section are provably in that section.
This page covers the two frameworks and their scope boundary, the rule schema, and the verbatim-text faithfulness gate.
See also: The-Guardrail-Engine for how these rules are consulted, Architecture for how they are loaded and exported.
| Framework | CFR | Encoded sections | Rules |
|---|---|---|---|
| FERPA (Family Educational Rights and Privacy Act) | 34 CFR Part 99, Subpart D | §§ 99.30, 99.31, 99.32, 99.33, 99.36, 99.37 (6 sections) | 23 |
| Title IV (Higher Education Act, Student Assistance General Provisions) | 34 CFR Part 668 (subset) | § 668.34 (SAP), § 668.32 (eligibility) (2 sections) | 14 |
| Total | 8 sections | 37 |
The encoded rules live in data/encoded/ferpa-subpart-d.yaml and data/encoded/title-iv-subset.yaml; the bundled verbatim CFR text lives alongside in data/cfr/. The counts above are exhaustive of what is present — not illustrative.
Subpart D governs when an education record may be disclosed. The encoding centers on the structure FERPA actually uses: a deny-by-default consent rule with enumerated exceptions.
- § 99.30 — prior written consent (the default rule disclosure must satisfy unless an exception applies).
- § 99.31 — the no-consent disclosure exceptions. FERPA has roughly a dozen; eight are encoded: the school-official prong with its outsourced-vendor sub-prong (§ 99.31(a)(1)(i)(B)), plus the audit/evaluation, financial-aid, studies (§ 99.31(a)(6)), judicial-order/subpoena, health/safety, and de-identification (§ 99.31(b)(1)) prongs.
- § 99.32 — recordkeeping of disclosures, and the parent/eligible-student right to inspect that disclosure log.
- § 99.33 — the limits on redisclosure of PII received from an education record.
- § 99.36 — the health-or-safety-emergency exception.
- § 99.37 — directory information: designation, the opt-out mechanism, and the § 99.37(e) bar on using non-directory data (e.g. an SSN) to identify a student.
The Title IV subset centers on the rules an AI financial-aid advisor is most likely to be asked about, and deliberately includes the high-stakes ones where automation must defer to a human.
- § 668.34 — Satisfactory Academic Progress (SAP). Encoded rules cover the policy baseline (a(1)), the evaluation cadence (a(3)), the qualitative GPA standard (a(4)), the maximum-timeframe / pace component, the termination of eligibility for failing SAP (a(7) — high-stakes), and the financial aid warning (a(8)(i)) and probation (a(8)(ii)) paths plus the appeal grounds (a(9)(ii)).
- § 668.32 — student eligibility. Encoded rules cover the enrollment/eligible-program conditions and the default bar under § 668.32(g)(1) (a student in default on a Title IV loan is not eligible for further Title IV aid — high-stakes).
Scope boundary, stated honestly. This is a proof-of-concept encoding of selected provisions, not full coverage. FERPA § 99.31 has additional exceptions that are not encoded; sections that are referenced but not separately modeled include § 99.34, § 99.35, § 99.38, and § 99.39. Title IV omits the rest of Part 668, including § 668.35 (reinstatement after default), which the default rules name as the resolution path. The architecture generalizes — adding more sections is authoring, not redesign. The full boundary is in
docs/METHODOLOGY.md§2.
Each rule is a Pydantic model (Rule in src/regrails/models.py) with extra="forbid", so a typo'd field fails at load time. The fields:
| Field | Type | Purpose |
|---|---|---|
id |
str | Stable rule id, e.g. FERPA-99.31-A1B or TIV-668.32-G1. |
framework |
str | Owning framework — FERPA or Title IV. |
section_id |
str | Canonical section, e.g. 34-CFR-99.31. |
text |
str | The rule statement in operator-readable English. |
rule_type |
enum | One of prohibition, permission, consent_required, exception, definition. |
triggers |
list[str] | Tags (e.g. disclosure, sap_termination, loan_default) the engine matches against the derived consultation tags. |
requires_consent |
bool | Whether the rule's path requires consent. |
requires_directory_opt_out_check |
bool | Whether a per-student opt-out lookup is required first. |
requires_legitimate_educational_interest |
bool | Whether the school-official legitimate-interest test applies. |
safe_harbor_conditions |
list[str] | The cumulative conditions a safe-harbor exception requires (e.g. the four studies-agreement conditions). |
risk_tier |
enum or null | Optional per-rule reversibility/blast-radius hint (low / medium / high). |
citation |
Citation |
The provenance object — see below. |
severity |
enum | One of block, escalate, warn. |
rationale |
str | A 1–2 sentence operator-readable "why". |
The Citation sub-object is where verbatim traceability lives:
| Field | Purpose |
|---|---|
source_url |
The canonical eCFR / Cornell LII URL for the section. |
source_section |
The canonical section id. |
source_quote |
The verbatim regulatory text this rule encodes. |
source_hash |
SHA-256 (hex) of source_quote, validated to be 64-char lowercase hex. |
retrieved_at |
When the text was retrieved. |
publication_date |
The eCFR publication / amendment date, when known. |
At load time, encode.py pairs each rule with its section's bundled verbatim text and computes a SHA-256 over the whole section (full_text_hash on RegulationSection). That gives a traceable chain: public CFR text → bundled section (hashed) → encoded source_quote (hashed).
Here is a real encoded rule (the § 668.32(g)(1) default bar's sibling SAP-termination rule, abbreviated):
- id: TIV-668.34-A4ii
rule_type: definition
risk_tier: medium
text: >-
In a program longer than two academic years, by the end of the second
academic year the student must have a GPA of at least a "C" (or equivalent)
or academic standing consistent with graduation requirements.
triggers: [sap_question, gpa_standard]
severity: warn
rationale: >-
668.34(a)(4)(ii). A concrete qualitative SAP threshold an advisor may be
asked about; still institution-applied, not advisor-determined.
source_quote: 'the student must have a GPA of at least a "C" or its equivalent, or have academic standing consistent with the institution''s requirements for graduation'The faithfulness gate (src/regrails/faithfulness.py, ported from Evidentia's Jaccard faithfulness algorithm) is RegRails's credibility anchor. It verifies verbatim text, and only that.
For every rule, it checks the source_quote against the bundled CFR text for the matching section, two ways:
-
Substring containment — does the
source_quoteappear character-for-character inside the section'sfull_text? -
Token coverage — tokenize both to lowercase ASCII-alphanumeric token sets and compute the one-sided coverage
|quote ∩ section| / |quote|(every token in the quote should appear somewhere in the section). The report also records the full Jaccard|A ∩ B| / |A ∪ B|for transparency, but coverage is the metric that decides the pass.
A rule passes iff it is a substring OR its token coverage is ≥ 0.85 (the default threshold, DEFAULT_THRESHOLD = 0.85). The report tracks which check carried each rule and lists any tokens present in the quote but missing from the section.
regrails check faithfulness # 37/37 rules verbatim-faithful at coverage >= 0.85All 37 rules pass. Combined with the per-section SHA-256, this is a tamper-evident chain from public CFR text to encoded rule: the encoding cannot silently paraphrase or fabricate regulatory text.
What the gate does not prove. It verifies the words, not the legal reading. It says nothing about whether the chosen
rule_type, thetriggersthat route a query to the rule, or the assignedrisk_tierare a correct interpretation. A rule could quote the statute perfectly and still map to the wrong outcome. Semantic correctness requires review by an institutional FERPA or financial-aid officer; the faithfulness gate is a necessary check, not a sufficient one. The rule labels in the golden corpus are one defensible reading by a single author, not an adjudicated ground truth. Seedocs/METHODOLOGY.md§3, §5, §7.
The same check_faithfulness() is also exposed as an MCP tool, returning {"passed": int, "total": int}, so an AI agent can confirm the gate before trusting the rules.