# Core Concepts

> Concept pages covering Agent Stream's architecture, request pipeline, guardrails, cost governance, attribution, and how it extends governed model access to editors and enterprise document stores.

AI applications and agents that call LLM providers directly have no shared control point: every team wires up its own keys, retries, and safety checks, and nobody can answer who spent what, on which model. Agent Stream provides that shared control point: identity, guardrails, cost governance, and observability, configured once on a surface and applied to every call. [Architecture →](/products/affinidi-trust-fabric/agent-stream/concepts/architecture.md)

Agent Stream is part of the [Affinidi Trust Fabric](https://www.affinidi.com/trust-fabric), a suite of products for decentralised identity management, scope governance, and trust in agentic AI systems.

  Applications, agents, editors
  →
  Agent Stream
  →
  LLM providers and services

## Concepts in order

The concepts follow the order in which most teams build their understanding of Agent Stream: architecture and actors first, then trust-fabric integration, surfaces, model configuration, governance controls, operations, and lifecycle.

| Concept | What it explains |
| [Architecture](/products/affinidi-trust-fabric/agent-stream/concepts/architecture.md) | How Agent Stream sits between your applications and the providers they call, and how it is deployed as a single, hot-reloadable appliance. |
| [Entities and Actors](/products/affinidi-trust-fabric/agent-stream/concepts/entities-and-actors.md) | Overview of the actors, entities, credentials, and organisational references managed across Agent Stream. |
| [Trust Fabric integration](/products/affinidi-trust-fabric/agent-stream/concepts/trust-fabric-integration.md) | How gateway-to-gateway DIDComm, the model marketplace, and x402 payments put Agent Stream on the trust fabric. |
| [Surfaces](/products/affinidi-trust-fabric/agent-stream/concepts/surfaces.md) | How the LLM Surface fronts one provider adapter and the IDE Surface aggregates them into a governed model menu. |
| [Providers and Models](/products/affinidi-trust-fabric/agent-stream/concepts/providers-and-models.md) | How provider adapters, model capabilities, pricing, and request profiles resolve from the hot-reloadable catalogue. |
| [Surface Variants](/products/affinidi-trust-fabric/agent-stream/concepts/variants-and-rollout.md) | How named Surface variations inherit base configuration and support aliases, targeted rollout, and safe promotion. |
| [Prompt Management](/products/affinidi-trust-fabric/agent-stream/concepts/prompt-management.md) | How versioned prompt templates, point-in-time snapshots, and the interactive playground support centrally managed prompts. |
| [Pipeline and stages](/products/affinidi-trust-fabric/agent-stream/concepts/pipeline-and-stages.md) | The named stages every request passes through, and why unused stages add no latency. |
| [Security and access control](/products/affinidi-trust-fabric/agent-stream/concepts/security-and-access-control.md) | How identity, RBAC, secrets management, and SSRF protection secure callers and the appliance control plane. |
| [Policies](/products/affinidi-trust-fabric/agent-stream/concepts/opa-policies.md) | How gateway-level and surface-level Rego policies decide whether a request is allowed. |
| [Guardrails](/products/affinidi-trust-fabric/agent-stream/concepts/guardrails.md) | How Prompt Guard, Expert Witnesses, Judge, and Jury layer content safety around a call. |
| [PII protection](/products/affinidi-trust-fabric/agent-stream/concepts/pii-protection.md) | How Prompt Guard detects sensitive data and pseudonymises it with NER IDs or static redaction. |
| [Cost and usage governance](/products/affinidi-trust-fabric/agent-stream/concepts/cost-and-usage-governance.md) | How Agent Stream meters cost and tokens per stage and enforces budgets before they are exceeded. |
| [Cost and attribution](/products/affinidi-trust-fabric/agent-stream/concepts/teams-and-attribution.md) | How members and teams attribute spend and usage and enforce quota controls. |
| [Resilience and caching](/products/affinidi-trust-fabric/agent-stream/concepts/resilience-and-caching.md) | How failover, load balancing, retry, and response caching protect model calls. |
| [LLM drift detection](/products/affinidi-trust-fabric/agent-stream/concepts/llm-drift.md) | How a surface samples live traffic and replays captured sessions to track behaviour against a baseline. |
| [Governance records](/products/affinidi-trust-fabric/agent-stream/concepts/governance-records.md) | How signed, tamper-evident records and hash chains prove what entered a surface, how it was processed, and what left. |
| [Observability](/products/affinidi-trust-fabric/agent-stream/concepts/observability.md) | What telemetry Agent Stream produces, what the dashboard shows, and how to export it to your own stack. |
| [Storage and Lifecycle](/products/affinidi-trust-fabric/agent-stream/concepts/storage-and-lifecycle.md) | How Agent Stream manages persistence boundaries, hot-reloadable configuration, and warm-standby failover. |

## Pages in this section
- [Architecture](/products/affinidi-trust-fabric/agent-stream/concepts/architecture.md): How Agent Stream sits between your applications and the LLM providers and services they call, and how it is deployed as a single, hot-reloadable appliance.
- [Entities and Actors](/products/affinidi-trust-fabric/agent-stream/concepts/entities-and-actors.md): Overview of the actors, entities, credentials, and organizational references managed across Agent Stream.
- [Trust Fabric integration](/products/affinidi-trust-fabric/agent-stream/concepts/trust-fabric-integration.md): How gateway-to-gateway (G2G) DIDComm messaging, Verifiable Presentations, and x402 payments put Agent Stream on the Affinidi Trust Fabric.
- [Surfaces](/products/affinidi-trust-fabric/agent-stream/concepts/surfaces.md): How the LLM Surface and IDE Surface represent one governed connection to a provider or a governed model menu, and how a variant overlays behaviour without duplicating configuration.
- [Providers and Models](/products/affinidi-trust-fabric/agent-stream/concepts/providers-and-models.md): How Agent Stream uses provider adapters and a hot-reloadable catalogue to select models, pricing, capabilities, and request profiles for LLM Surfaces.
- [Surface Variants](/products/affinidi-trust-fabric/agent-stream/concepts/variants-and-rollout.md): How named, sparse configuration variations inherit a base Surface and support aliases, targeted rollout, and safe promotion.
- [Prompt Management](/products/affinidi-trust-fabric/agent-stream/concepts/prompt-management.md): How versioned prompt templates, point-in-time snapshots, and the interactive playground let teams manage, test, and render reusable prompt templates centrally.
- [Pipeline and stages](/products/affinidi-trust-fabric/agent-stream/concepts/pipeline-and-stages.md): The named stages every LLM request passes through, and why an unconfigured stage adds no latency.
- [Security and access control](/products/affinidi-trust-fabric/agent-stream/concepts/security-and-access-control.md): How Agent Stream distinguishes independent identity concerns, and how RBAC, secrets management, and SSRF protection secure the appliance's own control plane.
- [Policies](/products/affinidi-trust-fabric/agent-stream/concepts/opa-policies.md): How Gateway-Level, Surface-Level, and model Rego policies, evaluated by an embedded OPA engine, decide whether a request is allowed.
- [Guardrails](/products/affinidi-trust-fabric/agent-stream/concepts/guardrails.md): How Prompt Guard, Expert Witnesses, Judge, and Jury layer content safety and PII protection around a call, and why they fail closed by default.
- [PII protection](/products/affinidi-trust-fabric/agent-stream/concepts/pii-protection.md): How Prompt Guard detects personal and sensitive data with pattern matching and model-backed AI detection, and how NER IDs pseudonymize values without breaking the model's ability to reason over them.
- [Cost and usage governance](/products/affinidi-trust-fabric/agent-stream/concepts/cost-and-usage-governance.md): How Agent Stream meters cost and tokens per stage, enforces monthly budgets before they are exceeded, and alerts on anomalies.
- [Cost and attribution](/products/affinidi-trust-fabric/agent-stream/concepts/teams-and-attribution.md): How members and teams apply virtual-key controls, attribute spend and usage, and enforce ceilings for quota governance.
- [Resilience and caching](/products/affinidi-trust-fabric/agent-stream/concepts/resilience-and-caching.md): How cross-provider failover, load balancing, retry, and response caching keep model calls fast, available, and cheaper on repeated prompts.
- [LLM drift detection](/products/affinidi-trust-fabric/agent-stream/concepts/llm-drift.md): How Agent Stream samples live traffic and replays captured sessions to measure an LLM Surface against a pinned baseline, detect drift, and evaluate model or configuration changes.
- [Governance records](/products/affinidi-trust-fabric/agent-stream/concepts/governance-records.md): How Agent Stream produces a signed, tamper-evident Verifiable Credential for every interaction on a surface, and how a per-surface hash chain makes deletion or reordering detectable.
- [Observability](/products/affinidi-trust-fabric/agent-stream/concepts/observability.md): What telemetry Agent Stream produces for every call, what the dashboard shows, and how to export traces, metrics, and logs to your own stack.
- [Storage and Lifecycle](/products/affinidi-trust-fabric/agent-stream/concepts/storage-and-lifecycle.md): How Agent Stream persists data, manages process execution lifecycles, hot-reloads configuration changes, and coordinates active-passive failover.

