APS KV works in local `anna-app dev`, but fails on the Anna platform with `storage_token missing`

Hi Anna team,

I’m testing APS KV with an Anna App + Executa demo and found an inconsistency between local anna-app dev and the Anna platform runtime.

Demo repository:

This demo tests Host Upload, APS Files, and APS KV. The issue below is only about APS KV.

The App manifest declares:

{
  "permissions": ["tools.invoke", "ui.svg"],
  "host_capabilities": [
    "aps.kv",
    "aps.scope.user.read",
    "aps.scope.user.write"
  ],
  "ui": {
    "host_api": {
      "tools": ["required:tool-lightvoss-test-aps-8kvasxsg"],
      "storage": ["get", "set", "list", "delete"]
    }
  }
}

The Executa manifest declares:

{
  "name": "tool-lightvoss-test-aps-8kvasxsg",
  "version": "1.0.0",
  "host_capabilities": ["host.upload", "aps.files", "aps.kv"]
}

On the platform side, I have also enabled both “Persistent Storage” and “Host File Upload” permissions for this Executa.

The APS KV call flow is:

The frontend calls the Executa through Anna App Runtime:

await anna.tools.invoke({
  tool_id: "tool-lightvoss-test-aps-8kvasxsg",
  method: "aps_kv_set",
  args: {
    key: "test-aps/kv/demo",
    scope: "user",
    value: {
      title: "APS KV test",
      count: 1,
      updated_at: "2026-06-02T00:00:00Z"
    }
  }
});

The backend Executa receives aps_kv_set and then sends a reverse RPC call:

const kv = await reverseRpc("storage/set", {
  key: input.key,
  scope: input.scope,
  value: input.value
});

When running locally with anna-app dev, both KV write and read work correctly. The logs show:

[host-upload-test] aps kv set start {"key":"test-aps/kv/demo","scope":"user"}
[host-upload-test] reverse RPC -> host {"method":"storage/set","key":"test-aps/kv/demo","scope":"user"}
[host-upload-test] reverse RPC <- host ok
[host-upload-test] aps kv set complete {"ok":true}

A subsequent storage/get also successfully reads the value that was just written.

However, after publishing the same demo to the Anna platform, the same APS KV write fails with:

APS KV write failed -32021: storage_token missing — host did not authorize storage for this invoke

So locally, reverse RPC storage/set is authorized and succeeds. On the platform, with the same Executa, the same scope: "user", the same capability declarations, and the platform permission toggles enabled, storage/set fails because no storage_token is available.

Expected behavior:

The platform runtime should behave consistently with anna-app dev. After declaring aps.kv and enabling Persistent Storage permission, the Executa should be able to call storage/set/get/list/delete through reverse RPC during an invoke.

Actual behavior:

Local anna-app dev succeeds, but the platform runtime fails with:

-32021: storage_token missing — host did not authorize storage for this invoke

Could you help confirm:

  1. Is the platform correctly recognizing host_capabilities: ["aps.kv"] from the Executa manifest?
  2. After enabling Persistent Storage in the platform permission management UI, should the platform inject a storage_token for this Executa invoke?
  3. Does scope: "user" require any additional grant or configuration?
  4. Is there currently any difference between anna-app dev and the platform runtime in how APS KV authorization is handled?

I can provide the exact tool id, app id, platform logs, and screenshots if needed.

Hi @HappyLight! :waving_hand::sparkles:

Thank you so much for the super detailed report — the repro repo, logs, manifests, and screenshots made this a breeze to track down. You’re a star! :glowing_star: And great news: this is already fixed! :tada:

:bug: What was going on

Your diagnosis was spot on! :bullseye: The platform had two different invoke paths that handled reverse-RPC authorization asymmetrically:

  • :speech_balloon: The chat-agent path correctly minted and injected a storage_token for each invoke.
  • :window: The Anna App iframe path (anna.tools.invoke) was not minting one — so your Executa’s storage/set reverse RPC arrived without a token and the host refused it with -32021 storage_token missing.

Meanwhile, local anna-app dev “just worked” because the dev harness authorizes reverse RPC through your dev session, which bypasses the platform’s per-invoke token minting. That’s exactly why you saw the local-vs-platform mismatch! :magnifying_glass_tilted_left:

:white_check_mark: The fix

Both invoke paths now share a single token-minting module, so an Executa behaves identically no matter who invokes it. :handshake: Your APS KV set/get/list/delete calls over reverse RPC are now properly authorized on the platform. :locked_with_key:

:rocket: To get it working on your side

Just three quick things to double-check:

  1. :package: Platform version — make sure you’re on the latest runtime (the fix landed after your report).
  2. :label: Re-register / re-publish your Executa so its manifest host_capabilities: ["aps.kv"] flows into the platform’s cache. (This is the capability gate — it needs to see aps.kv declared.)
  3. :control_knobs: Keep “Persistent Storage” enabled in the Executa Permissions UI (you already did this — perfect! :+1:).

Quick answers to your specific questions:

  • scope: "user" needs no extra grant — it’s allowed by default. :white_check_mark:
  • Once the manifest declares aps.kv and Persistent Storage is on, the platform injects the storage_token automatically per invoke. :ticket:

Give it another spin and let us know how it goes! If anything still looks off, drop your tool id + app id and we’ll dig in right away. :flexed_biceps:

Thanks again for helping make Anna better — reports like yours are pure gold! :folded_hands::yellow_heart:

Happy building! :hammer_and_wrench::balloon: