Home › Glossary › Safety › Context Security

Advanced · Safety

Context Security

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. Protecting the integrity and confidentiality of what enters and leaves an agent's context window.

Technical Definition

Protecting the integrity and confidentiality of what enters and leaves an agent's context window.

How it works

Context security has two directions. Inbound: prevent untrusted content from acquiring instruction authority — label provenance, isolate untrusted segments, strip control sequences, cap tool output size, and never let retrieved text alter policy. Outbound: prevent secrets and regulated data from leaking — redact credentials before injection, apply per-tenant filters to retrieval, and scan generated output before it is sent to third parties. Because the model itself is not a reliable enforcement point, both directions are implemented in the surrounding runtime.

Related Concepts

  • Context Poisoning — An attack or accident in which false or hostile content enters an agent's context and corrupts its subsequent reasoning and actions.
  • Context as a Security Boundary — The design principle that an agent's context window is a trust boundary: what enters it defines what the agent can be persuaded to do.
  • Context Lifecycle — The stages a piece of context passes through: acquisition, validation, injection, use, compaction, persistence, and expiry.
  • Agent Trust — The calibrated confidence a system or person places in an agent, grounded in verified identity, bounded authority, and observed behaviour.