Skip to content

feat(sdk): tell internal hosts which account is calling - #21

Merged
fforres merged 1 commit into
skywardfrom
fforres/internal-host-caller-identity
Oct 9, 2026
Merged

fforres merged 1 commit into
skywardfrom
fforres/internal-host-caller-identity

Conversation

@fforres

@fforres fforres commented Oct 9, 2026

Copy link
Copy Markdown

What changes for users

A Worker exposed as an internal integration (a *.internal host served over a service binding) can now tell who is calling. Every request Executor routes to it carries the acting account in x-executor-account-id. That lets an internal integration restrict tools to some accounts, for example admin-only tools, which org-wide tool policies cannot express.

How

  • HostedHttpClientOptions.internalCaller: routeInternalHosts sets x-executor-account-id on requests to a configured internal host. It always removes a value the request already carried, so a connection header cannot spoof it, and it never adds the header for other hosts.
  • makeScopedExecutor passes its accountId. The platform view has no subject, so its internal requests carry no caller.

Tests

hosted-http-client.test.ts: the binding sees the configured caller instead of a spoofed value, sees no header when no caller is configured, and an external host never receives it. packages/core/sdk (970) and packages/core/api (132) pass.

@fforres
fforres merged commit a859b42 into skyward Oct 9, 2026
4 of 40 checks passed
@fforres
fforres deleted the fforres/internal-host-caller-identity branch October 9, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant