Logos LexiconLogic Library Guide

Logic Library Guide

The logic library is the core of the Logos Lexicon protocol. It is a pre-agreed, locally-stored mapping from CSIV token IDs to execution actions, parameters, and safety constraints. No token can be resolved without a matching entry in the local logic library.

Air-Gap Principle

Logic libraries are never fetched at runtime. They are initialized at boot time — loaded from the SilentAuth API and cached locally. Execution resolution never makes a network call. This ensures that even a fully compromised network cannot inject new actions into a running system.

Library Structure

Each entry in the logic library maps a token ID to an action with execution rules, parameter ranges, and safety constraints.

Logic library entry type

interface LogicLibraryEntry {
  token_id:         string;          // CSIV token ID
  action_label:     string;          // Human-readable action name
  action_namespace: string;          // Functional domain namespace
  required_layer:   1 | 2 | 3 | 4;  // Minimum verification layer
  risk_tier:        RiskTier;        // low | medium | high | critical
  requires_vinac:   boolean;         // Layer 4 acoustic proof required
  is_active:        boolean;
  execution_policy: {
    max_uses:               number;
    rate_limit_per_hour:    number;
    approval_window_seconds?: number;
    dual_approval?:          boolean;
    quorum_required?:        number;
    value_limit_usd?:        number;
    change_window_required?: boolean;
    require_same_device?:    boolean;
  };
}

Bootstrapping a Logic Library

Initialize and seed from SilentAuth API

import { LogosLexicon } from '@silentauth/logos-lexicon';

const lexicon = new LogosLexicon({
  publicKey: 'pk_live_…',
  version:   '1.0.0',
});

// Fetch and seed the local logic library at startup
// This is the ONLY network call — subsequent resolution is offline
await lexicon.library.initialize();

console.log(lexicon.library.size());  // 8 (v1.0.0 entries)
console.log(lexicon.library.version); // '1.0.0'

Custom logic library (inline)

import { LogosLexicon, LogicLibrary } from '@silentauth/logos-lexicon';

// Bootstrap from a static definition — no API call required
const library = new LogicLibrary([
  {
    token_id:         'CSIV_EXEC_001',
    action_label:     'authorize_agent_action',
    action_namespace: 'agent.execution',
    required_layer:   4,
    risk_tier:        'high',
    requires_vinac:   true,
    is_active:        true,
    execution_policy: {
      max_uses:               1,
      rate_limit_per_hour:    20,
      approval_window_seconds: 300,
    },
  },
  // … additional entries
]);

const lexicon = new LogosLexicon({
  publicKey: 'pk_live_…',
  library,   // inject pre-built library
});

Hardware Constraint Engine

Before any token reaches the logic library, it must pass the Physics-Bound Hardware Constraint Engine. This layer performs FFT analysis and proximity gating on the physical signal to verify it is legitimate and unforged.

FFT Analysis

The received acoustic signal is subjected to Fast Fourier Transform analysis. The frequency signature must match the expected pattern for the token ID. Signals that do not conform to the expected FFT profile are rejected before token extraction.

Proximity Gating

Signal attenuation is measured against a configured proximity threshold (default 0.5m). Signals from beyond the threshold are rejected. This prevents remote acoustic injection attacks and enforces physical co-presence requirements.

Custom Vocabulary Extensions

Business and Enterprise customers can add custom token IDs and namespaces to their logic libraries.

Add a custom token — Business/Enterprise only

// Custom tokens follow the same State-Frame structure
const entry = {
  token_id:         'CSIV_CUSTOM_001',
  action_label:     'approve_loan_disbursement',
  action_namespace: 'finance.loans',    // custom namespace
  required_layer:   4,
  risk_tier:        'critical',
  requires_vinac:   true,
  is_active:        true,
  execution_policy: {
    max_uses:            1,
    rate_limit_per_hour: 2,
    dual_approval:       true,
    value_limit_usd:     500000,
  },
};

await lexicon.library.addCustomEntry(entry);
// Synced to SilentAuth API and available across your project