# APS KV works in local \`anna-app dev\`, but fails on the Anna platform with \`storage\_token missing\`

**URL:** <https://forum.anna.partners/t/aps-kv-works-in-local-anna-app-dev-but-fails-on-the-anna-platform-with-storage-token-missing/70>\
**Category:** Developers\
**Tags:** dev-kit\
**Created:** [June 3, 2026, 6:23am UTC](https://forum.anna.partners/t/aps-kv-works-in-local-anna-app-dev-but-fails-on-the-anna-platform-with-storage-token-missing/70 "2026-06-03T06:23:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HappyLight](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@HappyLight](https://forum.anna.partners/u/HappyLight)\
**Post date:** [June 3, 2026, 6:23am UTC](https://forum.anna.partners/t/aps-kv-works-in-local-anna-app-dev-but-fails-on-the-anna-platform-with-storage-token-missing/70/1 "2026-06-03T06:23:09Z")

</div>

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:

> **[GitHub - wuyyyyyou/aps-app](https://github.com/wuyyyyyou/aps-app)**
>
> Contribute to wuyyyyyou/aps-app development by creating an account on GitHub.

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

The App manifest declares:

```json
{
  "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:

```json
{
  "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.

 ![image](https://canada1.discourse-cdn.com/flex033/uploads/anna/original/1X/4e7cf4e68112e33bafa6d637c5f574b750510ad5.png)

The APS KV call flow is:

The frontend calls the Executa through Anna App Runtime:

```js
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:

```js
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:

```plaintext
[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}

```

 ![image](https://canada1.discourse-cdn.com/flex033/uploads/anna/original/1X/8565b7beb7a2bff0906cedf8087a5a0289c43e95.jpeg)

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:

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

```

 ![image](https://canada1.discourse-cdn.com/flex033/uploads/anna/original/1X/cf80de43171f32c35f446cd3215203267808f88f.png)

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:

```plaintext
-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.

---

<div class="post-metadata">

**Author:** ![hunter](https://yyz1.discourse-cdn.com/flex033/user_avatar/forum.anna.partners/hunter/32/8_2.png) [@hunter](https://forum.anna.partners/u/hunter)\
**Post date:** [June 9, 2026, 6:32am UTC](https://forum.anna.partners/t/aps-kv-works-in-local-anna-app-dev-but-fails-on-the-anna-platform-with-storage-token-missing/70/2 "2026-06-09T06:32:51Z")

</div>

Hi @HappyLight! 👋✨

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! 🌟 And great news: **this is already fixed!** 🎉

## 🐛 What was going on

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

- 💬 The **chat-agent path** correctly minted and injected a `storage_token` for each invoke.
- 🪟 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! 🔍

## ✅ The fix

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

## 🚀 To get it working on your side

Just three quick things to double-check:

1. **📦 Platform version** — make sure you’re on the latest runtime (the fix landed after your report).
2. **🏷 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. **🎛 Keep “Persistent Storage” enabled** in the Executa Permissions UI (you already did this — perfect! 👍).

Quick answers to your specific questions:

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

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. 💪

Thanks again for helping make Anna better — reports like yours are pure gold! 🙏💛

Happy building! 🛠🎈
