---
slug: "Context"
name: "Context"
type: "Data Structures"
layer: "Infrastructure"
ref: "Context#c1b7"
sema_id: "sema:Context#mh:SHA-256:c1b72256dc4732033ee42cc07ff5d9fb60a7f1a3e5634449c343692a33340756"
tags: ["Infrastructure","Data Structures"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/Context/
related: ["Constraint","Identity","Act","AgentSandbox","BreadthGovernor","ContextCompress","ContextFirst","ContextSwitch","CreativeBlend","DataMinimization","Defer","DeliberativeAlign","EmpathySim","EvaluatorOptimizer","Handoff","HolographicShard","Nestmap","NoiseInjection","Observe","OODA","PerspectiveEnsemble","Proprioception","Reason","RequestFraming","RetrievalAugment","SelfReminder","StrategicReading","Task","Think","ToolInvoke","WorkerMode","AnchorDrop","Nestmap#8b8f"]
---

# Context

Portable execution environment with inherited constraints

Layer: Infrastructure · Category: Data Structures

## Mechanism

The portable execution environment and state container for an agent. It encapsulates: (1) Inherited Constraints (Safety/Budget), (2) Available Tools/Capabilities, (3) Working Memory (History/Variables), and (4) [Identity](https://mindscape.pages.dev/bootstrap/Identity.md) Claims. Context flows through delegation chains, acting as the 'Stack Frame' of the agentic system. It allows agents to be paused, moved, or cloned.

## Invariants

- [Constraint](https://mindscape.pages.dev/bootstrap/Constraint.md) Monotonicity: Child contexts can ADD constraints but never REMOVE inherited ones.
- Serializability: The entire context must be serializable to JSON/Storage for persistence.
- Provenance: Every item in the context must be traceable to its source (Observation, User Input, or Inference).

## Preconditions

- Parent context exists (or Root is created)
- Schema is defined

## Postconditions

- Agent has a valid environment to execute.

## Failure modes

- Context Contamination/Leak: Private data from one context leaking into another (e.g., across tenant boundaries).
- Context Poisoning: malicious prompts or data injected into the context to hijack agent behavior.
- Stale Context: Acting on outdated information after a long pause.
- Context Explosion: Size grows beyond the window limit of the model.

## Data schema

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "constraints": {
      "type": "array"
    },
    "history": {
      "type": "array"
    },
    "variables": {
      "type": "object"
    }
  }
}
```

## Builds on

- [Constraint](https://mindscape.pages.dev/bootstrap/Constraint.md) (Infrastructure; References)
- [Identity](https://mindscape.pages.dev/bootstrap/Identity.md) (Infrastructure; References)

## Used by

- [Act](https://mindscape.pages.dev/bootstrap/Act.md) (Infrastructure; References)
- [AgentSandbox](https://mindscape.pages.dev/bootstrap/AgentSandbox.md) (Society; References)
- [BreadthGovernor](https://mindscape.pages.dev/bootstrap/BreadthGovernor.md) (Mind; References)
- [ContextCompress](https://mindscape.pages.dev/bootstrap/ContextCompress.md) (Mind; References)
- [ContextFirst](https://mindscape.pages.dev/bootstrap/ContextFirst.md) (Mind; References)
- [ContextSwitch](https://mindscape.pages.dev/bootstrap/ContextSwitch.md) (Society; Accepts)
- [CreativeBlend](https://mindscape.pages.dev/bootstrap/CreativeBlend.md) (Mind; Accepts)
- [DataMinimization](https://mindscape.pages.dev/bootstrap/DataMinimization.md) (Society; References)
- [Defer](https://mindscape.pages.dev/bootstrap/Defer.md) (Mind; References)
- [DeliberativeAlign](https://mindscape.pages.dev/bootstrap/DeliberativeAlign.md) (Society; References)
- [EmpathySim](https://mindscape.pages.dev/bootstrap/EmpathySim.md) (Mind; References)
- [EvaluatorOptimizer](https://mindscape.pages.dev/bootstrap/EvaluatorOptimizer.md) (Society; References)
- [Handoff](https://mindscape.pages.dev/bootstrap/Handoff.md) (Society; Accepts)
- [HolographicShard](https://mindscape.pages.dev/bootstrap/HolographicShard.md) (Mind; References)
- [Nestmap](https://mindscape.pages.dev/bootstrap/Nestmap.md) (Mind; References)
- [NoiseInjection](https://mindscape.pages.dev/bootstrap/NoiseInjection.md) (Mind; References)
- [Observe](https://mindscape.pages.dev/bootstrap/Observe.md) (Infrastructure; Yields)
- [OODA](https://mindscape.pages.dev/bootstrap/OODA.md) (Mind; Composes with)
- [PerspectiveEnsemble](https://mindscape.pages.dev/bootstrap/PerspectiveEnsemble.md) (Mind; References)
- [Proprioception](https://mindscape.pages.dev/bootstrap/Proprioception.md) (Mind; References)
- [Reason](https://mindscape.pages.dev/bootstrap/Reason.md) (Mind; Accepts)
- [RequestFraming](https://mindscape.pages.dev/bootstrap/RequestFraming.md) (Mind; References)
- [RetrievalAugment](https://mindscape.pages.dev/bootstrap/RetrievalAugment.md) (Mind; References)
- [SelfReminder](https://mindscape.pages.dev/bootstrap/SelfReminder.md) (Mind; References)
- [StrategicReading](https://mindscape.pages.dev/bootstrap/StrategicReading.md) (Mind; References)
- [Task](https://mindscape.pages.dev/bootstrap/Task.md) (Infrastructure; References)
- [Think](https://mindscape.pages.dev/bootstrap/Think.md) (Mind; Accepts)
- [ToolInvoke](https://mindscape.pages.dev/bootstrap/ToolInvoke.md) (Infrastructure; References)
- [WorkerMode](https://mindscape.pages.dev/bootstrap/WorkerMode.md) (Society; References)

## Identity

- Sema ID: `sema:Context#mh:SHA-256:c1b72256dc4732033ee42cc07ff5d9fb60a7f1a3e5634449c343692a33340756`
- Ref: `Context#c1b7`
- Supersedes:
  - `sema:Context#mh:SHA-256:510af8317d84bfff7dbba4ebbe2ae2a14d0e28ed8ed342a4e8dbc2e3294c1353`
  - `sema:Context#mh:SHA-256:d5f79a21faef9ef640ab687c90a25cdf457a066fb6da23d247115b267c539132`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/Context/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#Context)
- [JSON](https://mindscape.pages.dev/bootstrap/Context.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
