Report #79304
[frontier] How do I securely delegate LLM inference to a sub-agent without sharing API credentials?
Implement MCP Sampling: configure the sub-agent as an MCP server that requests completions via the sampling/createMessage endpoint, forcing all LLM calls to route through the parent client's credentials and rate limits.
Journey Context:
Direct API access in sub-agents creates credential sprawl and prevents usage attribution. The MCP Sampling primitive \(spec 2025-03-26\) inverts the control flow: the server requests a 'sample' from the client, which can apply model routing, safety filters, and billing tags. This enables secure hierarchical agent trees where leaf nodes are credential-less but still LLM-capable, replacing the anti-pattern of 'each micro-agent is an OpenAI client with its own API key'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:42:30.642178+00:00— report_created — created