Docs Overview
An open contract for reliable agent harnesses: what ContextOS provides, how to adopt one workflow, and where the normative specification starts.
ContextOS is an open contract for reliable agent harnesses. Its decision-control and evidence specification defines what context enters a run, which authority permits an action, what evidence establishes the outcome, and how a team evaluates the next release.
Use it around an existing agent runtime, managed service, or application-owned loop. Start with one workflow whose accepted outcomes and prohibited effects you can test. Platform and product engineers implement the boundaries; security and operations teams inspect the same evidence. The current direction explains the compatibility and evidence requirements as execution systems evolve.
What you can use today
| Artifact | What it gives you | What your deployment supplies |
|---|---|---|
| Published JSON schemas | Versioned shapes for context, tools, decisions, delegation, and replay | Semantic validation, identity, authorization, persistence |
| Deterministic compiler reference | Executable context admission, policy resolution, budgets, manifests, and controls | Production retrieval, model calls, and enforcement at execution boundaries |
| Execution Contract and Control Profiles | Compatible exact-profile admission, action/approval binding, boundaries, data/memory lifecycle, durable effects and aggregate accounting validators | Trusted brokers/observations, actual isolation/egress, atomic stores, metering and provider recovery |
| Conformance | Deterministic assessment and five useful synthetic workflow references | Current independent evidence and positive/negative cases for the exact workflow, implementation, release and environment |
| Adoption guide and worked quickstart | A path through one workflow and its acceptance cases | Business rules, credential isolation, tools, outcome verification |
| Harness engineering and evaluation protocol | Ownership, evidence, comparison, recovery, and release discipline | Measured deployment results and an achievable fallback |
This repository publishes the specification and conformance reference. Schema validity establishes structure; it does not certify correct outcomes, secure infrastructure, or portability between untested runtimes. “Open contract” describes its public interface; the repository license retains all rights reserved.
Explore the five planes
Hover or click each plane to see its primitives and the typed contracts it owns.
Decision plane
- Cognitive loop layers
- Planner / Executor / Critic
- Current delegated authority
- Durable lifecycle + resume checks
- Protected shared budgets
- Decision Catalog
- Plan
- DecisionRecord
- CriticReport
- RunExecutionState
- ExecutionCheckpoint
The five planes
The planes are responsibilities, not a mandatory service topology. Add graph retrieval, promoted memory, specialist agents, or durable execution when workflow evidence justifies them. The required authority, context, effect, and outcome boundaries still apply to a small implementation.
┌───────────────────────────────────────────────────────────────┐
│ TRUST PLANE │
│ policy · ActionRisk · identity · evaluators · OTEL · replay │
├───────────────────────────────────────────────────────────────┤
│ ACTION PLANE │
│ Tool Gateway · MCP · A2A · OpenAPI · idempotency │
├───────────────────────────────────────────────────────────────┤
│ DECISION PLANE │
│ cognitive loop · Planner / Executor / Critic · subagent lanes│
├───────────────────────────────────────────────────────────────┤
│ CONTEXT PLANE │
│ Context Pack Compiler · token budgets · runtime controls │
├───────────────────────────────────────────────────────────────┤
│ INTELLIGENCE PLANE │
│ ontology · knowledge graph · memory · embeddings · identity │
└───────────────────────────────────────────────────────────────┘| Plane | What it covers | Foundation docs |
|---|---|---|
| Intelligence | Substrate of meaning | ontology, knowledge-graph, memory, identity-layer |
| Context | Per-request compilation | cognitive-core, agentic-context-engineering |
| Decision | Bounded execution loop | cognitive-core, orchestration |
| Action | Governed external effects | adapter-mesh |
| Trust | Control over the other four | governance, evaluation-observability, improvement-loop, security |
Improvement surfaces by plane
ContextOS treats the harness as a versioned artifact that can improve from traces, scorecards, corrections, and replay. The Improvement Loop may propose changes across all five planes, but each plane owns both a tunable surface and an invariant that the optimizer cannot relax.
| Plane | Improvement surface | Invariant |
|---|---|---|
| Intelligence | source contracts, ontology refinements, graph retrieval policy, memory promotion candidates | no silent ontology breaking change, no uncited durable memory, no unpinned knowledge snapshot |
| Context | retrieval top_k, source priority, bucket budgets, compression strategy, prompt fragments | required evidence, policy manifests, redaction, and tool eligibility cannot be dropped for cost or latency |
| Decision | planner templates, tool ordering, re-plan budgets, subagent lane policy, Critic rubrics | plans cannot bypass evidence checks, approval gates, loop guards, or DecisionSpec binding |
| Action | adapter timeout/retry policy, cached read-only aliases, circuit breakers, adapter version routing | schemas, ActionRisk ceilings, compatibility-mode projections, credential exchange, and idempotency cannot be weakened |
| Trust | evaluator thresholds, sampling, replay sets, rollout gates, proposal ranking | safety and policy are floor constraints; proposals never auto-promote themselves |
This is the practical reading of “autotune” in ContextOS: search may discover better harness configurations, but every candidate remains a typed proposal that passes replay, review, and staged rollout before release.
Cross-cutting primitives
These primitives connect the appropriate boundaries; individual envelopes retain their declared required/optional fields:
RunContext—run_id,trace_id,session_id,tenant_id,user(delegation),agent(workload identity),safety_mode,run_budget.ActionRisk— native effect, authority, reversibility, interaction, and data-scope vector.ApprovalMode— required v1 compatibility projection:read_only/local_write/network/delegated/destructive.ContextPack— versioned and immutable; signed when an adopted supply-chain profile requires it.CompiledContext—compiled_prompt, manifests, runtime_controls, budget_report.DecisionRecord— typed outcome with evidence_refs, approvals, controls_active, trace_id.ToolEnvelope—ToolCallEnvelope/ToolResultEnvelopewith policy decision, native-risk fields where available, v1 mode projection, idempotency, evidence refs, and W3C trace context.- Execution attachments — exact profile/control refs and features,
ActionBinding, scoped authority and stored approval, boundary/data/memory checks, durable run/operation/checkpoint state, and aggregate reservations. They preserve the existing envelopes and Context Pack layout.
The canonical execution contract
invokeAgent(request_envelope, run_context)
→ admit(exact profiles, actual features, implementation support)
→ compile(packs, request, run_context) → CompiledContext
→ loop {
planner(CompiledContext) → Plan
critic.verify(Plan) → ok | replan | reject
executor(Plan, ToolGateway) → step_results, evidence
critic.score(step_results) → accept | retry | replan | escalate
consolidate(effects, evidence) → memory_proposals
}
→ DecisionRecord(evidence_refs, approvals, controls_active, trace_id)Every doc references back to this contract. Schemas and canonical types are authoritative at their published version. Prose examples are explanatory or deployment blueprints unless explicitly labeled normative.
At dispatch, recheck current authority, exact approval, actual boundary/data route and reserved budget. A provider timeout can leave an effect unknown; cancellation or checkpoint restore cannot turn it into absence, replenish budget or authorize blind retry. Personal/proactive, enterprise, durable/delegated and high-assurance profiles select exact cumulative requirements with workflow-specific evidence, rather than declaring universal readiness for every domain.
What is authoritative vs. blueprint
| Layer | Authoritative source |
|---|---|
| Context Pack schema | /docs/implementation/context-pack + JSON Schema |
| Runtime invocation contract | /docs/implementation/api-contracts |
| Execution attachments and processing | Execution Contract + additive execution schema |
| Exact required controls and evidence | Control Profiles, Conformance |
| Decision Spec | /docs/implementation/decision-catalog |
| Decision Record | /docs/implementation/decision-record |
| Native action-risk taxonomy and v1 projection | /docs/foundations/governance#action-risk-vector-2026 |
| TS reference compiler | src/lib/contextos/{types,compiler,test-harness}.ts (reference only — not the production runtime) |
New patterns are validated against working systems before they land in the normative spec. The roadmap can describe candidates, but only versioned schemas and canonical types make them contract.
Reading paths
Platform engineers building the runtime → Adopt a Harness Contract → API Contracts → Context Pack → Reference Architecture. Consult the relevant foundations when implementing a boundary.
Product engineers building agents on top of the runtime → Adopt a Harness Contract → Quickstart → Decision Catalog → Decision Record → Workflow Examples.
Applied AI / ML integrating models and retrieval → Cognitive Core → Agentic Context Engineering → Knowledge Graph → Identity Layer → Evaluation and Observability.
Security / governance assessing the runtime → Control Profiles → Execution Contract → Conformance → Governance → Security and Compliance → High-Risk Workflow.
Executives evaluating the investment case → Adopt a Harness Contract → Invest Early in ContextOS → Evaluation and Observability. Ask for verified completion, intervention effort, prohibited effects, and cost on your workflow before expanding investment.
Document status
Every doc declares a status in its frontmatter. The badge identifies the page’s purpose, not the maturity of every statement on that page. Contract maturity is stated at the artifact or section level using the four layers at the top of this page: normative contract, conformance reference, integration or deployment profile, and planned evolution.
| Status | Page purpose |
|---|---|
| Living Document | Maintained orientation, glossary, or operational guidance. |
| Foundational Spec | Stable architectural semantics; only explicitly normative definitions are contract. |
| Implementation Guide | Concrete adoption patterns and contract usage. |
| Integration Guide | Protocol-specific mapping; the external protocol remains independently authoritative. |
| Reference Design | Detailed subsystem or deployment design, including non-normative implementation choices. |
| Reference | Focused lookup or spec-to-source mapping. |
| Tutorial | Guided learning path whose examples defer to published schemas and types. |
| Use Case Playbook | Domain profile that applies the contract without extending it. |
| Research Synthesis | Dated evidence-to-spec analysis. |
| Research Note | Dated exploratory analysis; non-normative unless a linked artifact has been promoted. |
| Framework Revision | Versioned direction with explicit current and planned boundaries. |
The test suite rejects unknown status values and requires an ISO last_reviewed date on every documentation page. Neither field by itself promotes an interface, example, or roadmap proposal into the canonical contract.
Quick links
- Soul, operating philosophy → The SOUL of ContextOS
- Overview, end-to-end → How It Works
- Adopt one workflow → Adoption guide
- Work through the contracts → Quickstart
- Architecture → Reference Architecture
- Glossary → Glossary
- Status, source of truth → schemas linked from each implementation doc