Skip to content

[User Feedback] actions: custom actions lack a supported guardian-only authorization boundary #841

Open

Description

@yunfanye

Situation

This came from user feedback. An app author wants a custom read-only action to allow only the guardian, using host-resolved identity rather than caller-supplied input.

Pain

The reporter cannot distinguish guardian, visitor, and anonymous callers through the supported action SDK. Static inspection supports the reported gap:

  • ActionExecutionContext exposes event emission but no caller identity.
  • CurrentActionContext exposes execution, app, and agent metadata but no session actor.
  • packages/core/src/actions/context.ts stores an internal actor but omits it from the SDK projection.
  • Action visibility controls agent allow-list access; it does not express a guardian-only caller policy.

The existing app API contract exposes trusted request.caller identity and supports guardian-only route checks. That provides a route-level mechanism, but does not establish an equivalent action-level boundary across invocation paths. Action domain errors also have no HTTP status field; this alone is not evidence of a defect.

The reporter describes inspecting an empty-input action on app-runtime 0.6.7. No runtime reproduction was performed during this triage, and no authorization bypass is established.

Possible directions

  • Document an existing supported guardian-only action pattern, if one exists, including its coverage across invocation paths.
  • Consider a host-enforced action access policy or trusted read-only identity contract, with explicit handling of autonomous and sessionless executions.
  • Clarify how authorization denials map to action results and HTTP responses without coupling all actions to HTTP.

Source: Rome Cloud user feedback, submitted 2026-10-09T16:17:06.546916Z, build 1.1.145. Filed automatically by Feedback Triage.

Activity

  1. added
    feature-requestThe change is undecided — a pain, gap, or feature idea filed to start a design conversation
    needs-triageAwaiting triage / needs a maintainer to categorize
    on Oct 10, 2026
  2. added
    P2Fix in the normal course of work
    on Oct 10, 2026
  3. yunfanye commented on Oct 10, 2026

    @yunfanye
    ContributorAuthor

    Deeper triage — a re-analysis of the user feedback behind this issue, against current source.

    Initial triage

    • Still present after the reported build. Comparing 1367eb171e06512f70839566f935590f6acbb8af with 067d1f72bf99b34524393fbc99ab2ec2aa172ac6 found no change to the SDK identity projection. Main ships app-runtime 0.7.1, but its execution context and current-action contract still have no caller kind. The strict action configuration schema also has no caller policy.

    • Ruled out identity loss at the worker boundary. handleRootCall() resolves the actor, executeInSubprocess() puts it in the worker payload, and executeInCurrentProcess() restores it in the execution store. The omission happens when constructing the handler context and SDK projection. See root resolution, worker payload, and handler invocation.

    • The existing actor has audit semantics, not a caller-authorization contract. Anonymous and absent actors differ. Resolution failures also produce an absent actor without stopping execution. Approval replay can replace the requester with the approver, or restore the requester when no ambient actor exists. These behaviors matter before exposing the actor for authorization. See resolution and absence and the approval-replay tests.

    • Denial can already be a domain result. invokeActionResult() preserves { status: "error", error }. A throwing handler becomes ActionInvocationError instead. Across workers, thrown errors retain only their name and message, not an HTTP status. An app API handler must explicitly map a domain denial to a 403 response. See result handling and worker error reconstruction.

    The full record identifies an agent-filed SDK report, not a browser failure. The database was healthy and no apps were failed or broken. No route, browser, or viewport was supplied.

    Suspected root cause

    Confidence: high — identity acquisition and ordinary worker transport already exist. The missing contract is at the action execution boundary. The host projects selected store fields without the actor, while the handler receives only event emission. Factory injection cannot supply a captured per-call identity either: the lazy loader caches the action instance. This is a missing supported capability, not a demonstrated breach of an existing guardian-only action policy.

    Possible fixes

    1. Add a minimal, read-only identity accessor or execution-context field. Define anonymous, autonomous, resolution-failure, loopback, and approval-replay behavior. Keep identity separate from app-editable context patches and avoid exposing unnecessary account details.
    2. Add an action access policy to ActionConfigSchema and the SDK. Enforce it in the engine's root, nested, detached, and replay paths before executing the body. This centralizes enforcement but requires a decision about sessionless agent and routine work.
    3. Keep owner-only operations behind app API handlers and document that limitation. Specify a domain-denial convention and its HTTP mapping. This avoids a new action policy but does not give directly invoked actions caller-based authorization.

    Any implementation needs tests for SDK-visible identity, nested and worker calls, absent identity, resolution failures, and approval replay. Existing actor tests verify execution records rather than that SDK contract.

    How to reproduce

    These steps are derived from code and were not executed during this read-only investigation.

    1. In a clean core test fixture, register a read-only defineAction() probe with z.strictObject({}). Inspect the second handler argument and getCurrentActionContext() inside execute().
    2. Invoke it with {} through ActionEngine.run(), using controlled runWithSessionActor() fixtures for guardian, visitor, and anonymous actors. Repeat outside any actor scope.
    3. Compare the host execution store with the SDK-visible objects. The host store carries each supplied actor, but neither supported action context exposes its kind. A direct action.execute({}) call also lacks host identity and is therefore not a sufficient authorization test.

    Triage confidence: high — The reported build and pinned main both retain actors internally but omit them from both supported action contexts. Source and tests establish worker propagation, audit failure behavior, approval replay semantics, and transport-independent domain errors.
    Re-analyzed against 067d1f72bf (main); reporter build 1.1.145 at 1367eb1, 62 commits behind main. Posted automatically by Feedback Triage (re-triage of the user feedback behind this issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Fix in the normal course of workfeature-requestThe change is undecided — a pain, gap, or feature idea filed to start a design conversationneeds-triageAwaiting triage / needs a maintainer to categorize

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions