> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Inheritance

> Create inheriting variants of clinical document sections and templates with the Corti API — scale across customers, departments and specialties by overriding only the fields you need while inheriting the rest from a parent resource

Inheritance is how you scale your library across customers, departments and specialties without duplicating prompts. A child section or template references a parent via `inheritFromId`; any field you omit in `generation` is inherited from the parent's **published** version at request time. Override only the fields that materially differ — the rest stay in sync with upstream improvements.

Both sections and templates support inheritance via the same `inheritFromId` mechanism. The override semantics differ slightly between resources — sections inherit instructions field-by-field, templates inherit `instructions.prompt` and the section composition.

<Tip>For the full decision matrix on **when** to inherit vs. author detached, plus the seven canonical override patterns, see the [Customization Cookbook](/textgen/customization-cookbook).</Tip>

***

## Inheriting from an existing section

Instead of writing a section from scratch, you can inherit from an existing one and override only the fields you need. The published version of the referenced section provides the defaults; any field you omit in `generation` is inherited.

```json title="Inherit & override" expandable theme={null}
{
  "name": "HPI (Pediatric)",
  "languages": ["en"],
  "inheritFromId": "<your-section-id>",
  "generation": {
    "instructions": {
      "writingStylePrompt": "Use family-centred language; refer to the patient as 'the child'."
    }
  }
}
```

<Note>Inheritance follows the **published** version of the referenced section at request time. If the upstream section is republished with improvements, your inherited section will pick them up for any field you have not overridden.</Note>

<Warning>
  **Omitted or empty-space fields are inherited.** Any field you leave out of `generation` — or set to an empty string (`""`) or whitespace-only string — is treated as "not overridden" and inherited from the parent. This means you **cannot** explicitly blank out a prompt field by setting it to an empty string; the parent's value will be used instead. **Workaround for explicit erasure:** if you need a child section to have *no* content for a prompt field that the parent defines (e.g. clear the parent's `miscPrompt` so nothing is emitted), set the field to a sentinel value the model will treat as empty — a dash (`"-"`) to visually communicate "intentionally left blank," or a diamond (`"◇"`) as a subtle placeholder icon in clinical UIs. This is a known limitation of the inheritance model; a future update may support explicit null/clear semantics on individual fields.
</Warning>

***

## Inheriting from an existing template

You can create a template that inherits from another template's published version. Fields you omit in `generation` are inherited; fields you provide override.

```json title="Inherit & override" expandable theme={null}
{
  "name": "Post-Consultation Note (Pediatrics)",
  "languages": ["en"],
  "inheritFromId": "<your-template-id>",
  "generation": {
    "instructions": {
      "prompt": "Produce a pediatric consultation note. Refer to the patient as 'the child'."
    }
  }
}
```

If you omit `sections` from `generation`, the inherited template's section composition is kept as-is. Provide a `sections` array if you want to replace the section composition entirely.

<Note>Inheritance resolves against the **published** version of the referenced template at request time. Future improvements to the upstream template propagate to fields you have not overridden.</Note>

***

## Inheriting from a Corti Standard — important caveats

<Warning>
  **Inheriting from a Corti Standard — silent updates.** Corti improves and refines its [Corti Standard](/textgen/corti-standards) sections and templates continuously. Updates are typically **silent** — small prompt refinements and quality fixes ship the same way many small API releases do, **without per-change notes**. Only clear schema-breaking changes or significant behavior changes are explicitly communicated.

  **Inheritance cannot pin you to a specific upstream version.** If your integration requires staying on a specific behavior, **do not use `inheritFromId` against a Corti Standard** — instead, **re-create** the resource as your own by copying its configuration into a `POST /documents/sections` (or `POST /documents/templates`) request *without* `inheritFromId`. The new resource is yours to version; subsequent Corti updates will not reach it.

  This caveat applies specifically to inheritance from Corti Standards. When inheriting from sections or templates you yourself authored, your project controls the publish cadence — there are no silent updates from Corti to worry about.
</Warning>

## Typical Standard improvements

When you inherit from a Corti Standard, the following kinds of upstream changes propagate automatically to any field you haven't overridden:

| Area                 | What changes                                                                                                                                                                                                           | Why                                                                                                     |
| :------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------ |
| `writingStylePrompt` | Refined phrasing guidance — e.g. tighter medical terminology, linguistically correct register for a locale                                                                                                             | Corti continuously improves clinically and linguistically correct phrasings across supported languages. |
| `contentPrompt`      | New inclusion or exclusion instructions — e.g. explicitly prompting the model to capture a finding it was prone to omitting, or excluding a detail the clinical team determined doesn't belong in a particular section | Discovered through real-world cases where the model leaned the wrong way without explicit guidance.     |
| `outputSchema`       | Non-breaking schema improvements — e.g. adding or refining a `fallbackString` for better empty-state rendering, adjusting a `default`, or extending an `enum` with a newly supported value                             | Improves deterministic output quality without changing the shape downstream consumers rely on.          |

<Note>These improvements are additive by design. If you've overridden a field (e.g. `writingStylePrompt`), your override takes precedence and the Standard's improvement to that field does **not** propagate — only un-overridden fields pick up upstream changes.</Note>
