Trusted Metadata Inputs for the New n8n Agent Builder
Hi n8n community,
I’m exploring the new n8n Agents / Agent Builder and have encountered a limitation when passing trusted metadata to tools.
The problem
Currently, I haven’t found a native way to pass metadata directly to a tool independently of the AI agent’s generated arguments.
For example, consider a shopping agent with an Order History tool. The agent should determine the user’s intent, but it shouldn’t control the identity or tenant information used to retrieve the data.
Agent-generated arguments:
{
"order_status": "delivered"
}
Trusted metadata from the application or workflow:
{
"customer_id": "verified-customer-id",
"tenant_id": "verified-tenant-id"
}
Ideally, the tool should receive both sets of values, while the LLM can control only the arguments explicitly exposed to it.
What I’m requesting
It would be helpful if Agent Builder supported:
-
Separating agent-controlled arguments from trusted runtime metadata.
-
Injecting metadata from upstream workflow nodes, authenticated application context, or the parent execution.
-
Preventing the LLM from overriding trusted metadata values.
-
Making this capability available to workflow-backed tools and other applicable tool types.
Adding metadata fields to a JSON Schema alone doesn’t solve this problem, because schema validation doesn’t establish where a value came from or whether it is trusted.
Current workaround
Wrapping tool operations in separate workflows and resolving metadata inside those workflows is a possible workaround. However, a native mechanism would simplify agent design and improve security for multi-tenant applications.
Previous implementation attempt
I previously submitted a feature request and attempted an implementation:
-
Original feature request: #41316 — Support trusted, non-LLM-controlled metadata inputs for Agent tools — closed on October 17, 2026.
-
Previous pull request: #41321 — feat(agents): support trusted runtime context for tools — closed without being merged.
The proposed implementation explored automatically detecting variables required by node tools, mapping values through the Message an Agent node, applying caller-value/tool-default precedence, and propagating runtime context through agent execution.
The previous PR also identified limitations around editor preview values, resumed sub-agent runs, and support being limited to node tools rather than workflow tools and MCP servers.
Request for review and testing
Has anyone found a clean way to implement this with the new Agent Builder? Is this capability already planned, or is there an existing pattern I may have missed?
I’d also appreciate feedback on the previous implementation approach. In particular, it would be helpful to review and test whether the runtime values remain separate from LLM-generated arguments, whether conflicts are handled correctly, and whether the values propagate reliably through delegated agents.
Security note: Hiding metadata from the LLM does not authenticate it. Tenant and authorization-sensitive values should come from verified upstream nodes or credential-backed sources.
Thanks!