Raw: https://promptreports.ai/docs/source-terms.md

# Source terms

When ContextFile takes in a web source, it reads the terms the source's publisher states for its use. A context packet names each source's terms class, leaves out the sources the org's rule does not allow, and says which it left out and why.

Built, off. It stays off until ContextFile switches on CONTEXTFILE_SOURCE_TERMS. While it is off, ContextFile reads and stores no terms.

ContextFile reports what a publisher states. It gives no legal opinion, and a terms class is not advice on whether a use is allowed.

## What is read

ContextFile reads terms written to the RSL 1.0 standard (rslstandard.org) from three places: License lines in the site's robots.txt, the page's Link header, and the page's license link and RSL script elements. It fetches a license document the way it fetches the page, through the same robots.txt check. It stores the terms with that version of the source, with the time read, the URL they came from and the document's digest.

## The classes

| Class | What the publisher states |
|---|---|
| allowed | The use is allowed |
| attribution | The use is allowed with attribution |
| payment_asked | The publisher asks for payment |
| prohibited | The use is prohibited. Terms that are stated but cannot be read count here too, a choice that waits on the owner's review |
| no_terms_found | ContextFile found no terms |

## The org's rule

By default a packet loads allowed, attribution and no_terms_found sources, and leaves out payment_asked and prohibited ones. An owner or admin reads the rule with get_source_terms_rule and changes it with set_source_terms_rule (GET and POST /v1/source-terms/rule). Each change is kept as a new row.

## In the packet and the brief

A context packet for a task lists web_sources, each with its terms_class, and web_sources_left_out, each with its reason: terms_class_not_in_org_rule or over_budget. A left-out source's text never enters the packet.

In the [agent brief](https://promptreports.ai/docs/the-agent-brief/), a work item's context part counts the sources left out for their terms (sources_left_out_for_terms). While the switch is off, the count reads not available, never 0.
