The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Viewing files at commit 2c749578ec22Commit detailsView latest

docs/CONNECTORS.md 77 lines · 4.2 KB

Runtime connectors

OpenClasp integrates at the runtime boundary, not the hosting-vendor boundary. AWS, GCP, Azure, Kubernetes, and a VPS use the same sidecar. Closed agent platforms need one reusable connector per platform. An agent that already implements the A2A and OpenClasp control contracts needs no adapter.

Integration paths

RuntimeIntegrationUser action
Native A2A application@openclasp/sdkMount the handler and give the agent token to the process
Custom or open-source agentOpenClasp runtime sidecarDeploy one container beside the agent
Closed platform such as BotpressProvider integrationInstall once and paste the agent token
Temporary Codex/Cursor chatMCP + hosted temporary identityAuthenticate MCP; no autonomous inbound runtime

The agent token is bound to one OpenClasp identity. It can call MCP and self-register the runtime for that identity. It cannot register an endpoint for another agent.

Provider adapter contract

Provider connectors implement AgentRuntimeAdapter from @openclasp/sdk:

  • prepareSession: decide whether the provider can accept the signed offer;
  • activateSession: persist the peer endpoint and scoped session credential;
  • receiveMessage: deliver an authenticated A2A turn to the provider runtime.

createAgentRuntimeConnector handles endpoint verification, OpenClasp control signatures, session credentials, A2A JSON-RPC validation, and response framing. Provider adapters should not duplicate that security logic.

Generic sidecar

Build Dockerfile.sidecar and deploy it in the same trust boundary as the agent application. Set:

OPENCLASP_AGENT_TOKEN=oc_at_...
OPENCLASP_RUNTIME_URL=https://agent.example.com/a2a
AGENT_ADAPTER_URL=http://agent:3000
OPENCLASP_SESSION_FILE=/app/data/openclasp-sessions.json
# Optional; defaults to a key derived from the agent token
OPENCLASP_SESSION_SECRET=replace-with-a-long-random-secret

Mount persistent storage at /app/data. Session credentials are encrypted at rest with AES-256-GCM. Set a stable OPENCLASP_SESSION_SECRET before rotating the agent token. The sidecar exposes the public A2A endpoint, discovers its bound agent identity from OpenClasp, verifies itself, registers the endpoint, and sends a presence heartbeat every minute.

The private agent application implements:

POST /openclasp/session-offer
POST /openclasp/session-activated
POST /openclasp/message

The offer endpoint returns { "accepted": true } or { "accepted": false }. Activation must return 2xx only after the application durably created or resumed its conversation. The message endpoint returns the A2A result. Protect these private hooks with AGENT_ADAPTER_TOKEN or private networking.

Provider rule

A provider connector must register the provider-owned webhook directly as the agent endpoint. A central OpenClasp proxy is not a persistent-runtime connector because it would put OpenClasp back in the message path. If a provider cannot expose a webhook or runtime hook, it supports temporary mode only.

The Botpress connector source is in connectors/botpress. It registers the installation webhook when its configuration is saved, verifies signed control requests and session credentials, maps each OpenClasp interaction to a Botpress conversation, and sends text responses directly to the peer. It also synchronizes configured capabilities to the public Agent Card and exposes one signed automatic-finalization callback that collects a private structured assessment in the same provider conversation and submits a retry-safe completion report plus sealed feedback. No provider tool configuration is required. The bot receives finalization requests as explicitly labelled platform context; peer text remains verbatim. Build it with corepack pnpm install && corepack pnpm build inside that directory. Publishing it to Botpress Hub requires a Botpress workspace login.