Skip to main content

ContextSection

@forge/monorepo


@forge/monorepo / backend/src / ContextSection

Type Alias: ContextSection

ContextSection = object

Defined in: backend/src/context/index.ts:13

Properties

body

readonly body: string

Defined in: backend/src/context/index.ts:16


cacheable

readonly cacheable: boolean

Defined in: backend/src/context/index.ts:39


estimatedTokens

readonly estimatedTokens: number

Defined in: backend/src/context/index.ts:19


expiresAt?

readonly optional expiresAt?: string

Defined in: backend/src/context/index.ts:40


kind?

readonly optional kind?: ContextKind

Defined in: backend/src/context/index.ts:42

Budget bucket. Defaults to user-context when a provider does not specify one.


origin

readonly origin: ContextOrigin

Defined in: backend/src/context/index.ts:38

Whether this content may instruct the agent (#145, AC-4).

Required, with no default. A provider has to decide, so "nobody thought about it" is a compile error rather than external content quietly reaching the system prompt as instruction.

Not the same as sensitivity, and the difference matters in the worst direction. Sensitivity is confidentiality — who may see this. Origin is provenance — may this instruct. A page fetched off the public web is public sensitivity and the least trustworthy content in the system.

external content is rendered inside a delimited envelope with delimiter forgery neutralised; see security/prompt-safety.ts. A platform section that interpolates untrusted values — a filename, a tool name, a user-supplied label — stays platform and neutralises those values itself, so the section's own instructions are not swallowed by an envelope that says nothing inside it is an instruction.


priority

readonly priority: number

Defined in: backend/src/context/index.ts:18

Higher priority survives pruning longer.


provenance

readonly provenance: string

Defined in: backend/src/context/index.ts:21

Where this came from, so a claim in the output can be traced back.


providerId

readonly providerId: string

Defined in: backend/src/context/index.ts:14


pruneStage?

readonly optional pruneStage?: PruneStage

Defined in: backend/src/context/index.ts:45

When set, this section is eligible for pruning in that stage. Unset ⇒ preserved (recent turns, open tool continuity, base policy).


sensitivity

readonly sensitivity: ContextSensitivity

Defined in: backend/src/context/index.ts:22


title

readonly title: string

Defined in: backend/src/context/index.ts:15