Metadata elements

Field reference for the Metadata Injection and Metadata Extraction canvas elements: inject fixed key/value pairs into headers or protocol extensions, and map HTTP headers into protocol metadata.

Two canvas elements manipulate metadata in the request pipeline. Metadata Injection adds fixed key/value pairs to requests or responses before they are forwarded. Metadata Extraction reads selected HTTP headers and normalises their values into the protocol metadata namespace before identity, policy, and Trust Check controls run.

Metadata Injection

The Metadata Injection element adds a fixed set of key/value pairs to every request or response flowing through the surface at the configured location. The upstream agent receives the injected metadata without any indication of its origin.

The direction (request or response) is set by the edge you drop the element on. One element per direction. Both can coexist on the same surface.

Fields

FieldTypeRequiredDefaultDescription
EntriesarrayYesKey/value pairs to inject. At least one entry is required.
KeystringYes (per entry)The header name, extension field name, body key, or query parameter name.
ValuestringYes (per entry)The value to inject. Supports secret references and dynamic tokens; see the Dynamic values reference below.
TargetselectNo (per entry)HTTP HeaderWhere this entry is placed. Options: HTTP Header, Protocol Extension (A2A / AP2 extension block), Body (JSON merge) (merged into the top-level JSON payload), Query Parameter.

Dynamic values

Use these tokens in any entry’s Value field. The gateway resolves them at injection time.

TokenResolved value
$REQUEST_IDCurrent request trace ID.
$TIMESTAMPInjection-time UTC timestamp.
$SURFACE_IDAgent Surface ID.
$SECRET:idValue of the secret with the given ID. Use the key icon next to the value input to select a secret from the configured list.

Metadata Extraction

The Metadata Extraction element reads values from selected HTTP request headers and normalises them into the protocol metadata namespace before identity extraction, policy evaluation, Trust Check, Workload Binding, and forwarding controls run. Use it when an upstream caller or managed agent presents metadata-like evidence only as HTTP headers but downstream controls need to read it from the protocol metadata namespace.

Applies to the request direction only. Drop it on a Managed Agent → A2A or AP2 Transit Point request edge. The header mapping editor is also available on the Access Point → Managed Agent request edge when the surface uses A2A or AP2 protocol; on MCP surfaces that edge disables the editor and no extraction occurs.

Fields

Header mapping

FieldTypeRequiredDefaultDescription
Namespace URIstringNohttps://fabric.affinidi.io/extensions/header-metadata/v1The protocol metadata namespace the extracted headers are written into. If Identity or another element reads this mapped metadata, configure it with the same URI.
Strip mapped headersboolNotrueWhen on, the gateway removes the source HTTP header from the request after extracting its value into metadata.

Header mapping rows

Each row maps one HTTP header to one protocol metadata field.

FieldTypeRequiredDefaultDescription
HeaderstringYes (per row)The HTTP request header name to read from (for example X-Agent-Id).
FieldstringYes (per row)The metadata field name to write to within the extension block.