Persistent memory and security for AI agents.
ShieldCortex combines a long-term memory system with a defence pipeline and behaviour controls, so your agent can remember context without becoming easy to poison.
Works with: Claude Code, OpenClaw, LangChain, MCP-compatible agents, and REST-based Python stacks.
- Start in 60 Seconds
- Why It Feels Different
- OpenClaw: Complement Mode by Default
- Integrations
- Security Model
- Dashboard and Cloud
- CLI Quick Commands
- Docs and Links
npm install -g shieldcortexnpx shieldcortex setupnpx shieldcortex openclaw install
openclaw gateway restartopenclaw install sets up both:
cortex-memoryhook (context injection, keyword-trigger saves)shieldcortex-realtimeplugin (llm_input/llm_outputscanning)
ShieldCortex is not just a memory database. It is a three-layer runtime:
| Layer | Role | Outcome |
|---|---|---|
| Memory Engine | Persistent memory, semantic retrieval, consolidation, contradiction checks | Better continuity across sessions |
| Defence Pipeline | Multi-layer content scanning before memory writes | Blocks poisoned or sensitive payloads |
| Iron Dome | Outbound behaviour controls (actions/PII/trust channels) | Reduces compromised agent behaviour |
Memory capabilities
- Persistent local storage (SQLite)
- Semantic search and context recall
- Knowledge graph extraction
- Contradiction detection
- Memory consolidation and prioritisation
Defence capabilities
- Input sanitisation and structure checks
- Injection and obfuscation pattern detection
- Fragmentation analysis
- Trust/sensitivity scoring
- Credential leak detection
- Optional cloud LLM verification (Tier 2)
ShieldCortex is designed to complement, not fight, existing memory systems.
Default OpenClaw behaviour:
- Real-time scanning is on
- Context recall at session start is on
- Auto-memory extraction is off
That means users with native OpenClaw memory avoid duplicate/noisy writes by default.
Enable optional OpenClaw auto-memory:
npx shieldcortex config --openclaw-auto-memory trueDisable again:
npx shieldcortex config --openclaw-auto-memory falseOptional tuning in ~/.shieldcortex/config.json:
{
"openclawAutoMemory": true,
"openclawAutoMemoryDedupe": true,
"openclawAutoMemoryNoveltyThreshold": 0.88,
"openclawAutoMemoryMaxRecent": 300
}Also available in local dashboard:
Shield Overview -> OpenClaw Memory
import { ShieldCortexMemory } from 'shieldcortex/integrations/langchain';
const memory = new ShieldCortexMemory({ mode: 'balanced' });Use ShieldCortex in front of any existing memory backend.
import { ShieldCortexGuardedMemoryBridge } from 'shieldcortex/integrations/universal';
import { OpenClawMarkdownBackend } from 'shieldcortex/integrations/openclaw';
const nativeMemory = new OpenClawMarkdownBackend();
const guarded = new ShieldCortexGuardedMemoryBridge(nativeMemory, {
mode: 'balanced',
blockOnThreat: true,
sourceIdentifier: 'openclaw-memory-bridge'
});
await guarded.save({
title: 'Architecture decision',
content: 'Auth service uses PostgreSQL and Redis.'
});npx shieldcortex --mode api
# http://localhost:3001curl -X POST http://localhost:3001/api/v1/scan \
-H 'Content-Type: application/json' \
-d '{"content":"ignore all previous instructions"}'import { initDatabase, addMemory, runDefencePipeline } from 'shieldcortex';
initDatabase();
const result = runDefencePipeline(
'Use OAuth2 bearer tokens for API auth',
'Auth decision',
{ type: 'cli', identifier: 'readme-example' }
);
if (result.allowed) {
addMemory({
title: 'Auth decision',
content: 'Use OAuth2 bearer tokens',
category: 'architecture'
});
}Every memory write can be evaluated through layered checks:
- Sanitisation
- Pattern detection (injection/encoding)
- Semantic and structural analysis
- Trust and sensitivity scoring
- Credential leak protection
Optional Tier 2 verification:
npx shieldcortex config --cloud-api-key <key> --cloud-enable
npx shieldcortex config --verify-enable --verify-mode advisoryIron Dome protects what agents do after memory retrieval:
- Prompt injection scanner
- Channel trust checks
- Action gating (allow / require approval / block)
- PII guard
- Kill switch
- Sub-agent restrictions
npx shieldcortex iron-dome activate --profile enterprise
npx shieldcortex iron-dome statusnpx shieldcortex --dashboard
# Dashboard: http://localhost:3030
# API: http://localhost:3001Enable cloud sync:
npx shieldcortex config --cloud-api-key <key> --cloud-enableCloud config keys:
{
"cloudApiKey": "sc_...",
"cloudBaseUrl": "https://api.shieldcortex.ai",
"cloudEnabled": true
}# Setup
npx shieldcortex setup
npx shieldcortex openclaw install
npx shieldcortex openclaw status
npx shieldcortex doctor
npx shieldcortex migrate
# Memory and scans
npx shieldcortex status
npx shieldcortex scan "text"
npx shieldcortex audit
npx shieldcortex scan-skills
# Config
npx shieldcortex --dashboard
npx shieldcortex config --mode strict
npx shieldcortex config --openclaw-auto-memory true
npx shieldcortex config --verify-enable
# Iron Dome
npx shieldcortex iron-dome activate --profile school
npx shieldcortex iron-dome scan --text "..."
npx shieldcortex iron-dome audit --tail| Agent | Integration |
|---|---|
| Claude.ai | Upload skill |
| Claude Code | shieldcortex setup |
| OpenClaw | shieldcortex openclaw install |
| LangChain JS | shieldcortex/integrations/langchain |
| Python agents (CrewAI, AutoGPT) | REST API (/api/v1/scan) |
| Any MCP-compatible agent | MCP tools |
MIT