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

# Context composition

> How Formation records each prompt section and its source, and how the dashboard and inspectors show them.

Formation records prompt sections and their sources at assembly time. This page
is the contract for reading them. What enters a prompt, and why, is covered in
[context resolution](https://docs.formation.texturehq.com/runtime/context-resolution.md).

## Two views

* **Agent → Effective context** (`GET /api/agents/{slug}/context`) shows current
  static instructions and conditional/dynamic slots. It requires normal agent
  access. Source settings links edit current configuration, never historical
  evidence. Published organization inputs have their own source labels.
* **Inspector model inputs** show sections captured for each actual model call,
  after memory/history selection and budgeting. Embedded inspectors read them
  with an agent diagnostic key; see [inspector access](https://docs.formation.texturehq.com/runtime/inspector-access.md). Existing normalized request and
  tool-schema components remain the outer accounting boundary.

## Additive manifest contract

`manifest.version` stays 1. New recordings set `composition_version: 1` and attach
`sections` to `instructions` and `assembled_context` components. Older manifests
have neither field; clients must preserve their existing whole-component view.

Each section has `id`, `label`, `target`, `role`, `source` (kind, reference,
revision), `status`, `reason`, `digest`, `start_byte`, `end_byte`, and
`estimated_tokens`. Ranges address UTF-8 bytes in one normalized message,
including its preceding separator. They are not character offsets into redacted
text. Source revisions are content hashes, except versioned agent instructions,
which carry the profile revision. Conditional sections omitted from a call have
no content/range. Selections retain individual memory/history evidence.

Section estimates sum to the text contribution only. Parent component estimates
also include message framing/images. Nested section totals must never be added
again to overall input totals. These are heuristic estimates, not provider usage.

## Content and safety

Stored manifests contain metadata only, never section text. Inspector reads with
retained-content permission resolve ranges against the original retained
normalized request and validate their digest before returning `text`. The normal
credential redactor then processes each section and the raw request. Metadata-only
reads return `content_status: not_requested`; pruned or unverifiable content is
`unavailable`; successful reads are `available`. Never reconstruct missing text
from current configuration or slice offsets into a redacted request.

Relative source `href` values point to current agent settings. Clients may resolve
them against their authorized Formation origin, accepting only same-origin agent
paths. A source link does not claim that current settings still equal a captured
revision. Exact copies refer to redacted normalized input, not provider-specific
wire transformations. Existing retention, authorization and pruning apply.

## Boundaries

The assembler owns section identity/provenance. The ledger stores the manifest.
Formation authorizes and hydrates retained content. SDKs decode additive fields.
Inspectors render sections and separate estimates from provider totals. Client
application context remains a separately recorded normalized request component;
this change does not invent app-authored subdivisions or a new policy system.

## Tool terminology

Tool usage instructions and tool defaults are sections of system-prompt text.
Tool definitions are the callable names, descriptions and JSON schemas recorded
as separate `tool_schema` components. Tool calls are execution events, shown in
Activity. Inspectors should keep one definitions catalog and link to it from usage
guidance rather than creating another catalog. Section display labels may improve
without rewriting the text sent to the model, stable section IDs or older records.

## Organization inputs, agent personalization, and comparison

Published settings carry stable field IDs, a display catalog, an inclusion
policy, and a separate permission to edit. Agent settings use that same
catalog. The assembler and recorded-input manifest use the resulting field
ID, label, source, and inclusion reason. A required field cannot be omitted.
Locked fields take the organization value. An available field starts omitted.
A policy change affects resolved inputs immediately after publication.

Agent starter templates seed an editable profile draft. Saving it creates
an ordinary agent instruction revision with the same provenance as any authored
profile. Organization fallback instructions apply when the agent has no authored
profile, while shared organization instructions can apply to every agent.

**Effective context → Compare prompts** appears once organization settings have
been published. It renders the agent's current configuration twice, without and
with the organization settings. For historical evidence use the inspector for
the actual model call. New organization configuration is used only after an
instance receives a versioned document.

### What organization settings change in the prompt

| Text without organization settings | With organization settings |
| - | - |
| The shared-workspace paragraph and the second instruction to preserve actor attribution | One read-only rule covers separate participants and attribution. |
| Inline concise and colleague-like wording | Each enabled reply preference comes from its resolved field. |
| A default voice mixed into factual reporting | The proven reporting rules remain read-only. The configured voice comes from the reply settings. |
| A sentence classifying the current request together with retrieved history | The context marker identifies retrieved history and memory as untrusted data. The next message carries the attributed request. |
| Generic fallback persona when a fallback is configured | The configured fallback supplies the base agent instructions. |
| Tool instructions, permission boundaries, reply format, and turn-dependent playbooks | These remain attached to their corresponding runtime, capability, or turn sections. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.