Introducing Cortex — Your Agent Learns From Its Mistakes
The Problem Nobody Wants to Admit
AI agents make mistakes. That's expected. What's not acceptable is when they make the same mistake twice.
Every session starts from zero. The agent that guessed the wrong API endpoint last Tuesday will guess the wrong API endpoint again next Tuesday — because it has no memory of the failure. The deploy that broke production last month? Nothing stops the same sequence of commands from running again. The config error that exposed credentials? Sitting in no rulebook, waiting to recur.
This isn't a bug in the agent. It's a structural gap. Agents are stateless between sessions. They don't carry forward the hard-won knowledge of what went wrong, what nearly went wrong, or what the rule is to prevent it next time. Every session is day one.
Cortex closes that gap.
What Cortex Does
Cortex is a mistake-capture and pre-flight check system built into ShieldCortex. It gives your agent — and you — a persistent, searchable database of what has gone wrong, why it went wrong, and the rule that prevents it from happening again.
Four capabilities. One purpose: make sure the agent doesn't repeat itself.
- Capture — log what went wrong, why it happened, and the rule that prevents recurrence. Categorised by type: code, config, process, design, security, and more.
- Pre-flight — before starting any task, run a check against the mistake database. Relevant rules surface as warnings. The agent — and you — know what to watch for before the first line runs.
- Review — pattern analysis across all captured mistakes. See which categories repeat most often, which rules you keep violating, and where systematic improvement is needed.
- Graduate — once a rule has held for 30+ days with no recurrence, archive it. Cortex stays clean. Mastered rules don't clutter active pre-flight checks.
And when you need to find a specific mistake, Search gives you full-text lookup across every captured rule, instantly.
How It Works
The CLI is straightforward. Capture a mistake as soon as it happens — while the context is fresh:
Before deploying — or before any high-stakes task — run a pre-flight check:
Cortex searches the mistake database for anything relevant to that task description and surfaces matching rules as warnings. Relevant past failures appear before you act, not after.
Weekly, run a review to see patterns and repeat offenders:
And when a rule has stuck — when you haven't repeated that mistake in over a month — graduate it out of active circulation:
All Cortex data lives locally in ~/.shieldcortex/cortex/. Nothing leaves your machine unless you choose to sync it.
Why This Matters for Security
Mistakes in AI agents aren't just bugs. They're vulnerabilities in waiting.
A repeated config error doesn't just cause a crash — it can expose credentials. A repeated deployment sequence doesn't just waste time — it can take down production. A repeated auth pattern doesn't just fail — it can create an exploitable gap. These aren't edge cases. They're the exact scenarios that security incidents are made of.
ShieldCortex already defends what goes into your agent's memory, and what your agent is allowed to do. Cortex adds the third dimension: what your agent has learned not to do.
The defence pipeline scans writes that go through ShieldCortex. Iron Dome gates tool calls on Claude Code, OpenClaw, and Hermes once you turn it on. Cortex records a mistake you capture and can check that rule before the next run.
What Cortex adds
Cortex stores a captured mistake on this machine and checks it before the next task.
A captured rule is checked before the next run of that task. The rule is only there if you captured it. Nothing here is automatic learning across every session.
The rules stay in ~/.shieldcortex/cortex/ unless you choose to sync them.
Get Started
Cortex is free on every ShieldCortex install — no signup, no credit card, no configuration step.
Then capture your first mistake before you forget it:
ShieldCortex is open source under the MIT licence. Cortex is free on every install. Built by Drakon Systems.