Skip to main content

Secure Channel

When a teammate, a guest, or another copy of Osaurus talks to an agent on your Mac, the conversation travels over the Secure Channel: a private, scrambled connection that only the two ends can read. Nobody in between can read it or change it. That includes your Wi-Fi, your internet provider, and even Osaurus's own relay servers.

There's nothing to set up. Osaurus uses the Secure Channel on its own whenever it's needed.

When it's used​

You don't turn the Secure Channel on. It just covers these connections:

  • A teammate's Osaurus. When someone in a workspace chats with one of your shared agents, the conversation is scrambled on their Mac and unscrambled only on yours. See Workspaces.
  • A guest. Someone you invited with a guest link reaches your agent the same way. See Remote Access.
  • n8n workflows. When an n8n workflow talks to one of your agents from another machine, the Osaurus n8n add-on uses the Secure Channel too.

Apps on your own Mac, like the command line or Shortcuts, talk to Osaurus directly. Their messages never leave your computer, so they don't need it.

Your own devices use Sync

Your own Macs and iPhone don't use the Secure Channel to reach each other. They're linked through Devices & Sync, which has its own end-to-end encryption between your devices. It's a separate connection with its own keys, and it never carries a teammate's or guest's traffic.

What it protects​

Think of it as a sealed envelope that only your Mac and the other device can open:

  • Nobody in between can read it. Your messages, the agent's replies, and the access key that proves who's asking all travel scrambled. The relay passes the envelope along but can't open it.
  • Old conversations stay safe. Each session uses fresh, throwaway keys. Even if a device's keys were stolen later, someone who recorded earlier traffic still couldn't read it.
  • Impostors can't pretend to be your Mac. When someone joins your workspace or accepts your guest link, their Osaurus learns your agent's unique address. From then on, it checks that it's really talking to that agent before sending anything.
  • Messages can't be replayed or cut short. Someone can't capture a request and send it again to run it twice. If a reply gets cut off partway, Osaurus notices instead of treating it as complete.
  • No way to switch it off from outside. If another computer tries to run one of your agents without the Secure Channel, Osaurus refuses. An attacker can't trick it into an unprotected mode.

What it doesn't hide​

Like any encrypted connection, it can't hide when messages are sent or roughly how big they are. The relay also needs to know which Mac a message is for, so it can deliver it.

How it compares​

Typical cloud AI appsTypical tunnel servicesOsaurus Secure Channel
Who can read your messages on the wayThe company running itThe tunnel operatorOnly the two ends
Who can see your access keyThe company running itThe tunnel operatorOnly the two ends
Past messages safe if keys leak laterUsually notUsually notYes
The other side's identity is checkedThrough an accountRarelyYes, from the first connection
A captured request can be re-runOftenOftenNever
A cut-off reply is noticedNoNoYes
Can be forced into unprotected mode—Often, silentlyNo

Compatibility​

  • Current versions of Osaurus use it automatically with each other.
  • The Osaurus iPhone app reaches your Mac through Devices & Sync. An older iPhone app still on the 6-digit pairing uses the Secure Channel until it switches to Sync.
  • Older versions of Osaurus can't run agents on an updated Mac until they update too. This is on purpose, so there's no weaker fallback. Both sides show a clear message asking you to update.
  • Other apps that use Osaurus like OpenAI's service (through the API) aren't affected. They can still list models and read basic information. The Secure Channel requirement only covers one Osaurus running another Osaurus's agents.
  • Apps on your own Mac aren't affected.

Troubleshooting​

"Upgrade Osaurus" message when reaching another Mac. One side is running an older version. Update Osaurus on both Macs.

A request failed after the Mac restarted. The old session ended. Osaurus starts a new one on its own; just try again.


Under the hood​

The Secure Channel is a dedicated cryptographic channel, not just HTTPS. It follows the same design patterns as TLS 1.3 and Signal, and the only parties holding the keys are the two endpoints.

The guarantees, technically​

  1. End-to-end encrypted. Every request and response, including streamed tokens, is sealed with ChaCha20-Poly1305 using keys that exist only on the two endpoints.
  2. Forward secrecy. Session keys come from a fresh ephemeral X25519 exchange every session. Even if a device's long-term identity key is compromised later, recorded past traffic can't be decrypted.
  3. Mutual authentication. The server signs the handshake with its secp256k1 agent key, and the client verifies it against the agent address it pinned (from the workspace roster, a guest link, or an n8n pairing code), so an impostor or man-in-the-middle can't complete a handshake. Your osk-v1 access key travels inside the ciphertext, so credentials never cross the network in plaintext.
  4. Tamper, replay, and truncation proof. Requests are sequence-numbered, so a captured request can never re-execute. Response streams end with an authenticated finish frame, so a connection cut mid-stream is detected.
  5. No downgrade. Remote plaintext requests to agent-execution routes (/agents/{id}/run, /agents/{id}/dispatch) are refused with 426 Upgrade Required, and so is every owner route, reads included, when a remote caller presents an owner (master-scoped) key: agents, sessions, run streams, review and approval queues, secret prompts, artifacts, tasks, MCP tool calls, memory ingest, credit balance, and unpairing. (For one release, plain GET /agents stays readable so phones up to 1.0(5) can learn their pin.) Relay traffic counts as remote even though it reaches the server over loopback. Local callers (CLI, App Intents, same-machine scripts) stay plaintext. A legacy 6-digit-paired phone never sends its key outside the channel.

Handshake and calls​

The channel is a SIGMA-style authenticated key exchange (the pattern underlying TLS 1.3 and the Noise framework), built from primitives Osaurus already uses elsewhere: secp256k1 identity signatures, X25519, HKDF-SHA256, and ChaCha20-Poly1305.

Every encrypted call is a POST /secure/call whose ciphertext decrypts to the complete inner HTTP request: method, path, authorization, and body. On the server, the inner request goes through the normal auth gate, agent-scope check, and routing unchanged. An inner request that normalizes to /secure/* is refused. Because the channel sits above HTTP, the relay carries opaque frames it can't read.

For a legacy 6-digit-paired phone whose Mac has no custom agents, the handshake is signed by the Mac's connect identity instead of an agent key (see Identity internals). Handshakes have their own rate limit, separate from pairing. Secure Channel request and response bodies are kept out of the Insights log. If a response can't be sealed, the connection is closed rather than passing it through in plaintext.

For n8n, when the n8n channel is bound to a local agent, the Osaurus n8n community node pins that agent's address in the handshake and wraps every channel request in /secure/call. That lets a remote n8n work through the relay without enabling plaintext HTTP.

Error reference​

StatusCodeMeaningWhat to do
426secure_channel_requiredPlaintext request to a protected agent or owner route from a remote callerUpgrade Osaurus on the calling side. A paired phone never retries in plaintext; with nothing pinned, it asks to pair again.
401secure_session_unknownSession expired or the server restartedRe-handshake (automatic)
409secure_replaySequence number already consumedNever retry the same envelope
400secure_malformedBad envelopeFix the request
404Unknown agent addressHandshake for an address that isn't an agent here or the connect identityDrop the stale pin
503Secure channel identity unavailable, try againThe connect identity's master key can't be read right now (for example, a locked Keychain)Keep the pin and retry

These codes arrive outside the encryption (the handshake's answer, or /secure/call's outer status), so anyone on the path could forge one. Clients treat them only as "this attempt failed", never as proof that an agent was deleted, a key revoked, or a pin stale. Those conclusions come only from inside the channel: an inner 401, or a roster fetched through another pinned agent that no longer lists the address.

Compatibility details​

  • Osaurus ↔ Osaurus (current versions): fully encrypted, automatic.
  • Osaurus ↔ older Osaurus: older peers can't execute agents on upgraded peers until they upgrade.
  • Third-party OpenAI SDK clients: unaffected. OpenAI-style routes (/models, /chat/completions, …) still accept plaintext; the requirement applies to agent-execution routes and to owner routes called with a master key.
  • Local callers: unaffected; loopback stays plaintext.

How it fits the security stack​

The Secure Channel works alongside the other layers; it doesn't replace them:

  • Invites establish who a peer is and pin the agent address the channel verifies on every handshake. A workspace share or a guest link delivers an agent-scoped key HPKE-sealed through /pair-invite, with a server signature; Macs on builds from before sync can still redeem owner-device access the same way. See Osaurus ID and Remote Access.
  • Sync is a separate channel. Your own Macs and iPhone pair with a Sync code and number check, and their chats travel as osaurus-sync's own end-to-end encrypted event logs, with keys held only by your devices. That channel doesn't use /secure/* and never carries teammate or guest traffic. See Devices & Sync.
  • Legacy phone pairing. For one release, an older iPhone app can still pair with a SPAKE2 exchange keyed by a 6-digit code (/pair/code) and then uses this channel. Once an iPhone joins Sync, those routes answer 410 update_required.
  • osk-v1 access keys still authenticate every call, now inside the ciphertext, with the same scoping and instant revocation.
  • Storage protects data at rest; the Secure Channel protects it in motion between agents. See Storage & Encryption.

Related: