Trust and identity standards
Companion Memory and Companion Hub operate as an API and data Swiss Army knife for decentralized identity, agentic workflows, and interoperable storage.
Rather than discarding emerging specifications or provisional research protocols (such as Solid, Portable Web Spaces, IdentiKey, OpenVTC, and DIDComm), Companion implements them with full type-safety, dedicated NestJS routing modules, and automated test coverage. To protect production privacy, every provisional and decentralized protocol is shut off by default behind fail-closed feature flags. An operator can selectively enable any interface using environment variables without modifying application code.
Fail-closed guarantee: With feature flags unset or set to false, endpoints return 404 Not Found (indistinguishable from an unmounted route) and make zero outbound network calls.
Standards and feature flag activation
The table below outlines each standard, its role in the Swiss Army Knife architecture, the mounted API route, the corresponding feature flag, the default state, and how to activate it.
| Standard & Specification | Scope & Role | Route / Interface | Feature Flag / Env Variable | Default State | How to Activate & UI Surface |
|---|---|---|---|---|---|
| Solid Protocol (W3C Solid, WebID, LDP, Turtle RDF) | Read-only WebID profile document, LDP discovery headers (Vary, Allow, Link, WAC-Allow), and owner-isolated entity containers | GET / OPTIONS /solid/profile/:userIdGET / OPTIONS /solid/storage/:userId/entityGET / OPTIONS /solid/storage/:userId/entity/:entityId | ENABLE_SOLID_PROTOCOL( features['solid.protocol']) | OFF (false) | Set ENABLE_SOLID_PROTOCOL=true in CI-Memory (status in Settings → Trust & protocols) |
| Portable Web Spaces (PWS) (W3C CCG v0.5 / zCaps) | Permissioned object-capability storage (Space > Collection > Resource) | ALL /pws/*GET /pws/service | ENABLE_PWS_STORAGE( features['pws.storage']) | OFF (false) | Set ENABLE_PWS_STORAGE=true in CI-Memory (status in Settings → Trust & protocols) |
| IdentiKey Protocol (identikey-auth Phase 1, dCBOR + BLAKE3) | Single-use challenge/response authentication (Ed25519/P-256 + optional PQ ML-DSA co-signature) | POST /auth/identikey/challengePOST /auth/identikey/verify | ENABLE_AUTH_IDENTIKEY( features['auth.identikey']) | OFF (false) | Set ENABLE_AUTH_IDENTIKEY=true in CI-Memory (status in Settings → Trust & protocols) |
| OpenVTC (W3C VC 2.0 / DTG Credentials v1) | Offline W3C VC 2.0 / DTG v1 envelope, eddsa-jcs-2022 proof, and Bitstring Status List evaluation | POST /vtc/verifyPOST /vtc/status-list/evaluate | ENABLE_VTC_CREDENTIALS( features['vtc.credentials']) | OFF (false) | Set ENABLE_VTC_CREDENTIALS=true in CI-Memory (status in Settings → Trust & protocols) |
| DIDComm Messaging v2.1 (DIF DIDComm v2.1 + OOB 2.0) | Ephemeral did:peer:2 identity, Out-of-Band _oob= invitation creation & offline parsing, encrypted envelopes (authcrypt/anoncrypt), trust-ping, and discover-features | GET /didcomm/didPOST /didcomm/oobPOST /didcomm/oob/parsePOST /didcomm/message | ENABLE_DIDCOMM_MESSAGING( features['didcomm.messaging']) | OFF (false) | Set ENABLE_DIDCOMM_MESSAGING=true in CI-Memory (_oobid= remote URLs refused to preserve zero-SSRF posture) |
| Trust Tasks (https://trusttasks.org , https/0.3) | Task document envelopes with in-band eddsa-jcs-2022 proofs | POST /agent/v1/trust-tasks | ENABLE_TRUST_TASKS( features['trust.tasks']) | OFF (false) | Set ENABLE_TRUST_TASKS=true and configure peer signing keys |
| Protected Resource Metadata (PRM) (RFC 9728 / MCP 2026-07-28) | OAuth 2.0 metadata discovery for MCP agents with Client ID Metadata Document (CIMD) support and DCR disabled | GET /.well-known/oauth-protected-resourceGET /.well-known/oauth-protected-resource/mcp | ENABLE_MCP_PRM( features['mcp.prm']) | OFF (false) | Set ENABLE_MCP_PRM=true in CI-Memory |
| Local.Pub / ActivityPub Discovery (W3C Social Web) | Handle-to-key discovery over WebFinger and ActivityPub actors | GraphQL localPubPeerLookup | CI_PEER_LOCAL_PUB_ENABLED( config.peers.localPubEnabled) | OFF (false) | Set CI_PEER_LOCAL_PUB_ENABLED=true in CI-Memory |
| Companion Asks & ISO 27560 Receipts (RFC 9421 + DPV v2 + CESR I-SAID) | Peer asks, standing grant ceilings, append-only disclosure audit, and on-demand ISO/IEC TS 27560 consent receipts | POST /agent/v1/ask, GraphQL ask*, askDisclosureHistory, askAuditReceipt | ENABLE_ASK( features['ask']) | Deployment config | Inspected via /asks Disclosure History and ConsentDetailModal receipt drawer |
| KERI OOBI (Frozen experimental pre-spec) | Isolated Out-Of-Band Introduction test surface (non-CESR internal format) | GET /.well-known/keri/oobiGET /.well-known/keri/oobi/:aid | CI_HUB_KERI_OOBI (process env) | OFF (unset) | Set CI_HUB_KERI_OOBI=true in Companion-Hub; exposed via /api/user-context (keriOobiEnabled) to Settings → System |
| DID Authentication ( did:key Ed25519 + SIOPv2) | Browser WebCrypto Ed25519 did:key generation, account linking, and SIOPv2 id_token sign-in | GET /api/auth/did/linksPOST /api/auth/did/challengePOST /api/auth/did/verifyPOST /api/auth/did/linkDELETE /api/auth/did/links/:id | CI_HUB_DID_AUTH (process env) | OFF (unset) | Set CI_HUB_DID_AUTH=true in Companion-Hub; enables Login DidSignInPanel and Settings → Security DidLinksCard (via /api/user-context didAuthEnabled) |
| Fail-Closed Privacy Boundary (Cloud fallback guard) | Blocks automatic cloud inference failover when local Ollama/vLLM/oMLX/Lemonade engines fail | InferenceRouterService, GET /api/inference/cloud-policy (CloudFallbackPolicyDto) | CI_HUB_ALLOW_CLOUD_FALLBACK (process env) | OFF (unset) | Default fail-closed (502 when local backends are unreachable). Visible in Settings → AI policy banner and Settings → System |
| Forward-Auth EdDSA & Passkeys (OIDC / RFC 6749 / RFC 7636) | Reverse-proxy app SSO assertions (urn:ci-hub:<directoryId>), Hub login (better-auth), and CI-Portal session-gated /api/peers OIDC federation | /api/auth/*, Hub JWKS, CI-Portal POST /api/peers | Core auth service | Works today | Active by default (CI-Portal peer directory enforces OIDC session auth, server-derived (issuer, subject), and HTTPS endpoints) |
| Model Context Protocol (MCP) (Anthropic MCP) | Tool registry and memory resource inspection for connected agents | POST /mcp, GET /mcp, DELETE /mcp | Core platform feature | Works today | Active by default with scoped token gates |
| Capability Keys & Field Crypto (Biscuit-style Ed25519 + AES-256-GCM) | Scoped API keys (/keys) plus internal offline-attenuable Ed25519 capability token helpers (capabilityToken.ts) | POST /keys, GET /keys, GET /keys/check | Core platform feature | Works today | Active by default (full / write / read capability attenuation) |
| HTTP Message Signatures (RFC 9421) | Tamper-evident signed requests between paired Companions | POST /agent/v1/ask, GET /agent/v1/ask/:askId | Config peers.requireHttpSignature | Optional (false) | Unsigned Portal-token asks accepted unless peers.requireHttpSignature: true is set; outbound signed when peers.signingKeyJwk is configured |
| iCalendar (RFC 5545) | Calendar .ics VEVENT import parsing | Data import sources (.ics upload / connector) | Core platform feature | Works today | Available via calendar import sources |
Activating features via environment variables
To activate any of the standards behind feature flags, configure the environment variable in the respective service’s deployment configuration (.env file or docker-compose.override.yml).
Companion Memory configuration
Edit the CI-Memory environment (e.g. in .env or container env block):
# Enable Solid Protocol (WebID & LDP read storage at /solid/profile/* and /solid/storage/*)
ENABLE_SOLID_PROTOCOL=true
# Enable Portable Web Spaces (W3C CCG v0.5 storage at /pws/*)
ENABLE_PWS_STORAGE=true
# Enable IdentiKey authentication (challenge/response at /auth/identikey/*)
ENABLE_AUTH_IDENTIKEY=true
# Enable OpenVTC credential verification at /vtc/verify
ENABLE_VTC_CREDENTIALS=true
# Enable DIDComm Messaging v2.1 at /didcomm/* (GET /didcomm/did, POST /didcomm/message)
ENABLE_DIDCOMM_MESSAGING=true
# Enable Trust Tasks document exchange at /agent/v1/trust-tasks
ENABLE_TRUST_TASKS=true
# Enable RFC 9728 Protected Resource Metadata discovery for MCP
ENABLE_MCP_PRM=true
# Enable Local.Pub handle discovery
CI_PEER_LOCAL_PUB_ENABLED=trueCompanion Hub configuration
Edit the Companion-Hub environment (e.g. $CI_HUB_DATA_DIR/.env):
# Enable KERI OOBI endpoints (/.well-known/keri/oobi/*)
CI_HUB_KERI_OOBI=true
# Enable DID authentication (did:key sign-in at /api/auth/did/*)
CI_HUB_DID_AUTH=true
# Allow cloud inference fallback when local Ollama/vLLM is offline
# WARNING: Setting this to true allows inference prompts to be sent to external cloud providers
CI_HUB_ALLOW_CLOUD_FALLBACK=falseRestart the service after updating environment variables:
cihub restartCryptographic and operational comparison
Each trust and interoperability standard in Companion addresses a different layer of identity, transport, storage, or consent. None replaces the others outright:
| Standard | Identifier & Agility | Cryptosuite / Encryption | Revocation / Replay Defense | Offline Verification | Maturity Tier |
|---|---|---|---|---|---|
| Forward-Auth EdDSA / OIDC | urn:ci-hub:<directoryId>, CI-Portal OIDC (issuer, subject) | EdDSA JWTs via Hub JWKS / OIDC PKCE | Short-lived tokens, better-auth session store | Yes (Hub JWKS); OIDC initial login requires IdP | Core |
| RFC 9421 + ISO 27560 + CESR SAID | Account / did:keri:D… key id (non-rotating) | RFC 9421 Ed25519 HTTP Signatures, RFC 8785 JCS + CESR I-SAID | Replay headers (created, nonce), durable ci.ask_audit, lazy askAuditReceipt | Yes (SAID & HTTP sig verify offline) | Provisional (ENABLE_ASK) |
| Solid Protocol (LDP) | WebID HTTP URI (#me) | OIDC / Bearer + WAC-lite owner isolation | OAuth token expiry + owner-only 404 boundary | No (OIDC/JWKS) | Provisional (Flag-gated) |
| Portable Web Spaces (PWS) | did:key controller DID (immutable) | Ed25519 zCap delegations + HTTP Signatures + Digest | Expiring caveat timestamps + controller-scoped 404 | Yes | Provisional (Flag-gated) |
IdentiKey (identikey-auth) | BLAKE3 Base58 key fingerprint | dCBOR + Ed25519 / P-256 + optional ML-DSA PQ co-signature | Single-use 300s challenge nonce + retry cap (3 attempts) + Host audience binding | Yes (challenge/verify offline within host) | Experimental |
| OpenVTC (VC 2.0 / DTG v1) | did:key or pinned community DID (refuses did:keri) | eddsa-jcs-2022 Data Integrity Proof | W3C Bitstring Status List v1.0 (POST /vtc/status-list/evaluate, 24h max age) | Yes (strictly offline; no remote fetch) | Provisional (Flag-gated) |
| DIDComm Messaging v2.1 | did:peer:2 (ephemeral), did:key, did:web (refuses did:keri) | ECDH-1PU (authcrypt) / ECDH-ES (anoncrypt) + JWS | InMemoryReplayGuard + message expires_time + offline _oob= (_oobid= refused) | Yes for did:peer / did:key | Provisional (Flag-gated) |
Trust Tasks (https/0.3) | Linked peer did:key / Ed25519 signing key | eddsa-jcs-2022 signed task document envelopes | Bounded payload & peer allowlist | Yes | Provisional (Flag-gated) |
Hub did:key SIOPv2 | did:key:z6Mk… (WebCrypto or external Ed25519, immutable) | JWS / SIOPv2 id_token (EdDSA) | Single-use challenge nonce + Hub audience check | Yes | Provisional (Flag-gated) |
| KERI OOBI (Hub) | Frozen internal pre-spec prefix (non-CESR) | Frozen pre-spec JSON structures | Isolated behind CI_HUB_KERI_OOBI=true | Partial (non-interoperable) | Experimental |
UI/UX inspection and boundary controls
Both Companion Memory and Companion Hub surface flag states and verification evidence directly in operator settings without probing disabled routes:
- Companion Memory — Settings → Trust & protocols:
TrustProtocolsSectionreads/api/_internal/features(authenticated only; unauthenticated/api/_internal/features/globalomits all provisional flags) to filter and search active vs. fail-closed404interfaces and display activation variables. - Companion Memory —
/asksDisclosure History (ConsentDetailModal): Lazily fetches GraphQLaskAuditReceipton click to display ISO/IEC TS 27560 + W3C DPV v2 legal basis, purposes, processing categories, and CESRI-SAID / receiptddigests with copy/JSON export. - Companion Hub — Login (
DidSignInPanel) & Settings → Security (DidLinksCard): Dynamically revealed only whenGET /api/user-contextreportsdidAuthEnabled: true(CI_HUB_DID_AUTH=true). Uses browser WebCrypto Ed25519 (did:key:z6Mk…) to sign SIOPv2 challenges or accepts external JWS proofs. - Companion Hub — Settings → AI (
cloud-fallback-policy-banner): QueriesGET /api/inference/cloud-policy(CloudFallbackPolicyDto) to show clearly whetherCI_HUB_ALLOW_CLOUD_FALLBACKis fail-closed local routing (false) or permits cloud failover (true). - Companion Hub — Settings → System (
TrustProtocolsSection): Displays read-only protocol gate status (did:key, KERI OOBI, Cloud Inference Fallback, Forward-Auth EdDSA) derived from/api/user-context. - Companion Portal (
/api/peers): Remains unchanged inCI-Portal— peer registration and resolution require authenticated OIDC sessions, enforce HTTPS endpoints, bind identities server-side from(issuer, subject), and return404when unconfigured.
Architectural design principles
- API & Data Swiss Army Knife: The memory server is built to interface with external decentralized trust ecosystems without requiring code rewrites. All parser, crypto, and transport layers reside in the codebase.
- Fail-Closed Privacy: A feature flag set to
false(or left unset) does not return a “Feature Disabled” or “Forbidden” status code. Instead, the endpoint throws a404 Not Foundindistinguishable from an unmounted path, preventing scanner enumeration and zero-outbound SSRF leaks. - Strict Cryptographic Soundness:
- CESR SAIDs: Audit helpers (
auditSaid.ts) compute RFC 8785 canonical JSON with CESRIprefix (SHA2-256) qb64 self-addressing identifiers (computeAuditSaid,verifyAuditSaid) and Merkle root/proof verification helpers. - Data Integrity: Proofs follow W3C
eddsa-jcs-2022with RFC 8032 verification. - Consent Receipts: Receipt builders (
consentReceipt.ts) follow ISO/IEC TS 27560 and W3C Data Privacy Vocabulary (DPV v2). - Capability Tokens:
capabilityToken.tsprovides offline-attenuable Biscuit-style Ed25519 capability tokens with monotonic caveat verification (mintRootCapabilityToken,attenuateCapabilityToken,verifyCapabilityToken).
- CESR SAIDs: Audit helpers (