Context Layer

System Boundary

Context Layer sits between applications and model providers. It governs how LLM executions occur. The system boundary defines which responsibilities belong to the application domain, the Context Layer runtime, and model providers. This separation prevents confusion about runtime responsibility.

Architecture overview

Application
│
▼
Context Layer
│
▼
LLM Provider

System responsibilities

Application

  • Defines the execution request
  • Determines how results are used
  • Orchestrates external tools and services

Context Layer

  • Enforces execution admission before requests proceed
  • Controls construction of execution context
  • Enforces session and workflow state rules
  • Controls provider invocation routing
  • Enforces validation of invocation results against constraints
  • Produces Authority Reports for Flow workflows

LLM Provider

  • Performs model inference
  • Generates language output
  • Determines token usage and latency

Context Layer is a runtime execution boundary, not an application framework.

Execution boundary

Context Layer governs execution behavior after a request leaves the application and before the provider receives the invocation. It also governs verification and enforcement after the provider returns a response.

Anything before the request reaches Context Layer is outside its authority. Anything related to model inference inside the provider is outside Context Layer authority.

What Context Layer controls

When Context Layer is used as the runtime boundary, model providers are invoked by the Context Layer runtime rather than directly by the application. Applications submit execution requests; provider invocation is controlled by the runtime.

Admission

  • Execution admission Enforces validation of incoming execution requests before processing begins.
  • Identity binding Derives project identity, execution mode, and permissions from the API key.
  • Execution mode enforcement Ensures the request structure matches the execution mode associated with the API key.

Runtime Coordination

  • Session lifecycle management Creates, validates, and terminates sessions according to execution mode rules.
  • Flow workflow ordering Enforces sequential step ordering for Flow workflows.
  • Canonical context construction Controls context construction in a fixed, reproducible order from declared inputs and scoped memory.
  • Authority contract enforcement Enforces behavioral guarantees defined in the Runtime Contract before provider invocation.

Invocation Governance

  • Provider routing Controls routing of invocation to the configured LLM provider.
  • Invocation verification Enforces validation of provider responses against runtime constraints.
  • Authority report generation Produces the Authority Report upon Flow session termination.

Outside Context Layer

Applications control:

  • Business logic
  • UI behavior
  • Tool orchestration
  • Database access
  • Prompt strategy
  • Interpretation of user inputs
  • LLM provider SDK usage

Applications decide when to run an execution and how to use the result. Context Layer does not execute application logic.

Model providers control:

  • Model inference
  • Language generation
  • Token usage
  • Model reasoning
  • Provider-side latency

Context Layer does not control how models think or generate responses. It only governs execution boundaries.

External systems:

Context Layer does not execute databases, APIs, agent tools, or external services. Applications orchestrate these systems.

Runtime guarantees

Within its runtime boundary, Context Layer guarantees:

  • Every execution passes through admission control
  • Execution rules are enforced consistently across all executions
  • Workflow ordering is strictly enforced
  • Authority constraints are enforced
  • Provider invocation policies are enforced

Outside this boundary, Context Layer makes no guarantees.

Why this boundary exists

Without a runtime boundary:

  • Execution rules live inside application code
  • Constraint enforcement is inconsistent
  • Session lifecycle is difficult to enforce
  • Workflow ordering cannot be guaranteed

Context Layer centralizes these responsibilities.

Summary

  • Applications decide what to execute.
  • Context Layer governs how execution occurs.
  • Model providers generate the output.