LockStock Core

Give Your AI a Soul, Not Just a Session ID

"LLMs are stateless amnesiacs. LockStock Core gives them a memory that travels."

The Problem: Stateless Drifters

Traditional AI systems store agent state in databases using simple session IDs. When the server crashes, the database connection fails, or the agent needs to move between clouds—the context is lost. Your agent wakes up with amnesia.

LockStock Core treats agent identity as an intrinsic property of the data structure itself, not a label in a database column. This enables true portability, mathematical lineage verification, and zero-loss state continuity.

>Cryptographic Passport Identity

Identity is not a label; it is the sum of a complete history.

Every agent is issued a cryptographic "passport"—a dynamic object signed with HMAC-SHA256. Every action is verified against the agent's public key. Without the private signing key held in the secure enclave, a "clone" is instantly rejected as a forgery.

passport = { agent_id: "analytics-bot-001", public_key: "0x4a3f...", sequence: 1247, parent_hash: "sha256(prev_state)", signature: "hmac_sha256(...)" }

The Passport Mechanism: Every agent carries proof of its entire execution history. To verify identity, simply check the cryptographic chain from genesis to current state.

Sequential Verifiable Portable Memory

Agent state evolves through cryptographically-linked transitions that create an unforgeable mathematical proof of every action.

We moved beyond simple version numbers (v1, v2, v3) to cryptographic state evolution. Every state change is a sequenced transition that's mathematically linked to all previous actions, creating an unbreakable audit trail.

Why Order Matters: The mathematics ensures sequence integrity. You cannot rearrange an agent's history, insert fake actions, or create duplicate states. This prevents state collisions in distributed systems and makes "forking" an agent's identity mathematically impossible.

The Benefit: We can mathematically prove lineage and calculate exactly how many steps apart any two states are. This enables:

  • Split-Brain Prevention - Impossible to have two valid versions of the same agent
  • Exact State Synchronization - Know precisely where agents diverged
  • Tamper Detection - Any modification breaks the mathematical proof
  • Automatic Credential Rotation - New cryptographic proof required for every action

Parent Hash Chain

Unforgeable cryptographic lineage. One-time use per state.

LockStock treats agent states like blocks in a blockchain, but optimized for high-frequency updates. Every new state Sn must contain the SHA-256 hash of the previous state Sn-1.

State 0 (Genesis): hash = sha256("agent-001" + genesis_data) State 1: parent_hash = hash(State 0), hash = sha256(State 1 data + parent_hash) State 2: parent_hash = hash(State 1), hash = sha256(State 2 data + parent_hash) ...

Replay Attack Prevention: Once a state hash is "spent" to create a new state, it cannot be used again. The chain is strictly forward-moving. Any attempt to reuse a hash is immediately rejected as a replay attack.

This is automatic credential rotation at the proof level. While your base secret remains constant (hardware-locked in the Liberty vault), the cryptographic proof you present changes with every single action. It's like having a new password for every API call—except you don't have to manage it.

Traditional rotation: Same password for 90 days
LockStock rotation: New proof every action
Result: Zero-second replay window vs 90-day exposure window

Agent Teleportation

Export passport → migrate to new host → import → resume at exact sequence.

True portability means the agent is independent of the hardware it runs on. LockStock serializes the entire Topological State and Hash Chain into a portable binary blob.

# Export from Server A passport_data = agent.export_passport() # Transfer to Server B (any cloud, any region) with open('agent_passport.bin', 'wb') as f: f.write(passport_data) # Import on Server B agent_restored = Agent.import_passport(passport_data) # Agent resumes with zero memory loss assert agent_restored.sequence == agent.sequence

Zero-Loss Resume: The agent "wakes up" on the new server with memory, goals, and context perfectly intact. This enables Edge-to-Cloud and Cloud-to-Cloud mobility without custom ETL pipelines.

Use Cases:

  • Server crash recovery (restore from last checkpoint)
  • Load balancing (move agent to less busy server)
  • Multi-cloud deployment (AWS → GCP seamlessly)
  • Edge computing (process locally, sync to cloud when online)

Architecture Diagram

┌─────────────────────────────────────────┐
│         Agent Passport Identity         │
│  ┌────────────────────────────────────┐ │
│  │ agent_id: "bot-001"                │ │
│  │ sequence: 1247                     │ │
│  │ parent_hash: sha256(prev_state)    │ │
│  │ signature: hmac_sha256(...)        │ │
│  └────────────────────────────────────┘ │
└─────────────────────────────────────────┘
              ↓
┌─────────────────────────────────────────┐
│    Sequential Verifiable Memory         │
│  S₁ → S₂ → S₃ → ... → S_n              │
│  (Cryptographically Linked States)      │
└─────────────────────────────────────────┘
              ↓
┌─────────────────────────────────────────┐
│        Parent Hash Chain                │
│  Genesis → H₁ → H₂ → ... → H_n         │
│  (Unforgeable Cryptographic Lineage)    │
└─────────────────────────────────────────┘
              ↓
┌─────────────────────────────────────────┐
│      Agent Teleportation                │
│  Export → Transfer → Import → Resume    │
└─────────────────────────────────────────┘
                

Getting Started

Ready to give your agents a soul? Start with the Quickstart Guide or explore the full API Reference.

For enterprise deployments with velocity monitoring and causal auditing, check out LockStock Guard.