---
library: "bootstrap"
slug: "Context"
name: "Context"
ref: "Context#c1b7"
hash: "sema:Context#mh:SHA-256:c1b72256dc4732033ee42cc07ff5d9fb60a7f1a3e5634449c343692a33340756"
type: "Data Structures"
layer: "Infrastructure"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/Context"
---

# Context

Portable execution environment with inherited constraints

Infrastructure · 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://semahash.org/vocabularies/bootstrap/patterns/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://semahash.org/vocabularies/bootstrap/patterns/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.

## Where this came from

—

## Builds on

- [Identity](https://semahash.org/vocabularies/bootstrap/patterns/Identity.md) (references)
- [Constraint](https://semahash.org/vocabularies/bootstrap/patterns/Constraint.md) (references)

## Used by

- [Act](https://semahash.org/vocabularies/bootstrap/patterns/Act.md) (references)
- [AgentSandbox](https://semahash.org/vocabularies/bootstrap/patterns/AgentSandbox.md) (references)
- [BreadthGovernor](https://semahash.org/vocabularies/bootstrap/patterns/BreadthGovernor.md) (references)
- [ContextCompress](https://semahash.org/vocabularies/bootstrap/patterns/ContextCompress.md) (references)
- [ContextFirst](https://semahash.org/vocabularies/bootstrap/patterns/ContextFirst.md) (references)
- [ContextSwitch](https://semahash.org/vocabularies/bootstrap/patterns/ContextSwitch.md) (accepts)
- [CreativeBlend](https://semahash.org/vocabularies/bootstrap/patterns/CreativeBlend.md) (accepts)
- [DataMinimization](https://semahash.org/vocabularies/bootstrap/patterns/DataMinimization.md) (references)
- [Defer](https://semahash.org/vocabularies/bootstrap/patterns/Defer.md) (references)
- [DeliberativeAlign](https://semahash.org/vocabularies/bootstrap/patterns/DeliberativeAlign.md) (references)
- [EmpathySim](https://semahash.org/vocabularies/bootstrap/patterns/EmpathySim.md) (references)
- [EvaluatorOptimizer](https://semahash.org/vocabularies/bootstrap/patterns/EvaluatorOptimizer.md) (references)
- [Handoff](https://semahash.org/vocabularies/bootstrap/patterns/Handoff.md) (accepts)
- [HolographicShard](https://semahash.org/vocabularies/bootstrap/patterns/HolographicShard.md) (references)
- [Nestmap](https://semahash.org/vocabularies/bootstrap/patterns/Nestmap.md) (references)
- [NoiseInjection](https://semahash.org/vocabularies/bootstrap/patterns/NoiseInjection.md) (references)
- [OODA](https://semahash.org/vocabularies/bootstrap/patterns/OODA.md) (composes_with)
- [Observe](https://semahash.org/vocabularies/bootstrap/patterns/Observe.md) (yields)
- [PerspectiveEnsemble](https://semahash.org/vocabularies/bootstrap/patterns/PerspectiveEnsemble.md) (references)
- [Proprioception](https://semahash.org/vocabularies/bootstrap/patterns/Proprioception.md) (references)
- [Reason](https://semahash.org/vocabularies/bootstrap/patterns/Reason.md) (accepts)
- [RequestFraming](https://semahash.org/vocabularies/bootstrap/patterns/RequestFraming.md) (references)
- [RetrievalAugment](https://semahash.org/vocabularies/bootstrap/patterns/RetrievalAugment.md) (references)
- [SelfReminder](https://semahash.org/vocabularies/bootstrap/patterns/SelfReminder.md) (references)
- [StrategicReading](https://semahash.org/vocabularies/bootstrap/patterns/StrategicReading.md) (references)
- [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md) (references)
- [Think](https://semahash.org/vocabularies/bootstrap/patterns/Think.md) (accepts)
- [ToolInvoke](https://semahash.org/vocabularies/bootstrap/patterns/ToolInvoke.md) (references)
- [WorkerMode](https://semahash.org/vocabularies/bootstrap/patterns/WorkerMode.md) (references)

## Related

- [ContextCompress](https://semahash.org/vocabularies/bootstrap/patterns/ContextCompress.md)
- [ContextSwitch](https://semahash.org/vocabularies/bootstrap/patterns/ContextSwitch.md)
- [AnchorDrop](https://semahash.org/vocabularies/bootstrap/patterns/AnchorDrop.md)
- [Nestmap](https://semahash.org/vocabularies/bootstrap/patterns/Nestmap.md)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: Context#c1b7
- Hash: sema:Context#mh:SHA-256:c1b72256dc4732033ee42cc07ff5d9fb60a7f1a3e5634449c343692a33340756

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/Context
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/Context.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
