# Education (/docs/use-cases/education)



The education use case covers K-12 districts, university research groups,
ed-tech startups, and learning-platform vendors building AI tutors, homework
help, study-skill coaches, or curriculum-authoring assistants. Procurement
usually gates the buy on three things:

* Identifier redaction, so a pasted transcript doesn't leak student PII to the model.
* A per-session spend cap, so a runaway loop can't burn the district's quota.
* Per-district tenancy, so one district's data and spend never reach another's.

This page is the landing for the use case. Three sub-pages go deeper:

* [Student safety](/docs/use-cases/education/student-safety): the shipped
  redaction patterns and how to extend them for your district.
* [FERPA / COPPA scope](/docs/use-cases/education/ferpa-coppa): what the
  compliance posture covers and what it doesn't. Read it before signing a
  procurement form.
* [Per-district tenant + cost-cap](/docs/use-cases/education/per-district-tenant):
  multi-tenant composition and cost ceilings at the gateway boundary.

## Who this is for [#who-this-is-for]

* A district team standing up an AI homework helper behind a per-student or
  per-session spend ceiling.
* An ed-tech vendor adding a tutor to an LMS, where the district is the
  customer and the student is the data subject.
* A university research group capturing every chat session for
  semester-over-semester comparison.
* A startup whose buyer expects a FERPA / COPPA conversation and asks what you
  redact before the model sees it.

## Quickstart [#quickstart]

```bash
npm install @pleach/recipes @pleach/compliance
```

```ts
import { educationAgent } from "@pleach/recipes/education";

const bot = educationAgent({
  districtId: "district-1234",
  complianceProfile: "ferpa+coppa",
  contentSafety: ["self-harm", "profanity"],
  costCapUsdPerSession: 0.25,
});

const reply = await bot.ask(
  "Hi Mrs. Johnson — Student ID 9876543 needs help with fractions",
);
// LLM sees: "Hi Mrs. Johnson — [STUDENT] needs help with fractions"
```

That config wires three pieces:

1. The **student-safety scrubber** from `@pleach/compliance/education` (see
   [Student safety](/docs/use-cases/education/student-safety)). It redacts the
   message before `ask()` forwards it, wherever you later persist the transcript.
2. A **per-session cost-cap policy** at your ceiling. You drive it from your own
   per-turn gate (see
   [Per-district tenant + cost-cap](/docs/use-cases/education/per-district-tenant)).
3. A **compliance profile plugin** that maps the FERPA / COPPA labels to the
   closest shipped analog, `gdpr`. A notice prints to your console.

## What you get [#what-you-get]

* Redaction of student ID patterns, grade bands, school-issued email domains,
  and labeled parent contact lines in the user message.
* A per-session cost ceiling on the runtime.
* A `districtId` tag your audit ledger, cost aggregator, or billing pipeline can
  read to scope writes to one district.
* The same `Chatbot` surface as [`simpleChatbot`](/docs/recipes/simple-chatbot):
  `ask`, `newSession`, `reset`, `runtime`.

## What you provide alongside it [#what-you-provide-alongside-it]

Plan for these in your procurement review.

**Your district's duty.** The FERPA / COPPA review stays with you. See
[What you provide](/docs/use-cases/education/ferpa-coppa#what-you-provide)
for the controls that belong to your district.

**Setup.** `educationAgent.ask()` doesn't enforce the cost cap. For a hard
cutoff, wire `CostCeilingMiddleware` from [`@pleach/gateway/swarm`](/docs/gateway)
at the routing boundary. See
[Per-district tenant + cost-cap](/docs/use-cases/education/per-district-tenant).

**Not in Pleach yet:**

* **A FERPA or COPPA profile.** The [`ComplianceProfile`](/docs/compliance)
  union is `"hipaa" | "gdpr" | "pci-dss" | "soc2"`. `educationAgent` accepts
  `ferpa`, `coppa` and `ferpa+coppa`, applies the `gdpr` bundle, and records
  both the requested and applied profile. This isn't full FERPA / COPPA
  adequacy.
* **Pedagogical replay.** The `pedagogicalReplay` field is recorded and doesn't
  change runtime behaviour.
* **Content-category moderation.** The scrubber redacts student-identifying
  fragments only. `contentSafety` is recorded for your telemetry. For
  category-level enforcement, wire a moderation API or your own classifier.

## Config reference [#config-reference]

```ts
type EducationContentSafetyCategory =
  | "self-harm"
  | "age-inappropriate"
  | "profanity"
  | "off-curriculum";

type EducationComplianceProfile = "ferpa" | "coppa" | "ferpa+coppa";

interface EducationAgentConfig extends SimpleChatbotConfig {
  /** Stable district / institutional tenant id. Required. */
  districtId: string;
  /** Pseudonymous per-student attribution id. Optional. */
  studentId?: string;
  /** FERPA / COPPA profile. Maps to `gdpr` bundle today. */
  complianceProfile?: EducationComplianceProfile;
  /** Recorded on the runtime. */
  contentSafety?: readonly EducationContentSafetyCategory[];
  /** Recorded only; gateway is the enforcement point. */
  perDistrictMonthlyBudgetUsd?: number;
  /** Recorded only; greenfield runtime required. */
  pedagogicalReplay?: { enabled: boolean };
  /** Default 0.50. Drives the in-memory cost-cap ceiling. */
  costCapUsdPerSession?: number;
  /** Default true. Pass false to skip student-safety scrubbing. */
  studentSafetyEnabled?: boolean;
}
```

## Source [#source]

The factory ships from `@pleach/recipes/education`. Its helpers ship from
`@pleach/compliance/education`. The per-root-turn cost cap in
[Per-district tenant + cost-cap](/docs/use-cases/education/per-district-tenant)
ships from `@pleach/core/spawn`.

## See also [#see-also]

* [Student safety](/docs/use-cases/education/student-safety)
* [FERPA / COPPA scope](/docs/use-cases/education/ferpa-coppa)
* [Per-district tenant + cost-cap](/docs/use-cases/education/per-district-tenant)
* [Worked example: a district privacy request](/docs/use-cases/education/records-request)
* [`@pleach/recipes` overview](/docs/recipes-pleach-recipes)
* [`compliantChatbot`](/docs/recipes/compliant-chatbot): the sibling recipe for
  HIPAA / GDPR / PCI-DSS / SOC 2.
