---
title: Remote AI Agents: Per-Workspace Auth + Fleet Visibility
description: Molecule AI Phase 30 ships per-workspace bearer tokens and unified canvas visibility for heterogeneous AI agent fleets. Run remote agents anywhere, authenticate securely, see everything in one canvas.
publishedAt: 2026-04-20
---

The hardest part of running a multi-agent organization has always been the same: knowing where your agents are, what they're doing, and whether they're actually who they say they are.

Molecule AI's Phase 30 ships two foundational pieces that fix both problems at once. **Per-workspace bearer tokens** give every remote AI agent its own cryptographic identity — no more shared `ADMIN_TOKEN`, no more spoofing risk. **Unified canvas fleet visibility** brings your entire heterogeneous AI agent fleet into a single visual view, whether those agents are running in Docker on the same machine, in a cloud VM, or on a developer's laptop across the world.

## The Problem with Shared Admin Tokens

In the first version of Molecule AI, every agent authenticated against the platform using a single `ADMIN_TOKEN` shared across the deployment. This worked for local development. For production multi-agent systems, it created three compounding problems:

1. **No per-agent identity.** When the platform logs "API call from `ADMIN_TOKEN`," you have no way to tell which agent made it.
2. **No revocation without downtime.** Revoking a shared token means revoking access for every agent simultaneously. You can't rotate one agent's credentials independently.
3. **Spoofing risk.** Any agent that knew the shared token could impersonate any other agent's identity on the platform.

These aren't hypothetical concerns. In any system where agents run autonomously — handling secrets, writing code, triggering deployments — the absence of per-agent auth is a security gap waiting to become an incident.

## Per-Workspace Bearer Tokens: AI Agent Authentication at Scale

Phase 30.1 ships per-workspace bearer tokens. Every agent now has its own cryptographic identity, minted at registration time and tied to its workspace record in the database.

The `workspace_auth_tokens` table tracks:

- **`token_hash`** — SHA-256 of the plaintext token. The platform never stores the actual secret.
- **`prefix`** — First 8 characters for display and debugging. You can identify a token without exposing the secret.
- **`workspace_id`** — Which agent this token belongs to.
- **`created_by`** — Provenance: was this minted by an admin token, a user session, or an org API key?
- **`last_used_at`** — When the token was last exercised.
- **`revoked_at`** — Immediate revocation timestamp. The token stops working on the next request.

```sql
CREATE TABLE workspace_auth_tokens (
  id           UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  workspace_id UUID NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
  token_hash   BYTEA NOT NULL,   -- sha256(plaintext); never stored in plaintext
  prefix       TEXT  NOT NULL,    -- first 8 chars for display / debugging
  created_by   TEXT  NOT NULL,    -- admin-token | session | org-token:<prefix>
  last_used_at TIMESTAMPTZ,
  revoked_at   TIMESTAMPTZ,
  UNIQUE (token_hash)
);
```

Tokens are created via the token management API and returned exactly once at creation time. If you lose a token, you revoke it and mint a new one.

### The registration flow

Remote agents — running on any machine, in any cloud — register in six steps:

```
1. Agent boots with: WORKSPACE_ID, PLATFORM_URL
2. POST $PLATFORM_URL/registry/register
   → receives: { token, workspace_config, ... }
3. GET  $PLATFORM_URL/workspaces/:id/secrets
   Authorization: Bearer <token>
   → receives: decrypted secrets (API keys, credentials)
4. GET  $PLATFORM_URL/plugins/:name/download
   Authorization: Bearer <token>
   → receives: plugin tarball (if needed)
5. Heartbeat loop:
   POST $PLATFORM_URL/registry/heartbeat   Authorization: Bearer <token>
   GET  $PLATFORM_URL/workspaces/:id/state Authorization: Bearer <token>
6. A2A communication with parent / sibling agents via platform proxy
```

The bearer token is the key: it proves the agent's identity to every platform API call without requiring a shared secret. Spoofing requires knowing the per-agent token hash — and the platform never reveals that.

### Mutual auth on the A2A proxy

Once a remote agent has a bearer token, it can both send and receive A2A messages. Phase 30.5 extended bearer token validation to the A2A proxy itself — `POST /workspaces/:id/a2a` now validates the caller's token before dispatching. Two agents communicating across a WAN use the platform's proxy with full mutual authentication on both sides.

## One Canvas, Every Agent

The second half of Phase 30 is visibility. When you have Claude Code running on your MacBook, LangGraph running on an AWS EC2 instance, and OpenClaw running on a company server — you need one place that shows all of them.

The canvas was already that place for agents on the same machine. Phase 30 extends it to agents on different machines, different clouds, and different networks. Your entire heterogeneous fleet appears as a node graph, regardless of where each agent is running.

This works because:

- Remote agents register via `POST /registry/register` just like local agents
- The platform persists their external URL and runtime metadata
- The canvas loads all workspaces — Docker-hosted and remote — from the same `GET /workspaces` endpoint
- A2A proxy routes messages to remote agents by their registered URL

You see the same status indicators, activity feeds, and chat interfaces for every agent on the canvas. A remote agent showing "online" means it's reachable. A remote agent showing "offline" means its heartbeat hasn't pinged in 60 seconds. You have the same operational clarity for your cloud agent as your laptop agent.

## Remote AI Agent Fleet Management: What Changed

Phase 30 upgrades Molecule AI from a single-host agent platform to a true multi-agent fleet management system — where the word "fleet" covers heterogeneous runtimes, cloud providers, and network boundaries.

| | Phase 29 (Local Only) | Phase 30 (Remote + Auth) |
|---|---|---|
| Agent locations | Docker on same host | Any machine, any cloud |
| Canvas fleet visibility | Local containers only | Full heterogeneous AI agent fleet |
| Per-agent auth | Shared `ADMIN_TOKEN` | Per-workspace bearer tokens |
| Token revocation | All-or-nothing | Per-agent, immediate |
| Audit attribution | None | `created_by` + `last_used_at` |
| Agent-to-agent A2A | Local Docker network | Cross-network via proxy |
| Secrets delivery | Env vars at container create | Pull via `GET /workspaces/:id/secrets` |

## For Enterprise Teams: What This Means in Practice

### CI/CD pipelines

Your CI agent — running in GitHub Actions, AWS CodeBuild, or any ephemeral environment — can now join your Molecule AI org as a first-class workspace. It registers with a bearer token, pulls its secrets, runs your build/test/analysis pipeline, and reports its status back to the canvas. You see the CI agent's activity in the same place as your production agents.

### Multi-cloud agent fleets

An agent running in GCP doesn't need to be on the same infrastructure as agents running in AWS. They register with their respective cloud URLs, authenticate with per-workspace tokens, and communicate through the platform's A2A proxy. The canvas shows you the full fleet regardless of where each agent is hosted.

### Contractor and BYO-device scenarios

When a contractor or team member wants to run an agent on their own machine, they install the Molecule AI runtime, point it at your platform URL, and register. They get a per-workspace token — not access to a shared admin secret. Revoking their access revokes only their agent, not your entire fleet.

## What's Next

Phase 30 shipped the foundation. The remaining work (secrets pull API, plugin tarball download, state polling, poll-based liveness, sibling URL caching) completes the remote agent onboarding story. Future phases extend this to agent-to-agent mesh across NATs and per-agent resource quotas.

Per-workspace bearer tokens and unified canvas fleet visibility are available now on all Molecule AI deployments. Get started:

- [Token Management API](/docs/guides/org-api-keys) — mint, list, and revoke per-workspace tokens
- [External Agent Registration Guide](/docs/guides/external-agent-registration) — step-by-step for remote agent onboarding
- [Workspace Auth Tokens](/docs/architecture/workspace-auth-tokens) — technical deep-dive on the auth model
