# Content policy and distribution

What a catalog workflow may be used to make, who may select a given weight, and
where each of those answers comes from. This document describes the system; the
per-artifact rows live in the generated
[model licence register](./model-licences.md), and the owner's decisions live in
the decision blocks of 13, 14 and 15 September 2026 in
`ISIS_CHROMA_RUNPOD_MVP_TODOS_2026-09-11.md`.

Code: `libs/isis/workflows/src/content-policy.ts` (the declarations and the
decision), `libs/isis/workflows/src/output-chain-policy.ts` (the plate rule),
`apps/isis/generation-api/src/services/catalog-content-policy.ts` (enforcement
and the catalog projection),
`apps/isis/generation-api/src/services/output-chain-policy.service.ts`, and the
submit path in `apps/isis/generation-api/src/services/job.service.ts`.

## 1. Two declarations, answering two different questions

Both are properties of the **workflow definition**, not of the caller. Neither
is inferred at runtime.

| Declaration                        | Question                                           | Values                                                                               | Derived from                                 |
| ---------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------- |
| `content_policy` (+ `policy_note`) | What may this workflow be used to make?            | `adult_ok`, `sfw_only`                                                               | The licences of every weight the graph loads |
| `option_policy[input][option]`     | Who may select this weight, and what does it make? | `distribution`: `service`, `internal_only`; `content`: `neutral`, `racy`, `explicit` | The Civitai grant flags of that weight       |

They are independent. A workflow can be `adult_ok` while one of its checkpoint
options is `internal_only`, and the two refusals are different codes with
different statuses. `policy_note` names the licence fact the value rests on, so
the reason travels with the declaration.

The declaration is checked against the definition's own inputs by
`validateContentPolicyDeclaration`:

- `content_policy` present and one of the two values; `policy_note` a non-empty
  sentence;
- every `option_policy` key is an enum input of this workflow and every option
  key one of that enum's options;
- every option of a `checkpoint` or `lora` enum, other than the exempt value
  `none`, has an entry;
- **no enum defaults to an `internal_only` option** — a tenant who never touches
  the field would otherwise be handed a weight the tenant catalog hides;
- every `option_details` key names a real option, because the tenant catalog
  hides an internal-only option's details **by option name** and a key naming no
  option would never be hidden.

The policy-bound categories are `chroma`, `motion`, `heavy-image` and `zimage` —
the ones that exist only under the worker-comfyui contract. A workflow outside
them is `not_applicable`; a workflow inside them that declares nothing is
refused, never defaulted.

## 2. The owner's boundary

The policy system implements a boundary the owner set, and the boundary is the
reason the system is not simply "allow everything the licence allows".

From the decisions of 13 and 14 September 2026:

- **No porn and no sexual acts.** In the owner's words: "i dont want to do porn
  or sexual stuff not interested never interested".
- **In scope:** music video, dance, nude yoga and classy artistic nudity —
  "music-video and Bayonetta-grade, tasteful film nudity".
- **Settings, environments and costumes weigh as much as people and poses.**
- **Explicit sex-act LoRAs are out of scope**, although they dominate Civitai's
  download charts. The tier taken is realism, anatomy, body-shape sliders, dance
  and camera.
- **No model enters only for benchmarking when its licence is not good for
  production use.** This struck Krea 2, FLUX.2 klein 9B, the abliterated klein
  encoder and Anima from the toolbox scope, and removed the `eval_only`
  distribution tier that had existed only for them.

`adult_ok` therefore means "no licence clause stops this", not "anything goes".
The boundary itself is enforced by what the catalog offers and what is excluded,
not by a runtime classifier — `judgeSubmitContentRating` is explicit that it
never looks at pixels.

## 3. How a workflow's policy is derived

A family is `adult_ok` when **every** weight the graph loads is released without
an acceptable-use clause restricting sexual content, and `sfw_only` when one of
them is. The derivation as it stands (register read dates 2026-09-13, Krea 2 and
Sulphur-2 re-read 2026-09-15):

| Family                                       | Policy     | The licence fact                                                                                                                                                                                                         |
| -------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Chroma, Z-Image, Wan 2.2, Animate-2, SCAIL-2 | `adult_ok` | Apache-2.0 or MIT, no acceptable-use clause, and the bases render anatomy natively.                                                                                                                                      |
| LTX-2.x                                      | `sfw_only` | The LTX-2 Community License incorporates Lightricks' acceptable use policy: no "sexual intercourse or sex acts", no "sexual fetishes or fantasies", and in its API section no "sexually explicit or suggestive content". |
| HiDream-O1                                   | `sfw_only` | The base blurs skin.                                                                                                                                                                                                     |
| FLUX.2 klein 4B                              | `sfw_only` | The stock Qwen3 encoder blocks adult prompts, and the only abliterated encoder is non-commercial (excluded).                                                                                                             |
| Qwen-Image                                   | `sfw_only` | Weak at nudity by design.                                                                                                                                                                                                |

Three of those four `sfw_only` values are **house rules about capability**, not
licence restrictions. That distinction is invisible in the `content_policy`
field and matters for the plate rule in §6, which reads the licence strings
again rather than the policy value.

A licence is read, not remembered: every row in the register carries its source
URL and a verified-on date, and re-reads have twice overturned a first reading
(Krea 2's and Sulphur-2's exclusion reasons were both wrong and are now recorded
with the corrected clause).

## 4. The refusal order at submit

Everything below happens **before the model cache is leased, before a job row
exists, and before an outbox entry exists**, so a refused submit leaves nothing
queued and nothing billed. The order is the order in
`JobService.submit`/`submitAdmitted`:

1. **3D capability readiness** (`assertThreeDCapabilitySubmittable`) — a job for
   an unavailable 3D capability is refused before the idempotency lookup.
2. **3D model-family policy** (`assertThreeDModelFamilyPolicy`) — an excluded
   family, or a gated one with no recorded grant, is refused `403` from every
   workflow id the executor would read.
3. **Hosted lane policies** (`assertHostedLaneSubmittable`,
   `assertOpenRouterLaneSubmittable`) — operator only, reviewed model only,
   `sfw_only`, no benchmark or training use, no tenant upload.
4. **Catalog content policy and distribution** (`assertSubmitContentPolicy` →
   `assertCatalogContentPolicy`):
   - `403 distribution_internal_only` when a non-operator selects an
     `internal_only` weight. **This is decided first**, because it is a question
     of who is asking and the answer does not depend on the content.
   - `422 content_policy_violation` when an `sfw_only` workflow is asked for a
     preset or a selected option rated `racy` or `explicit`. Every offence is
     listed, not just the first. **An unreadable preset rating counts as an
     offence** — an unreadable rating is not a neutral one.
   - `422 content_policy_missing` when a policy-bound workflow declares no
     usable policy, including when its definition file cannot be read. It fails
     closed rather than permissive.
5. **The plate rule** (`assertSubmitOutputChainPolicy`, §6) — `422` on an input
   an `adult_ok` workflow may not take.
6. **The submit-time content judgement** (`judgeSubmitContent`, §7) is recorded
   on the job. It runs _after_ the gate on purpose: the gate is what makes an
   `sfw_only` workflow's `neutral` an observation rather than an assumption.
7. **The model-cache lease** (`admit`, tracker L.04.03) —
   `409 models_not_cached` or a hold as `awaiting_cache`.

Later, at dispatch and still before any GPU time is billed, the executor refuses
a worker-comfyui job whose parameters or metadata carry no consent id
(`PROVENANCE_CONSENT_REQUIRED`): "The provenance ledger needs a consent id for
every generation". A retry re-submits through the whole order above and is
judged against the policy **as it is now**, not as it was; a chain advances step
by step and each step is judged in turn.

**Who counts as the operator comes only from verified credentials.** The routes
stamp `metadata.authenticatedTenantId` from the verified token or API key and
drop whatever a client put there; the tenant set is `ISIS_OPERATOR_TENANT_IDS`
(default `tenant_isis_dev`). A client cannot promote itself by writing to job
metadata.

In the catalog listing, a non-operator never sees an `internal_only` option and
never sees a workflow whose policy is unreadable — it could not be submitted
anyway.

## 5. The Civitai flag rule

Civitai's grant is a set of permission flags per model version. The rule, from
the 13 September decision and implemented in the option policies:

- **`Image` (sell the generated media) _and_ `Rent` (use on a generation
  service) → `distribution: service`.** The weight may appear in a tenant-facing
  catalog.
- **`Image` without `Rent` → `distribution: internal_only`.** The weight is
  pulled and used for Isis rendering Oshun's own media, and is never listed to
  Lilith users.
- **`RentCivit` only → excluded entirely.** No right to sell generated images or
  to use them on a generation service.

The worked case is **Photonic Fusion Chroma**: its grant is `Image` and
`RentCivit` only — no `Rent`, no `Sell` — verified on 2026-09-13 through the
model API, so it is `internal_only` on `chroma-txt2img`. UnCanny, Chroma1-HD and
UnGloryHail carry all four flags and are `service`. The NSFW posing and motion
LoRAs are `Image` without `Rent` and are `internal_only` by the same rule.

Two exclusions are about rights the flags do not speak to at all: a LoRA
imitating a named studio or a living artist is excluded whatever its flags say
(publicity rights, passing off, trade marks), and a Civitai version with a
permanent `paidAccess` is never pulled. A version in an open early-access window
is **deferred, not excluded**: it is pulled after the window ends.

## 6. The plate rule: an output carries its licence's reach

A still made by an `sfw_only` workflow is not automatically a safe plate for an
adult render, and the reason is that the two kinds of `sfw_only` from §3 behave
differently downstream:

- **A house rule does not bind the output.** Qwen-Image, FLUX.2 klein 4B and
  HiDream-O1 are Apache-2.0 or MIT; nothing in their licences says what an
  output may become. Their stills **may** feed an `adult_ok` workflow.
- **An acceptable-use clause does bind the output.** The LTX-2.x community
  licence incorporates Lightricks' acceptable use policy, which speaks about the
  output. An `ltx25-av` clip **may not** become the input of an `adult_ok`
  render, whatever it depicts.

So `outputBindingFor` reads a fact rather than a filename: the producing
workflow's `models_required`, each model's manifest licence string, and whether
any of those strings carries an acceptable-use clause. `evaluateOutputChainRule`
then decides, for one input of one job or chain step:

| Situation                                                 | Result                                                                                                                                      |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| The consuming workflow is not `adult_ok`                  | The rule does not apply.                                                                                                                    |
| No binding licence and no unknown model                   | Allowed.                                                                                                                                    |
| A binding licence                                         | `422 output_acceptable_use_policy`, naming the model and quoting its licence string.                                                        |
| A model the manifest does not know                        | `422 output_acceptable_use_policy` — an unknown model **counts as bound**, because the alternative is guessing in the permissive direction. |
| An input with no provenance naming its producing workflow | `422 output_provenance_missing`.                                                                                                            |

**The producing job is read from the output's own URL, never guessed**, and the
producing workflow id is resolved with the same override order the executor uses
(a workflow named in metadata counts as much as one named in parameters). An
upload or an external URL is outside the rule: it is about what Isis made.

## 7. What the job records about itself

`judgeSubmitContentRating` writes a submit-time judgement onto the job so a
later chain step does not have to be told it. It is a judgement about **the
declared inputs of one request** — the workflow's `content_policy`, the ratings
of the weight options selected, and the preset's rating. It is not a
classification of the pixels that come back; nothing in it looks at an image.

- `sfw_only` workflow, nothing non-neutral selected → **`neutral`**, and the
  basis names the gate that makes it an observation.
- Anything rated `racy` or `explicit` selected → **that rating**, most
  restrictive first, naming what carried it.
- `adult_ok` workflow with nothing non-neutral selected → **`unknown`**. The
  prompt is unconstrained and no declaration rated it. Callers treat unknown as
  unknown; it is not neutral.
- A preset rating this build cannot read → **`unknown`**, with the unreadable
  value quoted.

A job with no catalog declaration records nothing, and the chain advancer treats
a missing judgement exactly as it treats `unknown`. This is the standard the
hosted lanes need: a hosted vendor must not be sent material anyone declared
racy or explicit, and it applies its own moderation to the rest.

## 8. The stylised gate (owed, and binding meanwhile)

Stylised and anime work joined the repertoire on 14 September with a condition
attached. **Until an adult-appearance gate exists, every stylised workflow and
every style option is `sfw_only`**, and the submit path refuses racy or explicit
content on them through the ordinary §4 mechanism. That part is live today; it
needs no new code, because it is a declaration.

The gate itself is tracker item **E.06.01 and is not built**. What it is
specified to do, recorded here so that nothing claims it early:

- prompt screening for age terms and youth-coded descriptors;
- an output age-appearance classifier with a documented licence and threshold,
  run on every output of a stylised workflow or style LoRA;
- a positive refuses delivery and records the job;
- an unavailable classifier **fails closed**;
- false positives measured on an adult stylised set; false negatives taken from
  the classifier's own published evaluation — **never** by generating or
  collecting images of minors;
- the classifier's name, licence and threshold go into the register when it is
  chosen, not before.

Legal basis: Coroners and Justice Act 2009 s.62, which covers drawn images.

## 9. Changing any of this

- **A model's licence or flags**: edit the manifest row's `license` string and
  regenerate the register in the same commit
  (`node scripts/isis/model-licence-register.mjs`). Its `--check` test fails
  when the checked-in file differs from what the manifest generates, so a model
  cannot enter the catalog in a commit that does not also state its licence.
- **A workflow's policy**: edit `content_policy`, `policy_note` and
  `option_policy` in the definition. `validateContentPolicyDeclaration` is run
  over the catalog by the specs, and the API caches the read declaration per
  workflow id (`resetCatalogContentPolicyCacheForTests` exists for tests).
- **The operator tenant set**: `ISIS_OPERATOR_TENANT_IDS`.
- **An exclusion**: it goes in the register's exclusions table with its clause
  and read date. The table's own instruction is "Never add these, and do not
  re-evaluate them without a new licence reading."
