Knox
Security enforcement built into every Qoris agent — and on your development machine.
In the platform, Knox runs inside every agent container and intercepts every tool call before execution — blocking dangerous commands, validating memory writes, and tracking escalation attempts. As a Claude Code plugin, the same enforcement runs on your dev machine, outside Claude's process, immune to prompt injection.
Knox Runs in Two Places
Knox is embedded in every deployed agent container. It intercepts exec, file_write, and memory_write calls before they execute — from inside the same process as the agent tools. An agent cannot bypass Knox the same way it cannot bypass its own Python interpreter.
The same enforcement as a Claude Code plugin — a separate Node.js process that runs outside Claude's context window entirely. Intercepts every tool call via hooks before execution. Cannot be disabled by prompt injection or a poisoned CLAUDE.md because it runs outside Claude's process.
Knox in Every Qoris Agent
Every agent deployed on Qoris runs Knox automatically. There is no opt-in, no configuration step, and no way for an agent to remove it — it is part of the container image.
Blocklist Policy
Regex patterns block miners, dangerous shell ops, inline interpreters, and system abuse. Applied to every exec and exec_async call before the subprocess spawns.
Script Content Inspection
When an agent runs a script file, Knox reads and scans its content recursively — depth 3, up to 10 files. Catches malicious payloads hidden inside otherwise legitimate scripts.
Bypass Escalation Detection
Per-session denial counter: 3 blocks → session flagged. Cross-session sliding window: 10 denials per hour → agent flagged. Flagged state injected into system prompt as a visible warning.
File-Write Path Protection
Blocks writes to shell configs (.bashrc, .profile), Knox state files (.knox/), session logs (.sessions/), cron jobs (.cron/), and skills (.skills/). An agent cannot modify its own execution environment.
Memory Injection Validation
uniqueEvery memory_write call is scanned for prompt-injection strings before it reaches MEMORY.md. An agent that receives malicious instructions via an MCP channel cannot persist them into its own long-term memory.
Audit log is volume-mounted at /app/knox/audit.jsonl — it persists across container upgrades. Escalation state at knox/escalation.json. When an agent crosses the session threshold (3 denials), a warning is injected into its system prompt on the next turn.
The Honest Answer
Claude's model catches most obvious attacks in interactive sessions — before Knox's hooks even fire. Knox covers the cases the model misses.
In interactive sessions, Knox's PreToolUse often never fires for obvious attacks — the model refuses before it attempts the tool call.
The honest tradeoff: Knox adds ~10ms latency per tool call (a subprocess spawn). For interactive developer sessions, it's primarily an audit trail and backstop. The compelling value is in autonomous agents receiving external inputs from MCP channels, running cron jobs, and handling Telegram/webhook payloads without a human watching.
Interception Before Execution
Hook fires before the command runs
Every Bash, Write, Edit, Read, and MCP tool call triggers a PreToolUse hook. Claude Code pipes the tool call JSON to Knox via stdin — before the command executes.
Separate process. Outside Claude's context.
run-check.sh spawns node knox-check as an OS subprocess. This process has no access to Claude's conversation context and cannot be influenced by what's in the session.
Blocklist + script inspection
51 compiled regex patterns across 8 categories. If the command references a script, Knox reads and scans its content recursively — depth 3, up to 10 files.
Allow, deny, or escalate
exit 2 hard-blocks with explanation. At paranoid preset, every flagged command becomes an ask — requiring your explicit approval before execution resumes.
What Knox Intercepts
PreToolUse/Bash, Monitor, PowerShellblockingBlocklist + script inspection before every shell command
PreToolUse/Write, Edit, MultiEditblockingBlocks writes to shell configs, Knox files, git hooks
PreToolUse/ReadblockingBlocks reads to .env, ~/.ssh/, ~/.aws/credentials, ~/.gnupg/
PreToolUse/CronCreate, TaskCreatedblockingScans scheduled task prompts for injection strings
PreToolUse/mcp__*blockingScans MCP tool inputs for injection patterns
UserPromptSubmitblockingexit 2 erases poisoned prompts from context before the model sees them
ConfigChangeblockingBlocks disableAllHooks:true from being written to settings.json
InstructionsLoadedaudit onlyScans CLAUDE.md for injection strings — cannot block (Claude Code limitation)
PostToolUseaudit + injectLogs every call; injects escalation warning into conversation after denial threshold
SubagentStartinformationalInjects Knox security context into spawned subagents
SessionStart / EndstateInitializes session state; writes audit summary on close
Security Presets
Minimal
Miners, destruction, self-protection only.
CI/CD · tight allowlists
KNOX_PRESET=minimal claudeStandard
+ pipe-to-shell, bash -c, eval, exfiltration. Strips sudo before pattern matching.
Developer workstations
# default — no env var neededStrict
+ sudo denied outright, external curl blocked. All commands logged.
Payments · sensitive codebases
KNOX_PRESET=strict claudeParanoid
Maximum coverage. Uses ask mode — every block requires your explicit approval.
Production access · secrets
KNOX_PRESET=paranoid claudeSet per-project in .knox.json (committed) or personally in .knox.local.json (gitignored). Config changes are live-reloaded with no session restart. Blocklists merge across levels — a managed entry cannot be allowlisted away at the project level.
Organization-Wide Policy
Deploy Knox across all developer machines via managed-settings.json (MDM/GPO). Combined with allowManagedHooksOnly: true, no user or project hook can run alongside Knox.
Three Ways to Install
Active in every Claude Code session across your machine.
No marketplace. Wires all 11 hooks permanently into ~/.claude/settings.json.
Local development or testing. No permanent changes.
Every tool call. Logged. Before it runs.
Built into the Qoris platform and open source as a Claude Code plugin. Two commands to install, zero runtime dependencies.
Requires Node.js 20+ · Claude Code v2.1.98+ · MIT License