#7514·CopilotKit

Core headers are sent to user-supplied agents on other origins

Author: BenTaylorDevCreated Sep 29, 2026Updated Sep 29, 2026
Labelsquestion

applyHeadersToAgent copies core headers onto every HttpAgent. That includes selfManagedAgents and agents__unsafe_dev_only agents, whose URL can be on another origin. This has been deliberate since #5635.

With async auth builders now first-class (#7510), the common case becomes sending the signed-in user's bearer token to a third-party agent URL. The docs now warn about this.

To decide: should core headers reach only agents on the runtime's origin, or be opt-in per agent? Either one changes behavior for apps that rely on #5635 today.