feat(start-sdk,start-os): tell an action who is running it - #4045
Merged
Merged
Conversation
`access` decides whether another service may run an action, but the action was never told which service that was: run_action used the caller's id for the access check and then forwarded only the action id and the input. Any identity an action needed had to come from its input, where a service allowed to call it could name another package, so an action could not be limited to the caller's own resources. StartOS now forwards the caller. Service::run_action and Service::get_action_input take it, the actor messages carry it into the procedure's params, the container runtime passes it on, and the SDK hands it to the run handler, the prefill function and a function-valued input spec as `caller`: a package id, or null for the user and for StartOS reading a form to evaluate a task. It comes from the effect context the call arrived on, so a package cannot set it. SDK 3.0.0 already requires StartOS 0.4.0.2, which is where this lands.
MattDHill
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
access: 'dependent' | 'public'decides whether another service may run an action througheffects.action.run, but the action was never told which service that was.run_actionused the caller's id for the access check and then forwarded only(procedure_id, action_id, input), so any identity an action needed had to come from its input — and a service allowed to call it could name another package there. That makes it impossible to write an action that lets a service act on its own resources and nothing else.StartOS now forwards the caller, and the SDK hands it to the package.
Service::run_actionandService::get_action_inputtakecaller: Option<PackageId>, carried through theRunAction/GetActionInputactor messages into the procedure's params besideinput/prefill. The effects pass the calling service's id — including when a service reaches one of its own actions that way. The user's RPC passesNone, and so do the two places StartOS reads a form itself to evaluate a task, since that form is the one the user will be shown.calleroff the params and passes it toSystem.runAction/getActionInput. The 0.3.5 compat system takes it and ignores it.caller: ActionCaller(PackageId | null) to therunhandler, the prefill function and a function-valued input spec.Action.run/getInputtake it as optional and normalise a missing one tonull.No
#[ts(export)]type or CLI surface changes, so there are no bindings or man pages to regenerate. SDK 3.0.0 already requires StartOS 0.4.0.2, which is where this lands, so a package that relies oncallercannot be installed on a server that does not send it.The book gains Knowing Who Is Calling under Controlling Access, with the rule that identity comes from
callerand never from the input. The SDK changelog has the entry; following #4037, nothing user-visible changes in StartOS itself.First consumer: Start9Labs/tor-startos, to let a service add an onion address to one of its own bindings.
Verification
cargo check -p start-coreandmake start-core-format-checkpass.@start9labs/start-core:tscclean; newactionCaller.test.tscovers a service caller, the user, a runtime that names nobody, and that the input spec, the prefill andrunall see the same caller; the full suite passes (16 suites).make bundle,make check,make test(124 tests) pass.npm run checkagainst the rebuilt bundle andnpm testpass.Not in this PR
effects.action.getInputfor another package's action is not gated byaccessthe wayrunis —get_action_inputinservice/effects/action.rsdispatches straight to the target. A service can therefore read the form, prefill included, of an action it is not allowed to run. Forwarding the caller makes that more visible rather than worse, and closing it is a behaviour change that deserves its own decision, so it is left alone here.