Console

Request metadata

Define governed attribution dimensions for applications, projects, and environments.

Define variables on a key

Each Gateway API key defines Metadata variable types, enums, required flags, defaults, indexes, and sensitivity. Application, customer, project, and environment are open attribution dimensions rather than mandatory pre-created resources.

Send metadata in a header

Declare and publish the example variables on the key before sending a JSON object in x-shieldon-metadata. Clients cannot write to the reserved _shieldon.* namespace. Do not put keys, prompts, model output, or sensitive personal data in Metadata.

x-shieldon-metadata: {"application":"support","environment":"development"}

Attribution and conditional routing

Use governed variables to attribute traffic and drive conditional routing. For missing required fields, type mismatches, or disallowed enum values, correct the request or publish updated definitions instead of removing validation.

Examples

Project attribution

Open Workspace → API Keys → the key’s Metadata action. Define project as a string and environment as an enum containing development and production; mark both Indexed and leave Sensitive off. Publish, then send the header below. Request Logs → Request details → Metadata shows the recorded values as JSON. Only defined, Indexed, non-Sensitive fields are recorded; an empty section does not require enabling Content Capture.

X-Shieldon-Metadata: {"project":"helpdesk","environment":"development"}

Route by environment

Bind the Key to a Policy with conditional routing: match environment = development to a development target and use the default target for other requests. Publish both the variable definitions and routing changes, call the logical model, and check the actual Provider in request details. Request values override Key defaults; variable defaults fill missing values. Required, type and enum validation still applies. Undeclared flat fields can be used for routing but are not automatically recorded.

Sensitive fields and budgets

A field marked Sensitive can still be validated and used for routing, but is omitted from usage-log Metadata even when Indexed is enabled. This is not encryption or content redaction: avoid storing secrets in defaults or request bodies. Metadata does not create a separate budget; use Workspace or Key budgets for budget isolation.

Next steps

Built-in attribution fields

New Releases include four optional system fields on every Gateway API key: user_id (stable business user identifier), user_name (display name at request time), session_id (conversation), and run_id (one Agent or workflow execution).

Send them in X-Shieldon-Metadata. Each value must be a non-blank string of at most 128 Unicode characters without control characters. Configure required fields per key; static defaults, renaming, deletion, and type changes are unavailable. Retries and fallback retain the same business run.

The three IDs support exact request filtering. Clicking an ID in request-log details scopes the filter to the current key. The display name is personal information for authorized request readers; it is excluded from ordinary logs, name filters, and default exports. These caller-supplied fields do not authenticate a Shieldon user.

Conflicting legacy definitions remain visible and block publication until explicitly resolved. Remove any corresponding key defaults. Existing Releases and historical records are not backfilled. See Traces guide to use these fields in Workspace → Traces.