Persistent, self-healing memory for autonomous AI agents. Crash-resilient. Injection-resistant. Cryptographically sealed.
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.
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.
Install the SDK, add the MCP server to your agent — Claude Code, Cline, VS Code, Copilot, or Codex — and persist cryptographically-sealed memory immediately.
Then run the MCP server once — it stays up so every client below can attach:
Bastion gives agents tamper-evident memory without pipeline rewrites. Less redundant context, lower token costs, and a verifiable chain of custody.
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.
A three-stage pipeline that captures, protects, and recalls — automatically.
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)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 ✓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'Real technical choices behind Bastion — not marketing claims, but engineering decisions.
Every feature forged for durability, auditability, and injection-proof AI memory.
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.