Zero Ambient Authority: How We Secured the Productivities Plugin Ecosystem.
Why we refused to evaluate third-party JavaScript inside our main application runtime or privileged renderer, and how we built a signed, capability-brokered WebAssembly Component sandbox instead.
On this page
Desktop productivity tools have lived with an uncomfortable compromise around extensions for years. Plenty of popular note-taking and workspace apps make plugins easy to write by downloading a third-party JavaScript bundle and running it straight inside the main app window or Node.js process. That keeps developer setup easy, yet it also sweeps away nearly every barrier between a tiny community add-on and your private workspace.
Why should a cheerful little countdown timer be able to read your private journal files on disk? Under that open-house model, it can: a table formatter can inspect session cookies, and a compromised dependency inside an innocent-looking update can call random internet hosts, launch local shell commands, or hang the whole interface.
When Hably set out to build the plugin ecosystem for Productivities (where optional add-ons such as Sprint Planning, Decision Logs, and external task sync compose native Tasks, Notes, Pins, Spaces, and People), we drew a much firmer line from day one:
Third-party code never enters the Productivities web application, the Electron preload bridge, the API server, or the host Node.js runtime.
Plugins run under zero ambient authority, which means they start with no filesystem handle, no network socket, no database connection, no environment variables, no DOM access, and no user credentials. Anything useful a plugin wants to do must cross a typed, capability-checked gate owned by Productivities. While the walkthrough below focuses primarily on our Electron desktop host (where local WebAssembly Components and sandboxed views run), Productivities enforces the same live capability broker and secret-isolation rules across Local Desktop, Self-Hosted Remote, and Cloud deployments without ever loading third-party code into the API server. Here’s how that model holds up from the moment you click install to the moment code executes.
1. Three Execution Tiers of Isolation
Not every extension needs bespoke screens, and almost none need raw system access. Rather than squeezing every plugin into one heavy sandbox, we split plugin surfaces into three execution tiers: zero-code declarative UI, sandboxed custom UI, and out-of-process compute. Together, those three tiers sit inside the four-band architecture below, wrapped by our signed supply chain on intake and the central Capability Broker at runtime.
Tier 1: Declarative Contributions (Zero Untrusted UI Code)
Most of what productivity extensions actually add (context-menu actions on Tasks, Notes, Spaces, and People, pinned Quick Actions, settings panels, command inputs, and Space collection views) needs no custom HTML at all. In a plugin’s manifest, those pieces are pure, schema-checked JSON declarations. Productivities rejects raw HTML in labels, checks icon names against an internal allowlist, and renders every menu, form, dialogue, and table using our own interface components so plugins get consistent accessibility and theming without ever touching your main window’s DOM.
Tier 2: Opaque Custom-Scheme Iframes (For Custom Rich Views)
What if a Space Tab (a plugin-added view inside a project Space) genuinely calls for bespoke interactive visuals, such as an offline travel map or a custom chart? Even when that view runs client-side JavaScript for interactivity, it stays completely outside our main application document and privileged renderer. The desktop host serves verified static files over a dedicated custom protocol URL keyed by a short-lived random session token inside an opaque-origin sandboxed iframe.
Because that frame runs on an isolated origin with zero Electron preload bridge and zero internal IPC hooks, it can't open pop-ups, launch external apps, read session cookies, or probe API endpoints. Every asset response carries tight content-security headers limiting it to its own packaged files, and messages back to the host travel through one strict channel with small payload caps and an explicit allowlist of safe actions (such as querying permitted Notes or opening a native date picker outside the frame).
Tier 3: WebAssembly Components in a Sacrificial Process
Executable plugin logic is written in TypeScript against our SDK and compiled ahead of time into a WebAssembly Component. We picked the WebAssembly Component Model over a JavaScript VM sandbox because a Component’s binary header declares every single external interface it expects upfront. Before running a single instruction, the host inspects those imports and admits only one versioned Productivities host interface, turning away any binary that asks for direct files, network sockets, environment variables, or raw clocks at the door.
As a belt-and-braces backup, every run executes inside a dedicated sacrificial child process with unsigned native libraries turned off, macOS privacy-permission inheritance disclaimed (so an add-on can never ride on the desktop app’s Calendar, Contacts, or Notification grants), standard I/O closed, and a scrubbed environment. Tight memory ceilings, short timeouts, per-run operation caps, and global concurrency limits stop rogue plugins from dragging down your laptop, while repeated crashes quarantine a flaky installation automatically.
2. Supply-Chain Security & Package Intake
So what good is a runtime sandbox if somebody tampers with downloads on the wire, rolls users back to an older version with known bugs, or packs a nasty surprise inside the archive installer?
Ed25519 Catalogue Signatures & Anti-Rollback
Plugins come from a cryptographically signed catalogue, and the client verifies the detached Ed25519 signature against pinned public keys before parsing a single line of catalogue metadata. On conditional HTTP updates, the host verifies the signature against the exact cached or refreshed catalogue bytes as a single unit so a stale payload can never be paired with fresh response metadata, and HTTP redirects are checked manually on every hop so downloads never wander off our trusted HTTPS origin.
Verified catalogues are saved atomically with owner-only file permissions. Whenever a fresh catalogue arrives, the host checks generation timestamps against the previous verified copy and treats older replays as rollback attempts. Published builds stay immutable, every entry pins an exact byte size and SHA-256 hash, and a signed revocation list lets us disable one compromised build cleanly without breaking everything else.
Checking Packages Before They Enter
Because plugin downloads arrive as ZIP archives, our streaming inspector vets every entry in memory before writing anything to disk. It caps total archive size, individual files, uncompressed volume, and entry counts, turns away symbolic links on sight, applies strict Unicode path normalisation against directory-traversal tricks, and checks the WebAssembly Component header before storing an executable binary. Larger optional datasets (such as offline map tiles) travel separately as content-addressed packs checked by SHA-256 and swapped in atomically.
3. Six-Way Capability Gating & Identity Hygiene
Install-time permission prompts are never enough on their own, because workspace memberships, plans, and plugin health all change over time. Instead, every runtime call passes through one central Capability Broker checking six live conditions before allowing any work through:
- The installation is enabled and healthy rather than quarantined.
- The requested capability is explicitly declared in the manifest.
- The user or workspace administrator has granted that capability.
- The underlying feature is included in the user’s current Free or Pro plan.
- The capability works in the active deployment mode (Local Desktop, Self-Hosted Remote, or Cloud).
- Live Workspace membership and object-level access checks pass for the current user.
Keeping plan tier, capability permissions, and UI visibility independent keeps runtime enforcement predictable. A Free add-on can't slip past Pro feature checks, and optional capabilities fail closed neatly so plugins degrade cleanly instead of crashing if an entitlement changes. If a plugin update tries to sneak in a wider permission, that update stays paused until a human reviews and approves the extra scope.
No Database IDs, No File Paths, No Raw Rows
Even with permission to read Tasks or create Notes, a plugin never sees sequential database IDs or Markdown paths on your disk. Every cross-boundary link uses a canonical Workspace-scoped UUIDv7 validated at both sides. Sensitive domains such as People keep directory summaries separate from private notes or interaction logs, and plugin key-value storage stays boxed off so Workspace search only indexes explicitly declared Space Tab fields.
4. How External Connectors Talk to the Internet Without Seeing Your API Keys
Wait: if a plugin holds zero credentials and can't open a network socket, how does an integration with Todoist, Jira, or TickTick actually reach those external servers? Handing raw tokens and open sockets straight to third-party code would let a compromised add-on siphon keys or probe private networks and cloud metadata endpoints through Server-Side Request Forgery (SSRF).
Instead, the Productivities host steps in as a zero-trust credential-injecting proxy on the plugin’s behalf.
Four interlocking defences hold that proxy line. First, connector secrets sit encrypted at rest using the OS keystore on desktop and a versioned keyring on Cloud and Self-Hosted servers, cryptographically bound to the exact Workspace, user, installation, and connector so a stolen token can't be transplanted onto another extension. Second, every outbound call has to use clean HTTPS and match both the HTTP verbs and origin allowlists declared in the manifest, with strict single-label wildcards blocking multi-dot hostname tricks.
Third, to stop DNS rebinding attacks where a dodgy hostname swaps from a public IP at check time to 127.0.0.1 milliseconds later, the broker resolves addresses once, blocks private, loopback, link-local, metadata, and multicast ranges, and pins the TLS socket directly to that vetted IP. Finally, request and response sizes are tightly bounded, slow requests time out promptly, and HTTP redirects are rejected outright so a legitimate server can't bounce an auth header onto someone else.
5. Safe Interactions with AI Agents, Offline Sync & Diagnostics
Three more guardrails watch the spots where plugins meet AI agents, offline sync, and diagnostic logs:
- Read-only, hash-pinned AI agent tools: Extensions can expose tools to Productivities’ workspace-wide Personal Agent and project-scoped Space Agents, yet only inside Spaces where that plugin’s Space Tab is switched on and strictly as read-only lookups. Every tool contract is pinned to a cryptographic hash of the installation ID, manifest version, and WebAssembly binary so updating a plugin automatically invalidates stale schemas or cached agent state.
- Idempotent offline sync: When a Cloud-connected laptop runs a plugin command locally, every run carries a mandatory idempotency key bound to a hash of its input. If the desktop closes halfway through, retries won't blindly double up the change, and if Wi-Fi drops just as work finishes, reconnecting settles the stored execution receipt cleanly.
- Secret-scrubbed diagnostics: Structured logs give developers useful debugging visibility while automatically scrubbing keys, passwords, cookies, bearer tokens, and API secrets before anything is written to disk.
Defence in Depth Summary
| Trust Boundary | How It’s Enforced |
|---|---|
| Distribution | Ed25519 signed catalogue, anti-rollback generation checks, same-origin redirect verification, SHA-256 package pinning, and surgical revocations |
| Archive Intake | Streaming size and file-count caps, zero symbolic links, strict Unicode path-traversal rejection, and WebAssembly Component header verification |
| Compute Sandbox | WebAssembly Component importing only the Productivities host interface inside a sacrificial utility process with memory, timeout, and failure quarantine bounds |
| UI Sandbox | Host-rendered declarative UI by default, with bespoke views isolated in ephemeral-token opaque iframes behind strict CSP and narrow message-port allowlists |
| Permissions & Data | Six-way live capability broker on every call, independent Free/Pro gating, Workspace-scoped UUIDv7 references only, and bounded isolated storage |
| Network & Secrets | Zero plugin sockets or raw tokens, context-bound authenticated secret encryption, manifest origin allowlists, DNS-pinned public IPs, and zero HTTP redirects |
| Agents, Sync & Logs | Read-only, hash-pinned agent tool contracts inside active Space Tabs, input-hashed offline idempotency keys, and automatic secret scrubbing before log writes |
Adding extensions to your workspace shouldn't require crossing your fingers every time you click Install. By pairing host-rendered interfaces with capability-checked WebAssembly Components and zero-trust credential proxying, plugin developers get a tidy TypeScript SDK while users get firm, transparent limits on what any add-on can touch.