Skip to main content

Authentication

Add per-request authentication via the auth callback in expose():
When auth fails, the adapter returns the appropriate HTTP status (e.g. 401) and message.

Authorization (Tenant/User Context)

Pass user or tenant context into the payload using onRequest:
Your events should include userId and/or tenantId in their schema so agents can scope work correctly.

Multi-Tenant Agent Selection

For dynamic agent creation per tenant, use the spawner:
The spawn event can carry tenantId or userId; onSpawn can select the right factory and params per tenant. See AgentNetwork API for spawner details and IO + Adapters for onRequest.