Docs/System Modules/Credential

Credential

Owns product identity sessions and external credential custody without exposing raw secrets to Apps.

Current module contractLast updated July 17, 2026

Credential answers “how does this trusted runtime authenticate to an external system?” It does not answer “what may this runtime do to the Lamarck Substrate?”

Owns

External credential records, encrypted secret material, desktop identity session, OAuth transactions, refresh, and revocation.

Exposes

Management operations such as connect/disconnect/rotate and a narrow runtime getToken() handle.

Persists

Non-secret metadata and ciphertext in system.db; the workspace vault key remains outside the database.

Does not own

App permissions, Guard policy, Connector setup UI, Source provenance, or personal data.

Credential types

Manifest typeManagement flowRuntime receives
noneNo credential ceremony.A no-auth handle.
apiKeyUser supplies a replaceable static secret.The secret through getToken().
oauth2-publicLocal Authorization Code + PKCE with a public client.A provider access token through a generic OAuth handle.
managedProviderLamarck's hosted provider service owns confidential OAuth and provider policy.A scoped Lamarck capability token, never the provider refresh token.

Secret custody

system.db                    OS keychain
┌─────────────────────┐      ┌───────────────┐
│ encrypted secret    │      │ workspace     │
│ nonce + metadata    │  +   │ vault key     │
└─────────────────────┘      └───────────────┘
          │                         │
          └──────── broker ─────────┘
                       ↓
               runtime auth handle

The database stores ciphertext, not the vault key. The OS keychain caches a random workspace vault key. A recovery code is the portable representation used to restore that key on another device.

Caller boundary

CallerCredential access
Trusted Connector runnerReceives the auth handle selected for its Source.
Lamarck desktopUses a separately owned desktop identity session for Lamarck-hosted APIs.
App UI / service / jobNever receives auth.getToken() or raw external credentials.
GuardNo credential role; it authorizes Substrate operations.

An App that needs external data uses a Source or a future brokered system capability. Giving Apps provider tokens would collapse the Connector boundary and make provenance ambiguous.

Management and runtime are separate

Connect, disconnect, rotate, OAuth callbacks, refresh, and account selection are Host management operations. Connector code receives a read-only runtime handle; it cannot revoke or rebind the user's credential.

Next moduleAuthority & Guard