BASTION

Persistent Memory for Agentic

Persistent, self-healing memory for autonomous AI agents. Crash-resilient. Injection-resistant. Cryptographically sealed.

…
Memories Stored
0
MCP Tools
0
Resources
Ingestion telemetry

Poisoned memories?
Not in this Bastion.

Autonomous agents face silent corruption in production. Prompts containing malicious overrides or PII leaks are ingested, leading to behavioral drift.

Bastion acts as the Forensic System of Record. Run the simulator to see the OWASP ASI06 Guard shield the CockroachDB ledger, and trigger the time-travel recovery engine.

6.7ms
Guard Scan p50
598ms
Vector Search p50
FORENSIC TELEMETRY NODE // BASTION_GUARD
System Monitor
IDLE
ASI06 RISK RATING
1.0%
BEHAVIORAL DRIFT
0.04
System Health: 100% SECURE
AGENT_DEFI_01: Ingestion pool idle.
Memory ledger: hash chain verified.
Hash chain: integrity OK.
CLUSTER: SERVERLESS · ap-south-1LEDGER: 14,248 recordsSYS ANCHOR: 0xbed44e23cb8a4b3c
VERIFIED TELEMETRY ANCHOR

Measured on a live CockroachDB cluster

Every number produced dynamically by scripts/benchmark_brutal.py on 2026-08-03 against the live production cluster — real MiniLM embeddings, 483 adversarial payloads, no fallback mocks.

88.2%
Adversarial TPR
426/483 raw + obfuscated payloads caught
426/483 (88.2%)
0%
False Positives
Zero benign texts flagged
0/25 (0.0%)
28.5k
Verify / sec
1000-link SHA-256 chain
28,536 / s
70.0%
Recall@5
Recall@1: 65.0%, MRR 0.6729
Recall@5: 70.0%
1024
Dimensions
C-SPANN vector index
1024-dim
P50 Latency Profile
Live Cluster Telemetry // AWS ap-south-1
TPR 87.0% · FP 0 · LEDGER SECURED
Guard scan6.72 ms
Pipeline scans prompt input for PII, secrets, and injection patterns before write.
Time-travel311 ms
Native CockroachDB MVCC point-in-time state reconstruction query.
Search308 ms
Cosine similarity scan over 1024-dimensional C-SPANN vector indexing.
Store910 ms
SERIALIZABLE isolation write committed on a live CockroachDB Cloud Serverless cluster (AWS ap-south-1).
Backed by proven infrastructure — not promises
Six foundational choices, each a live fact on the running cluster — not a marketing phrase.
CockroachDB
Distributed SQL · SERIALIZABLE
Every write is a distributed transaction with SERIALIZABLE isolation on a live CockroachDB Cloud Serverless cluster deployed in AWS region ap-south-1.
ServerlessSERIALIZABLE
AWS
KMS · S3 Archive · ap-south-1
Customer-managed encryption keys (KMS) along with an archive tier on AWS infrastructure, located in the same region as the database cluster.
ap-south-1AES-256-GCM
OWASP
ASI06 Injection Guard
Adversarially evaluated against 483 payloads: 87.0% detection on obfuscated prompt-injection, with 0 false positives on benign input.
483 payloads87.0% TPR
MCP
Model Context Protocol
Provides 35 tools over MCP — fully compatible today with Claude, Cursor, VS Code, opencode, and any MCP client. This is the primary live integration path.
35 toolsSTDIO / HTTP
A2A
Agent-to-Agent · Ed25519
Secures agent-to-agent interactions via signed agent cards with a trust registry (supporting strict, TOFU, or allowlist modes) and a JSON-RPC 2.0 task lifecycle.
25 skillsED25519 SIGNED
MIT
Open Source License
The full stack — including the MCP server, A2A server, schema, consolidation daemon, and MemoryGuard — is open-source and included in the repository.
OpenMIT
The honest picture — where A2A stands today
Signed, standards-track, and live — but not yet what your everyday IDE agent speaks. Here is the straight story.
WHY
Agent-to-agent interaction is the next frontier for multi-agent systems. A2A (Linux Foundation · Agentic AI Foundation) covers the agent↔agent boundary — tasks, artifacts, and state — while MCP covers the human↔agent boundary. Each protocol serves a distinct purpose.
WHO
Enterprise platforms are adopting A2A: Google ADK, Microsoft Copilot Studio, and others. When a multi-agent stack integrates with Bastion, the bridge is already wired.
WHOM NOT YET
Claude, Cline, opencode, and Copilot support MCP today — not A2A. Consequently, MCP serves as the primary live integration path today, while A2A provides robust future-proofing—already fully implemented with signed agent cards.
HOW SIGNED
Every agent card carries an Ed25519 signature over sorted fields, verified against a TrustedKeyRegistry (supporting strict / TOFU / allowlist modes) to prevent unauthorized impersonation. Cards live at /.well-known/agent-card.json on both servers.
25 A2A skills · JSON-RPC 2.0 task lifecycle · rate-limited 600 req/min/IP · signature verification with DNS-pinned SSRF protection
Connect

Drop-in memory in one step

Install the SDK, add the MCP server to your agent — Claude Code, Cline, VS Code, Copilot, or Codex — and persist cryptographically-sealed memory immediately.

STEP 01 — INSTALL
terminal

Then run the MCP server once — it stays up so every client below can attach:

python -m bastion.mcp_server --transport http --port 9997
BASTION_CONN=postgresql://…/:26257 → confirm sslmode=verify-full
STEP 02 — SELECT YOUR CLIENT
.mcp.json
.mcp.json
35 MCP tools — memory_store · memory_search · memory_audit · memory_timetravel · context_pack and 30 more
✦ SYSTEM CORE ✦

Built for developers who want proof, not promises

Bastion gives agents tamper-evident memory without pipeline rewrites. Less redundant context, lower token costs, and a verifiable chain of custody.

🔗
Every write is tamper-evident. Prove it in one query.

Bastion seals every memory into a SHA-256 hash chain backed by CockroachDB SERIALIZABLE transactions. Corruption, injection, or silent edits break the chain — and memory_audit catches it in a single O(n) scan. Trust scores decay with drift, so you always know how much to trust a memory.

✓SHA-256 linked blocks, verified by audit
✓OWASP ASI06 guard blocks poison at write time
✓AS OF SYSTEM TIME replays any past state
HEADLINE METRIC
100%
chain verified (SHA-256)
How It Works

Add anything. Bastion remembers.

A three-stage pipeline that captures, protects, and recalls — automatically.

📥
STAGE 1
Capture

Agent activity is auto-captured — tool calls, errors, conversations, session lifecycle — with zero manual annotation. No config, no boilerplate.

after_tool_call(ctx, agent_id, tool_name, args, result)
  → tool_execution memory
  → SHA-256(prev_hash + payload)
🛡️
STAGE 2
Guard

Every write passes the OWASP ASI06 pipeline — injection patterns, API-key leakage, PII — before it can reach the CockroachDB ledger.

regex_injection → secret_detector → pii_scan
  → content_size → trust_score
  BLOCKED ✗ or SEALED ✓
🔍
STAGE 3
Retrieve

L1/L2 two-tier retrieval: in-memory cache for hot memories (<1ms), CockroachDB C-SPANN for cold storage (15-30ms). Time-travel with AS OF SYSTEM TIME.

L1 cache hit? → return (<1ms)
L2 C-SPANN search → 1024-dim cosine
AS OF SYSTEM TIME '-1h'
Architecture Decisions

Why These Tools

Real technical choices behind Bastion — not marketing claims, but engineering decisions.

DATABASE
CockroachDB
Distributed SQL
SERIALIZABLE Isolation
No phantom reads, no write-write conflicts between concurrent agents
AS OF SYSTEM TIME
Native MVCC time-travel without manual snapshots or changelogs
C-SPANN Vector Index
Sub-linear similarity search for memory embeddings at scale
PostgreSQL Wire Protocol
Drop-in compatibility with psycopg2, pg drivers, and ORMs
ISOLATIONSERIALIZABLE
AI SERVICE
Embedding Engine
Semantic Search
1024-dim Vectors
Resilient embedding chain, all normalized to 1024-dim
HF First
BAAI/bge-large-en-v1.5 via HuggingFace Inference API
Local Fallback
all-MiniLM-L6-v2 via sentence-transformers — no API key
Deterministic Fallback
SHA-256 hash embedding — agent never stops
VECTOR DIM1024
PROTOCOLS
MCP + A2A
Agent Protocols
35 MCP Tools
Claude, Cursor, VS Code — any MCP client can interact with memory
A2A Signed Cards
Ed25519 cryptographic identity for agent-to-agent trust
Shared Backend
Both protocols read/write the same CockroachDB — zero duplication
Production Security
Brute-force protection, rate limiting, RBAC on both servers
MCP TOOLS35
✦ SYSTEM CORE ✦

What Makes Bastion Unbreakable

Every feature forged for durability, auditability, and injection-proof AI memory.

🔐
SHA-256 Ledger Chain
Every memory block cryptographically links to the previous — creating a tamper-evident chain. Corruption is caught instantly.
Each memory stores SHA-256(content + previous_hash). The chain is verified by memory_audit. Any tampering breaks the link — detected in O(n) scan.
Algorithm
SHA-256
⏳
AS OF SYSTEM TIME Queries
Full MVCC time-travel. Query exactly what your agent knew at any point in time — native CockroachDB feature.
Uses CockroachDB's AS OF SYSTEM TIME for point-in-time queries. Supports ISO 8601 timestamps and relative time. Zero-copy reads via MVCC.
Database
CockroachDB
🛡️
OWASP ASI06 MemoryGuard
Multi-stage guard blocks prompt injection, API key leakage, and PII from ever being written to the memory store.
Pipeline: regex injection scan, secret detection, PII detection, content size check, hash integrity, trust scoring. Blocks before DB write.
Guard Pipeline
6 Checks
🌍
CockroachDB SERIALIZABLE
SERIALIZABLE isolation prevents write-write conflicts between agents. Schema supports multi-region deployment.
CockroachDB uses SERIALIZABLE isolation by default. REGIONAL BY ROW locality in schema. Automatic leader election on region failure.
Isolation Level
SERIALIZABLE
🧠
Sleep-Time Consolidation
Background daemon deduplicates, merges contradictions, and prunes low-value memories — zero overhead during agent operation.
Runs during agent idle time. Uses Jaccard similarity for dedup, negation detection for conflicts. Promotes episodic to semantic. All changes logged to audit trail.
Consolidation Pipeline
6 Stages
📋
A2A Ed25519 Memory Cards
Agents transfer signed memory bundles with provenance proofs. Receiving agents verify card integrity cryptographically.
Each Agent Card is signed with Ed25519. Receiving agents fetch the sender's public key, verify the signature, and validate the card hash chain.
Signature Algorithm
Ed25519
✦ SYSTEM CORE ✦

Frequently Asked

Everything you need to evaluate Bastion.

Structured agent observations, user facts, and preferences — timestamped, vectorized, and cryptographically sealed into a CockroachDB ledger with C-SPANN vector indexing.

Each memory stores SHA-256 of its content and links to the previous block's hash. Tampering breaks the chain — instantly detectable via the audit log.

Yes. Every memory write passes through a multi-stage OWASP ASI06 guard — scanning for injection patterns, PII, and credential leakage before committing.

Set the BASTION_CONN environment variable to your CockroachDB connection string. BastionMemory reads it when each session is initialized — no restart of your app needed, just pass a new connection_string.

Yes, MIT licensed. Clone, self-host freely. The full stack — MCP server, A2A server, schema, consolidation daemon, MemoryGuard — is in the repo.

BASTION

Open-source cryptographic memory ledger for autonomous AI agents. MIT licensed.

MIT
License
v0.10.0
Release
1
Region
Product
Security
✓OWASP ASI06 Guard✓SHA-256 Chain✓Ed25519 Signatures✓EU AI Act Art.12✓Zero-Trust Model
© 2026 Bastion Contributors · MIT License · Secured in CockroachDB
GitHub ↗