Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

🔁Tool Communication

Audience: Nexus adopters and integrators.

Goal: Configure and verify the HTTP and signed-message boundary between a leader and an off-chain Tool without weakening the Tool contract.

The nexus-toolkit runtime turns a NexusTool implementation into an HTTP server with GET /health, GET /meta, and POST /invoke endpoints. The documented operator profile requires authenticated HTTPS on both the public Leader-to-gateway hop and the gateway-to-Toolkit hop. Set both NEXUS_TOOL_TLS_CERT_PATH and NEXUS_TOOL_TLS_KEY_PATH for Toolkit TLS. The runtime also supports plain HTTP when both TLS paths are absent, including behind an external HTTPS gateway, but a plaintext gateway-to-Toolkit hop does not meet this profile. Point the runtime at NEXUS_TOOLKIT_CONFIG_PATH and provide an allowlist of permitted Leaders produced by nexus tool auth export-allowed-leaders.

Signed HTTP v3 keeps the Leader signature over the schema-ordered canonical input hash and the Tool response signature over the response domain, Leader signature, deterministic invocation nonce, and canonical response commitment. The API remains signed_http::v3, and the wire-version header remains X-Nexus-Sig-V: 3. Protocol revision v3.1 adds a separate Leader context signature in nexus-context-sig and its Unix-millisecond timestamp in nexus-context-timestamp; the context signature binds the receiving Tool FQN, invocation nonce, and timestamp without changing the existing input or result signature transcripts. In required mode, the Toolkit checks the context signature against the local Leader allowlist and applies the configured symmetric freshness window, which defaults to 30,000 ms and includes both endpoints, before replay-cache access. Gateways must forward every signed request and response header without renaming or dropping it, including both context headers. The context signature does not cover the HTTP method, path, query, raw body bytes, arbitrary headers, or status; authenticated HTTPS protects these transport fields.

GET /meta advertises an external HTTPS URL and ignores X-Forwarded-Proto; that metadata does not prove that the active listener is TLS-protected. When per-Tool client-certificate binding is enabled, TLS must terminate in the Toolkit or pass through to it so the Toolkit can inspect the TLS peer key. Forwarded certificate headers do not establish that peer key. Nexus consumes three public endpoints:

  • GET /meta advertises the FQN, schemas, timeout, and URL;

  • POST /invoke carries the signed input and returns one output variant;

  • GET /health is the readiness check that validation and orchestration use before registration.

The runtime contract is intentionally small: initialize the tool implementation, bootstrap the server, keep the signing key and allowlist local, and let the CLI validate and register the endpoint. The toolkit reference documents the Rust API surface, while this guide explains the runtime behavior that operators need to run and secure a tool.

Prerequisites

  • A running off-chain Tool that implements the published HTTP contract; see Build an Off-Chain Tool.

  • The Tool FQN and endpoint URL.

  • A configured CLI identity and the authority required to register Tool communication keys.

Illustrative request and result flow

  1. Start the Tool and confirm GET /health returns success.

  2. Confirm GET /meta returns the FQN, timeout, and input/output schemas that will be registered.

  3. Register or rotate the Tool signing key, then export the allowed-leader data for the Tool runtime.

  4. Submit one POST /invoke request through the normal leader path. The result must select one declared output variant and match its schema.

The durable on-chain evidence is the Tool registration and its active key binding. The HTTP request and response bodies, nonces, hashes, and signatures form the transcript used when the vertex selects RegisteredKey; the transient request itself is not a durable object.

Verification

Use nexus tool validate offchain --url <URL> to check the health and metadata surface before registration. After registration, inspect the Tool by FQN and run one bounded workflow execution. Record the Tool FQN, key id, Task or Execution ID, and result variant so a failed response can be compared with the registered schema and active key configuration.

Common failures and recovery

  • Health or metadata fails: fix the endpoint before registration; do not register a URL whose observed schema differs from the intended Tool contract.

  • Signature verification rejects a response: check the active Leader and Tool keys, transcript nonces, body hashes, and proxy behavior. A correctly signed payload is authenticated, not independently proven semantically true.

  • Output schema mismatch: return a declared output variant or update the Tool contract through the appropriate registration/upgrade path; do not retry the same incompatible result.

Next

Continue with Verify an Off-Chain Tool Result to choose and inspect the per-vertex verifier mode.

Last updated