Class ToolHeaderPolicy
Decides which headers of the agent's exchange are visible to a tool route.
The policy is default-deny: a tool never sees the raw inbound header set
(an HTTP consumer's Authorization / Cookie must not leak into every
tool call just because the tool is mounted on the same host). Only
, the run's resolved principal / audit tags, and the
names the route author opted into via
AgentRequest.PropagateToolHeaders are copied.
Principal and audit tags are propagated as resolved values, not as raw headers.
LlmProducer resolves the principal from the ?user= option first
(including its ${header.X} expression form) and only falls back to the
llm.user.id header; copying the header alone would silently drop the
option-driven case. Same for ?audit= tags. The raw headers are used as a
fallback so an engine driven without LlmProducer still propagates them.
Trust model: llm.user.id and llm.audit.* are read off the
inbound exchange by the producer, so a transport that forwards client headers
verbatim (a plain HTTP consumer) lets the caller set them. That is already true
for what the engine persists in MessageProps.UserId; propagating the same
value to tools does not widen it. The route — not this policy — is responsible
for stripping or overwriting client-supplied llm.* headers before the
llm:// hop when tools make access decisions on them.
public static class ToolHeaderPolicy
Inheritance
Methods
Apply(AgentRequest, IDictionary<string, object?>)
Fills target with the headers a tool route is allowed to see
public static void Apply(AgentRequest request, IDictionary<string, object?> target)
ParseCsv(string?)
Parses the CSV form used by the endpoint URI
public static IReadOnlyList<string>? ParseCsv(string? csv)