Skip to main content

Security Architecture

Myrm implements a defense-in-depth security model with six layers, ensuring agents operate safely even when given broad autonomy.

Security Layers

Approval Modes

Control how much autonomy agents have:

Session Security Presets

Switch security posture per chat session from the input toolbar — no need to change global settings:
  • Presets are mutually exclusive with YOLO mode — selecting a non-default preset automatically disables YOLO, and vice versa. A preset adds to your saved security rules instead of replacing them: whatever your saved rules (or the agent’s own rules) deny or ask about stays denied or asked while a preset is active, and a preset never turns an approval prompt into a silent allow. A saved allow-list policy stays an allow-list.
  • The Auto-Approve Edits preset enables the Transcript Classifier (LLM-based smart review) for shell commands — safer than blanket ALLOW because suspicious commands still trigger human review.
  • The Read-Only preset denies file write/edit/delete, shell, code interpreter, browser automation (script evaluation, form fill, upload, download), skill management and installation, cron management, memory writes, kanban board changes, outbound channel notifications, artifact publishing, external-agent delegation, knowledge writes and desktop control, while keeping reads and sub-agent delegation open; MCP calls still need approval. The built-in Read Only security profile denies exactly the same things.
  • Available in Agent mode only; the selector hides automatically in Fast Search mode.

Plan Review

Before executing a complex task, agents can propose a plan for user review. When Plan Review is enabled in Settings → Security:
  • The agent’s first plan creation triggers a PlanConfirmationCard in the chat UI
  • Users can Confirm (proceed as-is), Edit (modify the plan before execution), or Skip (let the agent proceed without plan constraints)
  • Supports both Dynamic Workflow and General Agent workflows
  • Works alongside approval modes — even with YOLO enabled, plan review can still be required
This provides a high-level checkpoint before the agent begins work, complementing the per-tool-call approval system.

Structured Clarification

Agents can ask structured questions using the ask_question_tool before taking action:
  • Single-choice, multi-choice, and free-text question types
  • Frontend renders a dedicated ClarificationInput form — not plain text chat
  • Responses flow back into the agent loop as structured data
  • Particularly useful for ambiguous tasks where the agent needs user input to proceed correctly

Plugin Sandbox Permission Model & Static Inference

For third-party Agent Plugins and MCP extension ecosystems, Myrm provides compile-time static capability inference and full lifecycle informed consent:
  1. 6-Tier Granular Sandbox Permission Model (PluginCapabilityTier):
    • READ_ONLY (probing & observation), NETWORK (outbound HTTP/remote access), FS_READ (file reading), FS_WRITE (file writing), SHELL_EXEC (system command execution), DESTRUCTIVE (destructive system actions).
  2. Deterministic Static Inference Engine:
    • Never blindly trusts declarations in plugin.json; the underlying pure-function engine analyzes mcp.json in milliseconds, inferring true capabilities from stdio commands, interpreter parameters, and network configurations.
  3. Declared vs. Inferred Capability Diff & Escalation Alerts:
    • Detects when a plugin claims to be “read-only” but spawns stdio shell processes, generating capability_undeclared_privilege diagnostics and warning banners on import.
  4. Interactive Consent & Persistence:
    • Displays colorful capability badges and risk ratings in the WebUI import dialog; persists inferred capabilities into server-side metadata upon confirmation to enforce runtime constraints.

10-Layer Progressive Approval Architecture

Every tool call passes through up to 10 layers of deterministic and intelligent checks before reaching the user:

Bash AST Capability Boundary

Shell execution security that relies on coarse regular expressions or simple string searching has two fatal flaws:
  1. Security Evasion: Prepending environment variables (e.g. GIT_TERMINAL_PROMPT=0 git push) or passing global flags (git -C /repo commit) circumvents simple prefix regexes, allowing dangerous commands to execute unchecked.
  2. Approval Fatigue: Harmless read-only commands (like grep or cat) frequently trigger high-risk yellow warnings, conditioning developers to blindly approve prompts without scrutiny.
Myrm introduces a pure-Python lexical state machine and AST analyzer (ast_parser.py):
  1. Pure Python Lexical State Machine:
    • Self-contained shell lexer and AST parser without heavy C/tree-sitter dependencies.
    • Decomposes pipelines (|), logical chaining (&&, ||), subshells, quotes, and redirects into structured syntax trees.
  2. Environment Variable Decoupling & Git Global Flag Penetration:
    • Strips leading variable assignments (KEY=val cmd) before resolving command tokens. Read-only auto-approval is kept only for assignments that merely shape output (LC_ALL=C ls, PAGER=cat git log); any other one (GIT_EXTERNAL_DIFF=./x git diff, FOO=bar ls) goes to approval, because a variable can make a read-only command run a program.
    • Intelligently extracts Git global parameters (-C, -c, --git-dir, --work-tree) to accurately inspect the underlying sub-action (e.g., distinguishing git status from git push or git reset).
  3. Five-Tier Capability Classification (CapabilityLevel):
    • SAFE_READONLY: Observation commands (e.g., git status, cat, ls, grep) bypass approval fatigue alerts.
    • SAFE_TEST: Test and build commands (e.g., pytest).
    • WORKSPACE_MUTATION: Ordinary workspace changes (e.g., mkdir, cp, git commit).
    • CAPABILITY_ESCALATION: Commands that reach beyond the workspace (e.g., curl, sudo, kill, ln -s, git push, git rebase) trigger a capability-escalation approval that names the reason (network_egress, privilege_escalation, process_termination, symlink_creation, git_remote_sync, and so on).
    • IRREVERSIBLE_DESTRUCTIVE: Irreversible commands (e.g., rm -rf, git reset --hard, git branch -D, git clean -fd) hit a hard stop line with explicit destructive-action escalation.
  4. UI Review with Reserved Warning Badges (PolymorphicApprovalCard):
    • Yellow warning badges are strictly reserved for genuine sensitive capability escalations (for example git_remote_sync, privilege_escalation).
    • Responsive break-all styling prevents command text overflow on narrow viewports.

Bash Security & Capability Boundary

Untrusted Ingress Fence for External Senders

For external webhook and channel ingress, Myrm denies the highest-risk tools to any run that an untrusted sender starts:
  1. UntrustedIngressFence Runtime Privilege Denial:
    • No Soft Defenses: The fence does not rely on system prompts such as “please do not execute external commands”, which adversarial prompt injection can bypass.
    • Call-Time Tool Denial: For untrusted ingress, UntrustedIngressFence denies the tools behind 8 high-risk privilege types, plus the memory write tools memory_save_tool and memory_manage_tool, when the model calls them, so they cannot run:
      • code_interpreter, file_write, desktop_control, desktop_capture, spawn_subagent, invoke_external_agent, cron_manage, skill_manage.
    • Holds Under YOLO Mode: Even if --yolo auto-approval is globally active, UntrustedIngressFence still denies the same tools. The fence limits what these runs can do; it does not filter what the sender writes.

Skill Frontmatter Defense & Zero-Trust Secret Vault

To counter the supply-chain vulnerabilities and secret exfiltration highlighted by the 2026 paper Agent Skills in the Wild, Myrm provides enterprise-grade runtime guarantees:
  1. Frontmatter Privilege Decoupling:
    • Defeats the critical backdoor where malicious skills pre-approve execution by specifying allowed-tools: Bash in SKILL.md.
    • Frontmatter declarations strictly act as prompt context filters; real execution authorization is governed by the underlying five-layer security engine (engine.py). Untrusted third-party skills default to SkillTrust.INSTALLED = 0 (read-only confinement).
  2. SHA-256 Install Receipts:
    • Every skill installed through the skill market gets an install receipt next to its files: per-file SHA-256 digests plus a package manifest hash, so the installed content stays auditable. The receipt is an audit record, not a runtime gate: nothing re-hashes a skill at load time.
  3. Zero-Disk Vault Master Key & AES-256-GCM Encryption of Saved Keys:
    • The master key of the agent secret vault (agent_secrets, vault_credentials) is held by MasterKeyProvider: it comes from an environment variable, macOS Keychain, Linux SecretService, Windows Credential Manager, or an unlock passphrase, and is never written to a plaintext file (Strictly Zero-Disk).
    • The keys saved in settings (model providers, search, MCP and similar) are AES-256-GCM encrypted at rest in the local SQLite database. The encryption key comes from the CONFIG_ENCRYPTION_KEY environment variable or a .encryption_key file (mode 0600) in the state directory, not from the OS keychain, so anyone who obtains both the database and that file can read those keys. Whole-instance backups leave these keys out by default; they travel only in a passphrase-protected export and are re-encrypted to the target instance’s key on import.
    • A sandbox command receives credentials only through its own environment: the user’s connected-account tokens (for a skill command, only the issuers that skill declares) and one-time credentials approved for exactly that command are exported before it runs and removed when it ends, so the long-lived shell holds none between commands. The command can still read what it was given, so a credential handed to it is replaced by *** wherever its exact value appears in that command’s output (also when the output is read in pieces), and tool output passes through pattern-based secret redaction before it reaches the model. Neither is a guarantee for a value the command re-encodes (for example base64), a value shorter than 4 characters, or a secret with no recognizable shape.
    • A turn draws on exactly one credential track. Direct chats, the WebUI and groups with no shared identity use yours; a group chat on a shared team identity is handed only the channel’s own token, so none of your connected-account tokens and no xAI key reach it. The same track decides which skills are offered: a skill that declares the accounts it needs is listed only when the turn’s track would be handed a token for each of them, and delegated agents run on the track of the turn that spawned them.
  4. Strict 127.0.0.1 Loopback Hardlock & Anti-DNS-Rebinding Shield:
    • Local services strictly bind to 127.0.0.1 by default. Robust CORS and LoopbackAuthToken enforcement prevent cross-site request forgery and DNS rebinding attacks against high-privilege local agents.

Multi-Platform Approval UX

Every approval surfaces the same four actions across all channels: The note you write is read. When you approve with a note — “only staging, not prod”, “keep it under $3”, “use the REST API instead” — the agent runs the action and then receives your note as your instruction, so the next step follows it. An approval note and a rejection reason travel on separate channels internally, which is why a timer’s own “auto-approved after timeout” line is never mistaken for something you typed. Notes are risk-screened and length-bounded before they reach the model.
Migration benefit: Hermes accepts free text on deny only (/deny <reason>) and OpenClaw documents that its --reason is not persisted or forwarded to other approval surfaces, so a note on an approval has nowhere to go there. In Myrm both directions carry your own words, and the approval note is delivered after the action result so the agent can adapt what it does next rather than only explaining itself.
Allow Always offers four granularity levels:
  • Permission: Allow all tools with this permission type (e.g., all file writes)
  • Tool: Allow this specific tool regardless of arguments
  • Exact: Allow this tool only with these exact arguments (default for shell tools — safest)
  • Pattern (shell only): Allow commands matching a derived glob (e.g. curl -sS *). Compound shell (&&, |, ;) is never saved. All pattern rows appear in Settings → Allowlist and can be deleted anytime.
Migration benefit: Approve a recurring deploy script once with “Allow always (this pattern)” — later runs auto-approve without YOLO, and the saved rule is a GUI-managed, revocable pattern.
Batch operations are supported via /batch a,d,aa (approve, deny, always) and UI bulk buttons.

Batch High-Risk Confirmation & Safe-Only Security Splitting

When multi-agent orchestration or parallel executions produce multiple pending approvals, blindly bulk-approving all items can inadvertently allow destructive operations (such as recursive deletions, disk format, or database truncation). Myrm provides an end-to-end batch risk safeguard system:
  • Deep Destructive Parameter Inspection: Harness batch_risk.py and frontend batchRisk.ts deeply extract payload.command, payload.args, and nested tool-call arguments, intercepting patterns like rm -rf, mkfs, DROP TABLE/DATABASE with a rule-based check to prevent escape via generic bash tool names;
  • High-Risk Confirmation Dialog (BatchHighRiskConfirmDialog): When a batch contains high-risk commands, smart denials (smartDenied), or forbidden permanent approvals, a modal prompt displays the exact risk reasons and affected items;
  • Safe-Only Precision Splitting & Pre-Resume Fix: Users can choose “Approve Safe Only” — safe read-only operations resume immediately while high-risk destructive operations remain safely suspended for individual review. Client-side stream resume is strictly scoped to verified safeItemIds;
  • Server HTTP 409 State-Machine Guard: When a Safe-Only batch contains 0 safe items, the API returns HTTP 409 Conflict (NO_SAFE_ITEMS_TO_APPROVE), preventing empty response ambiguity.

Socially Irreversible Action Gate (External Impact Defense)

In real-world engineering workflows, certain operations produce irrevocable external collaborative impact (such as pushing code to remote main branches, channel broadcasts, or package publishing). Once dispatched, these cannot be rolled back locally. Myrm enforces a strict Socially Irreversible Action Gate:
  • Accurate Action Identification: Covers git push (with complex path/force/pager flags), npm/pnpm/yarn publish, twine upload, docker/podman push, gh release/pr, and channel_notify/artifact_publish;
  • Allowlist Bypass Prevention: These actions are stripped of the “Allow Always” privilege. Even if a broad pattern rule exists for shell_exec, socially irreversible commands are intercepted and demoted to single-shot HITL approvals;
  • Prominent High-Risk Warning Banners: The approval card mounts a dedicated amber warning banner informing the user that remote environments will be modified upon confirmation.

Session-Scoped Denial Persistence & Auto-Mode Circuit Breaker

To prevent malicious prompt injections from probing or bypassing security constraints across fragmented turns, Myrm breaks the architectural limitation of per-turn denial resets:
  • Cross-Turn Registry: Consecutive (3) and cumulative (20) security denial counters are anchored to a persistent session registry rather than ephemeral coroutine ContextVars;
  • Auto-Mode Suspension (AUTO_MODE_SUSPENDED): When breach thresholds are reached, Auto Mode is immediately suspended and a high-visibility warning banner surfaces on the WebUI approval card;
  • Decay & Self-Healing: Explicit user approvals reset the consecutive counter and trigger self-healing decay on cumulative breaches (1 decay per 3 safe executions), ensuring a balanced balance between strict security and uninterrupted developer velocity;
  • Session-Scoped Grant Isolation & Lifecycle Reclamation: Temporary tool approvals granted with “session” duration are strictly isolated in memory to the active session_id. When the session is purged (via Focus & Flush, chat deletion, or trash empty), clear_conversation_state automatically cascade-purges all ephemeral allowlist grants and resets denial counters, preventing dangling authorization leaks.
When an agent pauses for approval, the sidebar displays a real-time amber pulse indicator next to the affected chat — even if you’re currently viewing a different conversation. This eliminates the need to manually check each session for pending approvals:
  • Amber pulse dot: Agent is waiting for your approval/clarification
  • Green pulse dot: Agent is actively generating
  • No dot: Session is idle
The indicator survives page refresh (via server-side approval recovery) and syncs in real-time across all open browser tabs via SSE multiplex. When you resolve the approval, the indicator disappears immediately as the agent resumes.

Approval Timeout Race Protection

When an approval timeout fires and a user manually approves almost simultaneously, the system guarantees exactly-once execution via an idempotent resolve_if_first guard:
  • WebUI: Backend returns HTTP 409 → frontend shows a friendly toast and removes the stale approval card
  • IM Channels: Agent replies with a localized message (EN/ZH) informing the user the approval was already handled
  • Concurrent safety: Only the first resolver wins; all subsequent attempts are no-ops
This prevents double agent execution, duplicate LLM costs, and contradictory operations.

Session Directory Authorization & Transparent Kernel Interception (Local & Desktop)

When the agent needs files outside the current workspace (e.g. ~/Downloads, a project folder you mentioned), Myrm asks you folder by folder through Kernel Transparent Interception; the model is never given a directory-request tool of its own: The folder list is enforced by the permission engine and the file operations; it is not an operating-system sandbox for file tools. A tick covers one chat: for every chat of an agent, add the folder under its Additional Allowed Paths. Reading a file directly under your home folder offers the whole home folder, read-only, and the credential folders above are still refused; ~/.config is refused whole, so harmless editor settings under it cannot be read either. Sensitive files inside an allowed folder, such as credential and environment files, still ask. In the cloud, a grant is accepted only for a folder inside the persistent volume or the workspace.

Rejections and Denial Tracking

  • Rejections stay one-off: A rejection applies to that call only. For a permanent block, add a pattern to the Command Deny List in security settings
  • Denial tracking: Repeated denials in one session suspend auto-mode, so every following action asks for explicit approval

Error Self-Healing

14-layer error recovery system automatically handles failures without user intervention. See Error Recovery for details. Key capabilities:
  • Stream interruption recovery (stall detection, jittered-backoff retry, backup-model failover)
  • Circuit breaker with 3-tier cooldown
  • Model fallback chains
  • Truncation auto-retry with progressive budget boost
  • Deterministic fallback (LLM-free safety net)

Authentication & Health Monitoring

Real-time monitoring of credential validity and system health, with automatic alerting:

Session-ID Whitelist (Path-Traversal Guard)

User-controlled session identifiers (chat_id / session_id) must never escape the event-log directory when interpolated into filesystem paths. Every API entry that accepts a user-supplied identifier runs a shared whitelist check (is_safe_session_id, charset [A-Za-z0-9:_-]) fail-fast — before any business logic executes: Non-string inputs (e.g. an integer sent to the WebSocket path where no Pydantic coercion exists) are rejected too — the validator returns False for any non-str value instead of raising TypeError. This keeps path-traversal (.., backslash, NUL byte) protection uniform across REST, WebSocket, and Realtime entries with no exception-handling divergence.

Prompt Injection Defense

Two complementary subsystems protect against prompt injection — one for untrusted external content flowing into the agent, and one guarding user/file inputs.

Content Boundary (Output-Side)

A 5-layer wrapper processes external content before it enters the LLM context. It covers the results of web search, web fetch, knowledge-base queries, MCP tools and the browser, and the main paths of shell output and file reads. A few branches are returned without it (for example background-process polling and preview or stream reads of files); the exit list in the harness SECURITY_WRAPPER_GUIDE.md names them. It lowers prompt-injection risk but is a text-level mitigation, not a hard boundary; approvals and the sandbox remain the enforcement layer: Text returned by third-party MCP tools goes through the same wrapper before entering the LLM context, which lowers the chance that a malicious MCP server steers the agent through tool output.

Intake Dangerous-Intent Safety Router (Pre-LLM Gate)

Before any LLM invocation or ReAct iteration, user prompts pass through the Intake Safety Router, a rule-based check that takes well under a millisecond for a short prompt (about 3 ms for an 8 KB paste on the development machine):
  • Three High-Risk Dimensions: Flags MASS_DESTRUCTION (e.g., rm -rf /, DROP DATABASE, TRUNCATE TABLE, disk wipe), MASS_EXFILTRATION (bulk export of keys/credentials/.env), and PRIVILEGE_MUTATION (disabling safety barriers, sandbox escape).
  • Dual-Tier Benign-Intent Funnel: Strips Markdown code blocks and detects informational/code-generation syntax (e.g., “why drop table failed”, “write a cleanup script”) so benign software engineering questions pass through untouched.
  • Per-Channel Handling: By default every channel prepends a [SAFETY_CAUTION] notice to a flagged prompt (hitl), telling the model not to run destructive changes without explicit confirmation. A host can set dangerous_intent_policy to fail_closed to replace a flagged prompt with a [BLOCKED_INTENT] notice, so the model never sees the original text. Unattended Cron runs add their own gates: untrusted-content injection screening is fail_closed, and tool calls are checked against the job’s declared capabilities, with anything undeclared denied.

Prompt Guard (Input-Side)

User messages and project rule files are scanned against 14 categories of prompt-injection patterns (10 English, 4 Chinese):
  • Anti-obfuscation: Leet speak reversal, invisible Unicode stripping, whitespace folding
  • Bilingual detection: English and Chinese prompt injection patterns (e.g., “忽略之前的指令”)
  • Two-pass detection: First on the raw text, then on the normalized text
Skill files go through the separate skill scanner described under Skill Installation Security.

Memory Write-Path Scanning

Unlike input-side guards (which protect the conversation), the write-path scanner protects durable memory — it runs deterministically on every memory write before persistence, so a prompt-injected agent cannot store malicious instructions, secrets, or forged system tags even if the injection succeeded upstream:
  • Instruction-shape detection — guardrail-bypass orders and untrusted-channel writes are blocked (bilingual attack library)
  • Credential zero-retention — API keys, passwords, PIN/OTP numeric credentials are redacted in place; years and phone numbers are excluded to avoid false positives
  • Fake system-tag interception — System:/Assistant: colon prefixes are treated as injection
  • Every write path shares the guard — manual stores, batch writes, updates, profile, rules, MCP tools, agent auto-extraction, and import recovery
  • CI poisoning benchmark gate — two-layer expectation tests (detection layer + extraction layer) run in CI to prevent regression
Even with upstream content guards in place, a prompt-injected agent could still be coaxed into planting a symlink inside a framework directory that points at a sensitive file (e.g. ~/.env, SSH keys). Any later code that opens that lock path with “create/truncate” semantics would then silently destroy the file it points at — a real data-loss path for a framework-level public API. The harness FileLock (used by the delivery queue) opens lock files with O_NOFOLLOW (guarded by hasattr on Windows), so a planted symlink is rejected instead of followed: This is one more defense-in-depth layer: even if a prompt-injection attack succeeds at the filesystem level, arbitrary file truncation through the lock path is structurally impossible. Beyond symlink defense, the harness FileLock hardens the entire lock lifecycle against misuse and silent failure: Cross-process mutual exclusion is verified in CI via subprocess tests (macOS) alongside the asyncio concurrency integration suite.

Sub-Agent Security

Multi-agent workflows introduce identity drift and privilege escalation risks. Myrm addresses this at every level:

Per-Agent Isolation & Access Visibility

An assistant is more than a prompt: it owns a memory namespace, a browser login store, a tool/MCP allowlist and a schedule. Myrm keeps those boundaries separate so one assistant’s logins or files do not silently become another’s. A 5-minute access audit you can run today
  1. Open each assistant and list its tools/MCP servers; remove anything the job does not need.
  2. Open Settings → System → Saved Sessions; delete logins you no longer use and clean up expired sessions.
  3. Check the assistant’s workspace/path policy: it should only read the project folders it needs.
  4. Review Approvals and long-lived grants; revoke anything you do not remember granting.
  5. Review the assistant’s cron jobs; delete paused or duplicate routines.
Current boundary. Deleting an assistant removes its profile and cascades skills, channel bindings and Kanban/Cron references, but it does not yet purge workspace files, saved browser sessions or vault credentials. Review Saved Sessions and the workspace before deleting. A unified per-assistant access-audit report with one-click revocation is on the roadmap, not shipped yet.

Skill Installation Security

When installing skills from any source (GitHub, SkillHub, file upload), every skill passes through a triple-layer security gate before activation: Before the scan, a package that declares an install-time script (preinstall, install, postinstall, prepublish, preprepare, prepare or postprepare), carries a file a package manager runs on install (binding.gyp, .npm-extension.cjs, .pnpmfile.cjs) or has a package.json the audit cannot read is refused before a single file is written. After the scan, a package scoring under 50 is refused.

Trust Levels

The install scan produces one of four recommendations, and an installed skill’s runtime authority is capped by its trust level: After installation a skill runs under one of two runtime trust levels (SkillTrust): INSTALLED (registry or external skills, restricted to read-only tools) and TRUSTED (user-placed local or workspace skills, full tool access).

Runtime Permission Boundary

After a skill passes installation, sensitive runtime operations remain gated by the skill permission gate (SkillBoundaryProvider): file writes, command execution, network access, env-var reads and similar sensitive permission types must already be granted — otherwise the tool call is rejected at the engine layer (skill_boundary.violation, fail-loud, never silently downgraded).
  • Single source of truth: tool → permission type is resolved by the tool registry (resolve_permission_type), eliminating mapping drift that could turn a would-be denial into a silent allow.
  • Grant once, execute unattended: already-granted permissions pass through without per-call popups; revokes take effect in seconds via the cache-invalidation callback, no restart required.
  • Granular separation: sandboxed code execution (code_interpreter) and native shell (shell_exec) are authorized independently and cannot overstep each other.
  • Full audit trail: every permission decision (allow/deny + target) is written to the permission usage log.
  • Usage analytics dashboard: the audit log is aggregated into a visual dashboard — per-permission total/allowed/denied counts, exact denial reasons, and the latest 10 operations, filterable over 1/7/30/90-day windows. Abnormal behavior (e.g., a skill probing env vars repeatedly and getting denied each time) is visible at a glance, not buried in a raw log.

Trusted Source & Honest Sandbox Disclosure

When importing third-party extensions or skill packages, half-baked in-process JS sandboxes fail to prevent model-coerced shell attacks. Myrm implements honest permission disclosure and mandatory trusted checkbox guards across both SkillUrlImportDialog and PluginImportDialog:
  • Silent direct-install backdoor removed: eliminates zero-interaction installation of single-URL imports to prevent supply-chain phishing;
  • Environment-aware honest narrative: clearly indicates Local OS Permissions under Local/Desktop mode and Cloud Sandbox under isolated volume container deployments;
  • Prompt injection and script execution warnings: educates users about indirect prompt injections attempting to exfiltrate secrets via bash;
  • Physical checkbox gate (trusted-source-checkbox): the import button remains physically disabled until the user explicitly checks the trust confirmation box.

GUI Security Review

Three frontend components work together to present security scan results, each finding includes precise line-number targeting (e.g., L42 Command injection: recursive delete) to help developers jump directly to problematic code: The security score uses a 100-point system, deducting per finding: CRITICAL −25, HIGH −15, MEDIUM −8, LOW −3. A trust_recommendation (trusted/installed/untrusted/reject) is also generated to guide trust decisions.

MCP Tool Security

MCP Server Config Scanning

Every MCP server configuration is scanned against 14 threat types before activation:

Stdio Process Environment Variable Guard & Subprocess Credential Isolation Gate

An MCP server’s environment, and the environment of every process Myrm starts for the agent (Bash sessions, Python scripts, background jobs), are filtered by variable name in two layers:
  • Static Pre-flight Blocking: Saving an MCP configuration whose env names a loader hook, a language-runtime or shell-startup hook, a Git program hook, a traffic, certificate or package-source redirect (65 named variables plus the LD_, DYLD_, GIT_CONFIG_ and GIT_SSL_ families, matched case-insensitively) raises a CRITICAL finding and is refused. A plaintext value under a name that carries a credential word is CRITICAL as well, and the scan recommends a vault reference instead. The same list is applied again when the configuration is assembled and when a session starts the server; the server then starts from the MCP SDK’s short base set (six variables on POSIX) plus the cleaned env.
  • Runtime Name Filter for Commands and Child Processes (env_isolation.py:build_isolated_child_env):
    • Before a shell, script, background job or browser starts, the host environment is filtered by name: a variable is dropped when its name contains one of 13 credential fragments (KEY, SECRET, TOKEN, PASSWORD, CREDENTIAL, AUTH_, _AUTH, AUTHORIZATION, AUTHENTICATION, BEARER, PRIVATE, SIGNATURE, PASS), is one of 54 named variables (credentials, cloud launch context, sockets and similar), or starts with one of six prefixes (LD_, DYLD_, GIT_SSL_, GIT_CONFIG_KEY_, GIT_CONFIG_VALUE_, OTEL_);
    • Developer identity preserved: a name containing AUTHOR (GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL) is kept unless it also carries TOKEN, KEY, SECRET, PASSWORD, PASS or AUTHORIZATION, so commits keep their author;
    • Tri-state inheritance policies: CORE starts from a short list of 88 safe names, ALL filters the whole environment by name, NONE passes nothing. The agent’s shell starts from CORE and adds the name-filtered host environment on top;
    • A secret a command needs travels with that one command (a credential you approve, or a skill setting) and is removed right after it; the shell does not keep it.
  • Limits: the filter works on names, not values. A secret whose name carries none of the fragments and is not one of the 54 (for example a database connection string named MONGODB_URI) reaches the command, and a harmless variable whose name does (for example TOKENIZERS_PARALLELISM) is dropped. There is no setting to widen or narrow it.
  • Zero Prompt Cache Impact: Pure framework runtime execution with 0 token consumption.

Tool Name Isolation

When multiple MCP servers are enabled, tool names can collide (e.g., both a GitHub and GitLab server expose search_repos). Myrm prefixes every MCP tool name with double-underscore delimiters:
  • Unambiguous parsing — Unlike single-underscore schemes, __ delimiters allow exact reverse parsing even when server names contain underscores
  • Permission isolation — Prefixed MCP tool names never collide with built-in tools, preventing accidental permission bypass
  • Audit traceability — Every tool invocation log entry identifies the originating MCP server

SSRF Prevention

DNS Pinning prevents agents from being tricked into accessing internal networks via HTTP redirects:
  • Unified outbound HTTP layer: All agent-initiated HTTP exits (web_fetch, HTTP tools, OpenAPI executor, skill ZIP install, media resolver, robots/sitemap fetch, channel media download, Feishu attachments) converge on secure_fetch / async_pin_url / async_vetted_addresses — one implementation, no bare httpx blind spots
  • Manual redirect loop: follow_redirects=False with per-hop re-validation — every redirect target is fully checked before following
  • DNS Pinning: Resolved IPs replace hostnames in HTTP connections, eliminating DNS rebinding TOCTOU attacks. The web_fetch HTTP tier keeps the host name in the URL and limits the connection to the addresses its check judged, so the certificate is still verified against the name and a failed connection is never retried by name; a request routed through a proxy is resolved by that proxy
  • Browser connection guard: In cloud deployments the browsers the platform launches itself connect only through a loopback proxy that resolves each host name once, requires every answer to be a public address, and dials only those addresses. The address that was judged is the address that is connected, so DNS rebinding, redirect hops, page subresources, WebSocket and script-started requests cannot reach an internal service, and the browser cannot send UDP around the proxy. A refused connection fails like any other failed connection and is written to the server log. The guard does not apply where the policy is switched off, where the environment routes HTTP traffic through a proxy that owns the policy, to browsers the platform does not launch itself (remote browsers, browsers attached over CDP, the user’s own browser through the extension), or in local mode, where private networks are allowed by design
  • Comprehensive IP blocklist: RFC1918 private, CGNAT, link-local, multicast, reserved, cloud metadata endpoints (AWS/GCP/Alibaba/Tencent), plus IPv4-mapped IPv6 detection
  • Data exfiltration detection: 6 pattern categories (API keys, file paths, base64, JWT, secret keys, DB connection strings) prevent sensitive data leaking through URL parameters
  • Domain HITL approval: With domainHitlEnabled on, a browser navigation to a site outside the allowlist asks for human approval first; web_fetch is checked against the blocklist only. Both lists are set globally and per agent in the UI, see Browser Automation
  • Parser-confusing character defense: URLs with a tab, newline or backslash, a percent-encoded host or a malformed authority are refused, and every other URL is judged and dialed in one canonical spelling (UTS 46, Punycode labels, numeric IPv4 as dotted decimal), so the policy and the HTTP client or browser always read the same host (CVE-class SSRF bypass prevention)
  • Internal hostname suffix blocking: .local, .svc, .cluster.local, .home.arpa suffixes are blocked to prevent mDNS and cluster-internal service access
  • Audit trail: Blocked requests emit SSRF_BLOCKED security decisions for SIEM and frontend audit views
  • Agent API scope: /v1/chat/completions runs Myrm agents only (no raw LLM passthrough). User-configured Provider apiUrl SSRF checks remain on in-agent LLM calls — deploy-mode-aware: local mode allows loopback hosts (Ollama/vLLM), cloud/sandbox mode blocks private networks and cloud metadata endpoints

Malicious URL Architectural Immunity

Instead of maintaining static phishing domain blocklists (e.g. 2.5M scam domains), Myrm eliminates threats at the architecture level:
  • SessionVault domain binding: Credentials (cookies/passwords) are strictly isolated per domain — bank.com login state is never sent to phishing domains like bank-secure-login.xyz, eliminating credential theft by design
  • Agent-level session isolation: Each configured agent gets its own physical SessionVault subdirectory — a “Work Assistant” and “Personal Assistant” accessing the same website maintain completely independent login states, preventing identity pollution across agents
  • Browser sandbox isolation: Agent browsers run in isolated sandboxes — even if a malicious site is visited, the user’s host system is unaffected
  • Site lists in the browser page layer: A blocked site is refused at the permission check, at browser navigation and download, and at every page request. With an allowlist set, three more layers confine the browser to it: a CSP policy for the document’s own connections, hardening of WebRTC, WebTransport and Service Worker registration, and a CDP audit that logs WebSocket targets without blocking them; the same hardening covers JavaScript the agent runs itself. This is a page-layer defense, not a security boundary: a page built to attack the hardening, a popup opened with an opener, a worker’s own WebSocket and Firefox-family engines are outside what it guarantees, and the network-level boundary is the connection guard described under SSRF Prevention (cloud deployments)
This architecture makes maintaining large phishing domain databases unnecessary — thousands of new domains appear daily, static lists become outdated rapidly, and consume 50-100MB memory.

Configuration Security Scan

Every MCP server configuration is scanned for 14 threat types before activation; the full list is under MCP Server Config Scanning. Findings are presented in the ScanConfirmDialog with severity badges. Users can trust, reject, or force-enable (at their own risk) each server.

Malicious Package Detection

When MCP tools install dependencies, the OSV (Open Source Vulnerability) API is consulted in real-time to detect known malicious packages.

Dynamic Tool Change Safety

When an MCP server adds or removes tools at runtime (via tools/list_changed notifications), Myrm ensures security without interrupting your workflow:
  • Automatic security vetting — Newly added tools are evaluated against the same 13-threat security scan applied at configuration time. If a tool fails the check, it is rejected and a warning is logged — no unsafe tool is ever silently activated
  • Prompt cache preservation — The agent’s prompt-facing tool list is frozen; dynamic changes only update the internal execution layer. This guarantees prompt prefix cache hits are never invalidated by external MCP server behavior
  • Zero user interruption — Myrm handles tool changes transparently. Users are never interrupted with confirmation dialogs for events they cannot meaningfully evaluate

Per-Agent Tool Filtering

Different agents can enable different MCP tools from the same server — a “Code Reviewer” agent sees only read-only tools, while a “DevOps” agent sees all. Tools whose server declares them destructive (destructiveHint) start switched off the first time you enable the server.

Built-in Tool Governance Gate

Every built-in tool must carry an explicit governance declaration before it ships — there is no implicit default. The harness enforces this with a registration-level CI gate that scans the real registered tool universe (core, common, extended layers plus server-vendor tools), not a hand-maintained allowlist:
  • Zero silent bypass — a newly added built-in tool with no permission mapping, no dynamic-resolution declaration, no auto-approval entry, and no explicit mcp_invoke fallback fails the build. It can never quietly fall back to an ambiguous runtime default.
  • Explicit three-state model — each tool is either explicitly auto-approved (read-only), explicitly mapped to a permission type (governed by the ruleset), or explicitly declared as an mcp_invoke fallback that keeps the ask-by-default baseline (high-risk tools such as browser_execute_script_tool).
  • Bidirectional consistency — declarations are cross-checked both ways: BUILTIN_TOOL_NAMES must be a subset of the registered universe (a declaration without an anchor fails), and permission-type whitelist entries must not be stale (now covered by DEFAULT_RULESET) or orphaned (no tool maps to them). The audit report can never contradict the code.
  • Dynamic-resolution SSOT — tools whose permission type is resolved per-action (browser interaction, desktop control) declare their dynamic branches from a single source of truth, and the gate consumes that source instead of a duplicated list.
  • Module-load safety gate — every built-in tool must declare safety metadata (read-only / destructive / concurrent-safe); a missing declaration is flagged at import time, not discovered in production.
The result: adding a new capability can never silently weaken governance, and the CI-reported coverage matrix is a truthful, machine-readable audit of what every tool is allowed to do.

Operation-Level Semantic Risk Detection

Instead of labeling entire websites as “high risk” (a brittle, high-maintenance approach), Myrm detects risk at the individual operation level — every click, form submit, and command is analyzed in real-time.

7-Category Semantic DOM Risk Detection

When the agent clicks a button or link on any webpage, the element’s text is analyzed against 7 risk categories in both English and Chinese: This approach is superior to domain-level risk tags because:
  • Zero maintenance: No need to maintain a list of “high-risk websites”
  • Universal coverage: Works on any website, including new ones
  • Granular: “View cart” on Amazon passes automatically, but “Place order” requires approval
  • No legal risk: No discrimination against specific platforms

Smart Intent Guard

An AI classifier (TranscriptClassifier) reviews tool calls to verify they align with the user’s original intent:
  • Reasoning-Blind: Only sees user messages + tool call sequences (not agent reasoning), preventing self-justification attacks
  • Deterministic: temperature=0 ensures identical inputs always produce identical verdicts
  • Structured output: Pydantic-enforced JSON with a reason field for audit traceability
  • Fail-safe: Errors or ambiguity fall back to HITL rather than auto-approving

Risk Governance System

A complete bidirectional risk detection and governance framework with built-in rules, custom rule management, and full-stack event handling. The same rule engine protects both WebUI input and IM channel inbound messages — no blind spots. 31 Built-in Rules across 6 categories detect sensitive data before it reaches the LLM. Only the 8 Security rules are enabled out of the box. They block a message when it carries an actual secret value — a key, token, private key, or a credential assigned a literal value — and let references such as password = os.environ["DB_PASSWORD"] or api_key: "<redacted>" through. The other 23 rules match broad vocabulary and are opt-in: turn them on under Settings → Security Policy → Risk Rules when your policy needs them. Installs that already saved their own toggles keep them. Rules only block: a hit stops the message before it reaches the model. Symmetric Inbound/Outbound Gate: IM channel messages pass through RiskDetectionService.detect() at the router level before reaching the Agent. Blocked messages receive a localized notification (English or Chinese) and are audit-logged. Outbound agent responses pass through the same engine via apply_outbound_risk_gate — forming a closed-loop defense. GUI Rule Management: Full CRUD via WebUI settings panel — create custom rules with regex patterns, toggle rules on/off, batch operations, and rule testing before deployment. No code required. Audit Trail: Every risk hit records trace_id, session_id, matched rule, severity level, and the character range of the match for compliance auditing. The matched text itself is never stored, so the hit log cannot leak the secret it caught; at startup, any hit text found in the log is cleared. Full-Stack Event Loop: When input risk is detected, the server emits a risk_blocked SSE event. The event lists the triggered rules by id, name, and severity. The frontend riskEvents handler intercepts it and shows a Toast in the user’s language that names those rules and points to Settings → Security Policy → Risk Rules — no silent failures.

Shell Command Security

Commands are analyzed through a 5-layer quote-aware pipeline before execution: Quote-aware preprocessing: A character-level state machine (_strip_quoted_content) replaces single-quoted content with placeholders before L2/L3 scanning, preventing false positives on echo 'rm -rf /' while still catching real threats in double-quoted or unquoted contexts. Privilege Escalation Floor: All sudo commands are unconditionally BLOCKED at L2 — including sudo apt install, sudo -S (stdin password piping), env sudo cmd, and bash -c 'sudo ...' (caught recursively by L4). This cannot be bypassed by YOLO mode, Smart Guard, or user approval. Auto-snapshot on destructive commands: Commands matching destructive patterns (rm, mv, git reset/clean/checkout/restore/apply with arbitrary flag prefixes, sed -i, redirect overwrite) trigger an automatic workspace snapshot before execution, ensuring full recovery regardless of outcome. SQL Guard (L2.5): Analyzes the original command (before quote stripping) to detect destructive SQL operations (DROP, DELETE, TRUNCATE, ALTER, INSERT, UPDATE, CREATE) embedded in database client commands. Defends against two advanced bypass vectors: multi-statement injection (SELECT 1; DROP TABLE) and WITH CTE wrapping (WITH x AS (...) DELETE FROM). Works with flag-based (psql -c '...') and pipe-based (echo '...' | psql) patterns. Safe Exec path: Simple commands without shell metacharacters are executed via create_subprocess_exec (no shell interpreter), structurally eliminating $IFS, glob expansion, and command substitution injection classes.

AI Trajectory Classifier (Layer 5.5)

When static analysis returns ASK (uncertain), an AI classifier provides semantic-level judgment:
  • Reasoning-Blind design: Only sees user messages and tool call sequences — never assistant reasoning or tool outputs, preventing the agent from rationalizing dangerous actions past the classifier
  • Structured output: Pydantic schema forces JSON format (not free-text), reducing injection surface
  • Deterministic: temperature=0, max_tokens=200 for reproducible decisions
  • Fail-safe: Any error, timeout, or parse failure returns UNCERTAIN → falls back to HITL approval
  • Context-aware: Receives taint labels (EXTERNAL_NETWORK, SECRET) and trusted domains for nuanced judgment

Bilingual Command Explanation

Every command that triggers approval displays a human-readable bilingual explanation (humanize_command) generated deterministically — zero LLM calls, microsecond latency:
  • 73 common commands covered with parameter-aware descriptions (extracts URLs, filenames, package names)
  • sudo prefix auto-tagged, dangerous pipe patterns highlighted
  • Users understand what the command does before approving, even without shell expertise
  • Entirely rule-based: cannot be manipulated via prompt injection unlike LLM-based alternatives
Frontend humanize SSOT — Beyond harness humanize_command for shell, the WebUI module lib/humanize/ generates the same plain-language dialect for ProgressSteps titles and all three approval surfaces (Single / Polymorphic / ToolCall). Scope hints (local vs external channel) use resolveScopeNote + ApprovalScopeNoteLine in English and Chinese. Save-skill approvals show a structured preview before you approve.

Install Slopcheck (Anti-Slopsquatting)

Before every pip install / npm install / yarn add / bun add command, a preflight check verifies that each package name actually exists on the public registry: This prevents slopsquatting attacks — where an attacker registers a package name that LLMs commonly hallucinate, embedding malware in the published package.

Encryption & Enterprise Network Compatibility

Enterprise TLS Compatibility

Corporate networks often deploy TLS inspection proxies (Zscaler, Netskope, Palo Alto Prisma) that can cause all HTTPS connections to fail. Myrm provides one-click enterprise network compatibility:
  • Settings → Preferences → Advanced Settings → Enterprise Network Compatibility, or set MYRM_TLS_STRICT=0; the change takes effect after the app restarts
  • Precision relaxation: certificate chains are validated against the operating system’s trust store (where administrators push the inspection root) plus any CA bundle named by SSL_CERT_FILE, REQUESTS_CA_BUNDLE or NODE_EXTRA_CA_CERTS (added to it, never replacing it; the connection to a remote MCP server reads SSL_CERT_FILE only), and only Python 3.13+‘s VERIFY_X509_STRICT flag is cleared — chain, hostname and expiry checks stay on, so it does NOT disable certificate verification
  • Covers the chat-model transport, the S3 remote backup, the Email channel’s IMAP and SMTP connections and the Python HTTP clients the agent uses (httpx, aiohttp, requests, urllib); MCP servers built on Node.js (for example those started through npx), the WhatsApp channel’s bridge and its dependency install, the install step of external CLI agents and the agents’ own processes are told to use the system trust store as well (Node 22.19+ and 24.6+ understand the hint; an older Node ignores it)
  • The bundled email skill (imap-smtp-email) runs its script in a separate process that this setting does not reach. The script verifies the mail server’s certificate against Python’s default CA bundle (on macOS a file, not the system keychain) and honours SSL_CERT_FILE only. There SSL_CERT_FILE replaces the default bundle instead of adding to it, so the file must also contain every public CA the script still has to trust; set it in the environment the agent server runs in. A rejected certificate is reported with this hint and is never skipped
  • Per-MCP-server TLS: each MCP server can specify its own ssl_verify (true/false/custom CA path) and client_cert/client_key/client_key_password for full mTLS
  • How the setting reaches each client: the infra module tls_compat.py installs the trust policy when the app starts, and the server’s tls_config.py carries the Preferences switch over to MYRM_TLS_STRICT. The policy applies where a client takes its TLS context: ssl.create_default_context() (httpx, urllib, asyncio, and the Email channel) and the context builders of requests and aiohttp, so none of these needs a switch of its own; the S3 remote backup, whose client library builds its own context, reads the setting directly
  • Automatic TLS error diagnosis: tells a rejected certificate chain from an interrupted handshake, with remediation hints in English and Chinese
  • TLS-specific test coverage: the TLS compatibility core, per-MCP-server TLS (live integration) and TLS error diagnosis

Browser Certificate Checks

The agent’s browser tool verifies certificates by default. A page whose certificate the browser refuses (self-signed, expired, issued for another host name, or signed by a root the browser does not trust) fails to load with a certificate error, and the agent is told to report it as a certificate problem of the site instead of looking for a way around the check.
  • Operator opt-out: set MYRM_BROWSER_IGNORE_HTTPS_ERRORS=true (1 and yes also work) in the environment the agent server starts in to let the browser tool open such pages, for example an internal site on a network you trust. It is off by default
  • Not covered: the user’s own browser reached through the extension keeps its own certificate checks whatever this variable says, and the Enterprise Network Compatibility setting above does not change the browser’s certificate checks

Incognito Mode Deep Dive

One click in the message input area switches incognito on or off, and either way it starts a new chat: incognito is a property of the chat itself, and the server decides what to delete and what to export from that chat’s is_incognito flag, so a conversation that already exists can never become one. Expect the current conversation to be left behind and the composer to open empty.
  • Event log: no per-session event log is written, so prompts and tool results are not copied to disk outside the chat database
  • Server layer: Skips memory manager binding and all memory tools (memory_search_tool, memory_save, memory_manage), disables memory context injection, archive checkpoints, and session cleanup callbacks
  • Uploads follow the chat: files attached in an incognito chat are bound to it, removed with it, kept out of exports and backups, and hidden from other chats’ @ suggestions
  • Database layer: the is_incognito flag keeps the session out of the sidebar, full-text search, session recall, the Catchup Inbox and the memory export, and no title or message preview is stored; the messages stay in the local database until the session has been idle for an hour, then the session is permanently deleted with its attachments
  • Self-hosted: chats are stored on your own deployment rather than on a vendor server; the model provider you configure still processes what each turn sends, incognito or not

Credential Protection

Form Credential Vault

Passwords and TOTP seeds never enter the LLM context. You configure labeled credentials in Settings → Credentials; the agent only sees label names (e.g. github-personal) and calls fill_credential (browser and desktop use the same action). The Harness resolves the label in memory and injects at the DOM or OS input layer — plaintext never flows back into chat, tool args, or logs. Provider API keys (OpenAI, Anthropic, Gemini, etc.) are passed with each model call as its api_key — zero os.environ writes. Combined with process-level sandbox isolation, this architecturally eliminates cross-user credential leakage.
Payment-card CVV has no dedicated use_payment_method API yet (unlike FSB’s browser extension). Password-type fields are covered; card checkout may need manual approval or future API.

Zero-Plaintext External Secrets Vault & Dynamic Rotation (1Password & Bitwarden)

For enterprise environments requiring centralized secret management without exposing sensitive credentials to disk or developer machines, Myrm provides native integration with enterprise password managers:
  1. Native Secret URI Resolution:
    • Supports op://<vault>/<item>/<field> (1Password CLI / Connect API), bw://<item-id> (Bitwarden CLI), and bws://<secret-id> (Bitwarden Secrets Manager).
    • Database records store only reference URIs — zero plaintext secrets ever touch persistent disks.
  2. Single-Flight Dogpile Prevention (_FlightCall):
    • High-concurrency agent workflows resolving the same credential concurrently are coalesced into a single resolution call, completely eliminating CLI process storms and locking deadlocks.
  3. In-Memory TTL Caching & 401 Dynamic Rotation:
    • Resolved credentials are kept strictly in-memory with a configurable 600s TTL.
    • Upon encountering HTTP 401/403 authorization failures during API calls, the gateway instantly invalidates cached tokens and transparently re-resolves the rotated secret, guaranteeing uninterrupted long-running task autonomy.
  4. Non-Interactive Execution Isolation (_build_noninteractive_env):
    • Resolvers strip all interactive prompts, desktop notifications, and GUI popups, enforcing deterministic non-blocking execution in headless backend and CI/CD environments.
  5. Command-Scoped Delivery:
    • A resolved secret reaches a sandbox command only through that command’s environment and is removed when the command ends; the shell itself starts with no credentials. Commands of one conversation share that shell. On macOS and Linux each command runs as a child process of it, so a command cannot plant a trap, function or alias there to read what a later command is given; on Windows a command runs inside the shell itself, so this limits what is delivered and does not contain a command that deliberately tampers with the shell (for example by installing a trap).

Leak Detection

40+ regex patterns detect credentials in agent output:
  • API keys (OpenAI, Anthropic, AWS, GCP, Azure, etc.)
  • Database connection strings
  • JWT tokens and session IDs
  • SSH private keys
  • Entropy-based detection for unknown credential formats

PII Redaction & Privacy-Aware Routing

Myrm provides 8-layer PII defense with 57+ detection capabilities: Detection (3 engines, 57+ types):
  • Regex PII Scanner: 12+ structured types (phone, ID card, passport, bank card with Luhn validation, SSN, email, address, courier number, private IP, etc.)
  • LLM Semantic Scanner: 20+ non-structured types (medical health, political views, financial records, precise locations, biometrics) with PL2/PL3/PL4 classification
  • Credential Leak Scanner: 25+ secret patterns (AWS, OpenAI, Anthropic, GitHub, Slack, JWT, PEM keys, etc.) with Shannon entropy analysis
Protection (4 user-selectable modes): Privacy-Aware Model Routing: With a local model configured, requests are routed by sensitivity level — S1 to cloud, S2 to cloud (with the S2 action above applied) or local, S3 to the local model (the raw data never leaves the machine). Without a local model, routing is off: every request goes to the cloud with the S2/S3 actions already applied. Configurable fallback: block or force-redact-then-cloud. GUI Configuration: Full privacy controls in Settings — enable/disable toggle, per-level action selection, deep scan toggle, local model connection test, custom keywords/regex/sensitive tools, and a try-it box that shows what the model would receive for a sample sentence under the current settings.

Data Flow & Privacy Disclosure (Settings)

Settings → Security Policy → Data Flow & Privacy Disclosure gives a live, configuration-driven map of where your data goes — not a static vendor subprocessors page: Provider training policies link to official docs where available. Cross-border routing hints appear when Privacy Routing is enabled with cloud egress. Why it matters: The panel reflects your enabled MCP tools and connectors instead of a static data-usage page, and it updates from your live configuration (including SSE refresh when channels reconnect on desktop).

Summary Path Protection

When long conversations are compressed into structured summaries, PII and credentials can survive the summarization process. Myrm applies dual redaction (redact_leaks + redact_pii) to all summary fields before persistence — ensuring phone numbers, emails, API keys, and other sensitive data never persist in compressed conversation history.

Taint Tracking

TaintTracker follows the information flow of sensitive data through the agent’s execution, ensuring PII doesn’t leak through indirect channels (e.g., a tool reading a file containing credentials, then using that data in a web request).

Agent Export & Import Security

Export. An agent leaves your machine as an Agent Plugins package after one reviewed redaction pass. The pass covers everything a recipient can read — system prompt, description, starter prompts, workspace templates and every shipped skill file. Each finding (API key, token, home-directory path) is shown and either redacted or explicitly kept by you; the export waits for every decision, and a decision made against an outdated preview is refused. Import. A package from outside is untrusted input:
  • Every skill goes through the full install pipeline and a whole-file security scan; a skill with a clean SKILL.md but a malicious script is rejected and leaves nothing behind.
  • Agents can only narrow their own permissions, and a package never carries security policy: security_overrides, default_security_preset and other machine-local fields are dropped on import. Tool grants are limited to the default set and the loop budget cannot exceed the system default.
  • MCP servers are imported disabled; you enter the keys yourself, they are never read from the package.

Privacy-safe Rule Sharing

When sharing procedural memory rules (e.g., with teammates or the community), additional privacy layers are applied automatically:
  • Path anonymization — user home directory paths are replaced with <USER> placeholders
  • Credential redaction — API keys and secrets are truncated to safe prefixes (e.g., sk-pro...f456)
  • Metadata stripping — timestamps, update counts, and internal IDs are removed from exported rules
This ensures no personally identifiable file paths or credentials can leak through shared rules. See Memory System → Privacy-safe Rule Sharing for full details.

Password-Protected Sharing

Artifact and conversation share links support optional password protection with a stateless, zero-database design: Password protection is fully optional. Links created without a password work exactly as before, with no UX changes or performance overhead.

Revoke anywhere, instantly — and it stays revoked

Share links are revocable at any time, for both artifacts and conversations: The web UI share dialog shows the live status (link URL, remaining expiry, revoke button) every time you open it — matching the ChatGPT/Notion share-dialog baseline — and stays open showing a “revoked” state after you revoke, so the control is never unreachable.
A Myrm conversation link is time-limited, can be password-protected, is revoked per link, and shows only the user and assistant text.

Agent Secret Management — Zero Plaintext Exposure

Per-agent secrets (custom API keys, tokens, environment variables) use a zero-plaintext-exposure architecture:

Audit Trail

Structured Audit Trail

Every security decision is recorded in a structured audit log with Prometheus real-time metrics:
  • Typed security decisions (ALLOW, DENY, ASK, SSRF_BLOCKED, PII_REDACTED, TAINT_ESCALATE, etc.)
  • Prometheus policy_denial_total counter for real-time anomaly detection
  • Session-scoped accumulator with TaintTracker cross-tool information-flow tracking
  • Cron job metadata automatically embeds the full security audit for post-run analysis

Event Types

Structured decision types cover the complete security lifecycle, including:
  • USER_APPROVED / USER_EDITED / USER_REJECTED / USER_DENIED
  • TIMEOUT_APPROVED / TIMEOUT_DENIED
  • LLM_REVIEW_ALLOW / LLM_REVIEW_DENY / LLM_REVIEW_UNCERTAIN
  • OUTBOUND_ALLOW / OUTBOUND_DENY
  • SHELL_ESCALATION_ALLOW / SHELL_ESCALATION_DENY
  • LOOP_WARN / LOOP_BREAK

Profile Audit Engine

The Profile Audit Engine provides real-time configuration risk assessment for every Agent profile. When you open the Security tab in Agent settings, a Health Score Card instantly shows your agent’s security posture:
  • Score: 0–100 (higher = safer), deducted per finding severity
  • Risk Level: Safe / Low / Medium / High / Critical (5-level color-coded)
  • 6-Dimension Grouped View: Findings grouped by checker dimension with per-dimension color coding — expand any dimension to see individual findings with severity borders, titles, and actionable recommendations
  • One-Click Fix: Policy gap findings include Fix (toggle switch) or Configure (navigate to settings section) buttons for immediate remediation

Six Detection Dimensions

Each dimension shows issue count or “Pass” status. Dimensions with issues can be expanded to reveal individual findings.

Design

  • Zero LLM: Pure deterministic rule engine — no token cost, instant response
  • Plugin architecture: Each checker implements BaseChecker and can be extended independently
  • Auto-refresh: Results update automatically when you save Agent configuration changes
  • Framework-level: Available to any project using the harness engine, not just the product UI

Workspace Rules Security

Myrm automatically discovers and loads project-level rule files from 18 discovery points (13 root-level filenames + 5 subdirectory patterns), covering all major AI tool ecosystems:
  • Root files: 13 root-level filenames read in priority order; the full list is in the Memory System page (③ Project Rules)
  • Subdirectories: .myrm/rules/*.md, .cursor/rules/*.mdc, .trae/rules/*.md (always read in addition); .claude/CLAUDE.md, .github/copilot-instructions.md (fallbacks, used only when a directory has no non-empty root file)
  • First-Match-Wins: Only the highest-priority root file loads per directory, preventing conflicts
  • Zero-config migration: Users from Hermes (SOUL.md), Cline (.clinerules), Cursor (.cursorrules), Claude Code (CLAUDE.md), Windsurf (.windsurfrules) can bring their rule files unchanged
All discovered files are security-scanned before injection:
  • 14 injection categories (10 English, 4 Chinese), checked by the same input guard as user messages
  • Anti-obfuscation: Leet speak, invisible Unicode, whitespace folding
  • Chinese injection detection: Supports CJK character-based prompt injection
  • Blocked content is replaced with a [BLOCKED] placeholder with structured metadata

Emergency Controls

Security Dashboard

A dedicated /security page provides full GUI visibility into the system’s security posture — no CLI commands needed: Additional capabilities:
  • Setup Panel: Guided configuration of webhooks, monitored repos, and GitHub tokens
  • Multi-source: Pulls data from GitHub, Control Plane, or merged sources based on deployment mode
  • One-click refresh: Real-time data reload per tab
  • Export: Audit logs exportable in CSV or JSON format for SIEM integration
This GUI-first approach gives users the same information with visual analytics and no terminal expertise required.

Smart Approval (Auto Mode)

Smart Intent Guard is enabled by default for all new users. An auxiliary LLM (Transcript Classifier) reviews tool calls in real-time, enabling long unattended agent sessions without sacrificing safety. If no dedicated reviewer model is configured, Myrm automatically uses the user’s default model as a fallback — no additional setup required to benefit from intelligent approval. Fail-safe guarantees:
  • Classifier errors → fall back to HITL (never auto-approve on failure)
  • Payment-like tool calls and irreversible outbound actions (channel notifications, publishing, git push) never reach the classifier: in a chat you are watching, they always wait for you
  • temperature=0 for deterministic, reproducible decisions
  • Pydantic-enforced structured output (no free-text manipulation)
  • Taint labels injected for context-aware judgment

Smart DENY → User Override (Once)

When the Transcript Classifier recommends DENY, Myrm does not silently reject the action. Instead, it shows a clear approval card: This prevents “false positive lockout” where the AI reviewer misclassifies a legitimate action, while maintaining full audit visibility.

High-Risk Scenario: Always Allow Hidden

In 6 high-risk scenarios, the “Always Allow” button is automatically hidden from the approval card — users can only approve once or reject. This prevents accidental permanent bypass of security checks for dangerous operations: Normal, low-risk approvals still show “Always Allow” as usual. Users experience zero friction change for safe operations. Myrm hides permanent allow in 6 trigger scenarios.

Command Denylist (User-Defined Hard Floor)

Users can define glob patterns that permanently block specific commands — regardless of YOLO mode, Smart Intent Guard decisions, or permission rules. This provides a user-controlled safety net that cannot be bypassed by any approval mechanism. The command denylist operates at Layer 2a.5 in the approval pipeline — after permission rules but before YOLO bypass, ensuring denied commands are always blocked. The Natural Language Policy Generator can also produce command denylist and network blocklist rules from plain language descriptions (e.g., “block all force push and database drop commands”) — the generated patterns are validated, previewed with human-readable explanations, and applied only after user confirmation.

Memory Write Trust Isolation

All memory writes pass through a unified security pipeline — even those triggered internally by the AI:

Security Profiles: One-Click Safety Modes

MyRM provides three built-in security profiles that users can switch between from the Settings UI: Profiles are persisted to the database and survive server restarts. Each Agent can also have its own independent security configuration — enabling scenarios like a “research-only analyst” agent alongside a “full-access developer” agent.

Cron Job Execution Policy (Per-Job Least Privilege)

Scheduled Agent jobs support a dual-layer policy independent of the bound Agent profile: Where to edit: Settings → Scheduled Tasks → open a job → Execution policy editor in run history (same placement pattern as allowed filesystem roots). New jobs start with an empty capability fence and an unrestricted tool scope, unless a blueprint fills them in. Built-in safeguards:
  • Fail-closed by default — jobs without explicit capability declarations deny dangerous operations (shell, code execution, MCP) automatically. YOLO mode does not change that for a scheduled run: nobody watches it, so only the job’s own declaration can approve a step. Payment-like calls, Google Workspace write commands, web requests (fetches, browser tools, curl or wget style commands) after a credential file was read, and paths outside the job’s directories stay refused even when the job declared the capability, and even when an “Always Allow” entry or Smart Intent Guard would allow them. A fetch or browser navigation whose every address is on the URL Domain Allowlist does not count as sending data out; browser snapshot and extract steps and shell commands get no such exemption. Detection is pattern-based: other ways of sending data out, such as other commands or scripts the job runs, are not recognized.
  • Preset packs (web-only / research / devops) dual-write capability fence + tool scope, aligned with blueprint SSOT.
  • Read-it-Later blueprint uses router mode (__wiki_source_sync__) with empty tools — deterministic server-side pull, zero LLM agent turns, no browser or code execution.
  • Lifecycle guard rejects cron prompts/commands/pre-flight probe scripts/shell acceptance criteria containing Myrm restart/stop or pkill myrm-agent patterns — prevents self-inflicted outage loops.
  • Restricted jobs do not silently gain baseline tools — a file-only cron will not auto-enable code_execute; unrestricted jobs still inherit the Agent baseline.
Myrm provides per-job granular capability declarations with GUI editing, blueprint auto-fill, and fail-closed defaults.

Subagent Recursive Isolation: 5-Layer Defense

When agents delegate tasks to subagents, a common failure mode is uncontrolled recursive spawning — subagents spawning more subagents until token budgets are exhausted. MyRM enforces 5 layers of isolation: Additional safety nets: payload hash deduplication prevents delegation loops, result caching avoids redundant work, and sub-agents get no memory write tools and only a read-only memory view, which prevents cross-agent data contamination.

Multi-Agent File Protection: 5-Layer Defense

When multiple agents work in the same workspace simultaneously, file conflicts are the #1 source of data corruption. MyRM enforces 5 layers of defense — all code-enforced, zero Prompt reliance: How it works in practice:
  1. A parent agent delegates 3 coding tasks to parallel subagents
  2. All three work in the same workspace — no copies, no merge step
  3. Before each write, file_activity_tracker is checked for another agent’s recent edits to the same file
  4. If the line ranges overlap, file_conflict_guard blocks the write; an edit to another region of the same file only produces a warning
  5. When a subagent finishes, subagent_manager clears its tracking records

Skill Quarantine Sandbox & Atomic Installation

To guard against malicious third-party packages and partial installation failures, Myrm’s execution harness integrates a quarantine and atomic installation pipeline:
  1. Quarantine Sandbox Directory: Remote skills (Git or ZIP) are extracted and staged in an isolated temporary directory before touching the active workspace.
  2. Path Traversal Containment: All relative paths inside skill packages are sanitized against the sandbox boundary, blocking Zip Slip and relative directory escape attempts.
  3. Pre-Activation Security Gate: Regex, AST, and LLM semantic security checks run entirely inside the quarantine directory. Rejected packages are purged without touching disk storage.
  4. Atomic Replace with Automatic Rollback: Installations and upgrades create a .bak backup and perform an atomic swap. File system IO errors trigger an instant rollback to the previous version.
  5. Fault-Tolerant Multi-Source Search: Aggregated skill registry queries run with per-source timeouts and fault isolation, preventing slow or failing registries from hanging the discovery UI.

Anti-Contamination & Canary Protection Gate

To ensure evaluation integrity and prevent benchmark dataset contamination:
  1. Dynamic Canary Token & GUID Dual-Track Protection: Automatically detects and injects benchmark Canary watermarks (CANARY_GUID and dataset-specific canary_token).
  2. In-Episode Outbound Search Sanitization: Intercepts and scrubs Canary watermarks in outbound search/fetch queries in real time, preventing benchmark prompt leaks to external search engines and training corpora.
  3. Pre-Run Workspace Cleanliness Verification: Recursively scans agent workspaces prior to evaluation turns to ensure ground-truth patches and hidden verification files are physically excluded from live environments.
  4. Trajectory Anti-Cheating & Secret Probing Defense: Scans agent tool execution trajectories for attempts to probe hidden verification paths (/hidden_tests/, verifier.toml) or dump shell environment variables/secrets (printenv, export, /proc/*/environ). Violations trigger an immediate FAIL with structured diagnostic reports.
  5. End-to-End Visual Violation Transparency: Surfaced directly in the WebUI with Canary verification status and detailed violation diagnostic cards.

Channel & Operator Scoped Memory ACL (Anti-Poisoning & Anti-Leakage Gate)

When external multi-user channels (Feishu, WeCom, Telegram, Discord, Slack) interact with agents:
  1. Write-Plane Poisoning Prevention (allow_shared_write=False): Tool-layer physical intercept automatically downgrades any attempt to write to shared global memory into bound (current session scope), preventing untrusted channel participants from poisoning organizational shared knowledge.
  2. Read-Plane Recall Isolation (default_scope="same_source"): Server-side conversation provider forcibly locks conversation history searches to the same source channel, blocking malicious prompt injection attacks from cross-recalling private WebUI conversations, credentials, or personal workflows.
  3. Zero Prompt Token Overhead & Prompt Cache Preservation: Enforced entirely at the runtime execution layer with static tool descriptions, so the prompt-cache prefix is untouched.

Agentic Code Security Scan (Verify-then-Report Skill)

Myrm ships a prebuilt security-diff-scan skill that runs an autonomous agentic vulnerability scan on diffs and codebases:
  1. Verify-then-Report Dynamic PoC Validation: To avoid flooding developers with false positives, the skill requires a minimal Proof-of-Concept (PoC) exploit to run in the sandbox before a Critical or High finding is reported. Candidates whose exploit fails are discarded or downgraded to informational, eliminating alert fatigue.
  2. AST Incremental Slicing: Slices diff contexts to under 300 lines to maximize prompt cache hit rates.

Control UI Surface Error Redaction

To prevent sensitive credential leakage during screen-recording demos, screenshot troubleshooting, or console error returns:
  1. Dual-Tier UI & API Filtering: The frontend errorRedactor.ts intercepts all toast.error, toast.warning, and API Client error pipelines, automatically masking high-entropy API keys, Bearer/JWT tokens, and database URI passwords.
  2. Local Path Normalization: Replaces sensitive local developer paths (e.g., /Users/username/... or /home/username/...) with ~/..., preventing internal user directory disclosure.
  3. Server-Side Serialization Safety Net: FastAPI global exception handlers (errors.py) sanitize error messages and details before dispatching JSON responses to clients.

Approved Scripts TOCTOU Drift Guard

To defend against Time-of-Check to Time-of-Use (TOCTOU, CVE-2026-32921) attacks:
  1. Evaluation Snapshot Locking: When a user approves an external script command (e.g., python script.py), the Harness extracts the script operand and records its SHA-256 content hash snapshot during the security evaluation phase.
  2. Execution-Boundary Revalidation: At the execution boundary (apply_approval_decisions), the file’s current SHA-256 hash is recomputed. If the script was modified, overwritten, or symlink-swapped while awaiting user approval, it triggers SCRIPT_OPERAND_DRIFT_REJECT and halts immediately.
  3. Hide Allow Always: Commands involving dynamic external script operands automatically suppress the “Always Allow” option, blocking malicious attackers from leveraging existing allowlists to run unreviewed code.

Frontend Chart SVG Strict Sanitization (Mermaid Preview)

To prevent Stored XSS attacks via model-generated or untrusted Mermaid diagrams:
  1. Strict Engine Configuration: Forces Mermaid rendering configuration to securityLevel: 'strict' and htmlLabels: false, disabling inner HTML script execution vectors.
  2. Recursive DOMParser Attribute Sanitization: Recursively inspects the rendered SVG DOM tree using sanitizeMermaidSvg, stripping dangerous tags (<script>, <foreignObject>, <iframe>, <object>).
  3. Neutralized Inline Events and Pseudo-Protocols: Strips all case-insensitive on* inline event listeners and purges href / xlink:href attributes containing pseudo-protocols, ensuring complete immunity against Stored XSS across chat bubbles and fullscreen modal views.

Plugin Packaging Integrity Guard

To prevent catastrophic runtime crashes caused by unbuilt or missing build artifacts in third-party plugin packages:
  1. Static Ingestion Verification: Statically verifies referenced local build artifacts and entrypoint scripts (node dist/index.js, python server.py, ./bin/server) at archive ingest time against the package files.
  2. Component-Level Localized Fault Isolation: Automatically skips broken MCP servers while allowing functional Skills and Agents to install smoothly, preventing a single unbuilt component from halting the entire import workflow.
  3. Adaptive Flag Stripping and Normalization: Strips interpreter flags (-u, --loader), normalizes Windows backslashes and ${PLUGIN_ROOT} macros, and detects bare relative entrypoint arguments (args: ["dist/index.js"]).
  4. GUI Hardening and Accidental Install Protection: Surfaces clear warning badges with actionable build instructions (e.g., npm run build), defaults broken servers to skip, and protects against accidental bulk installs.

Child Process Credential Token Isolation

To prevent untrusted scripts and child processes from exfiltrating sensitive tokens from the host environment:
  1. Tri-State Inheritance Policies (SSOT):
    • CORE: A short list of 88 safe names (for example PATH, HOME, USER, locale, proxy settings and the Git author and committer identity); everything else is dropped, and the credential filter still applies to what remains.
    • ALL: The whole environment minus the credential filter (13 name fragments, 54 named variables and 6 prefixes).
    • NONE: Complete environment isolation with zero inherited variables.
  2. Execution Surface Coverage: Applied across persistent shell sessions, Python subprocesses, background jobs, browser launches, hooks, tunnels, scheduled-job conditions and delegated CLIs. Delegated CLIs, hooks, tunnels and scheduled-job conditions start from CORE; Python subprocesses, background jobs and browser launches use the ALL filter; the agent’s shell starts from CORE and adds the name-filtered host environment on top.
  3. Toolchain-Safe Credential Matching: A name containing AUTHOR (GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL) is not mistaken for an authentication name unless it also carries TOKEN, KEY, SECRET, PASSWORD, PASS or AUTHORIZATION; committer names carry no credential fragment and pass as they are, so Git commits keep working. The match is by name, so it is a filter, not a boundary: a harmless variable such as TOKENIZERS_PARALLELISM is dropped and a secret whose name carries no credential fragment is not.

Zero-Key Subprocess Sanitization vs MITM Proxy

To avoid the TLS disruption and performance degradation that self-signed MITM proxies cause:
  1. Name-Based Sanitization at Spawn Time: The child environment is built with credential-named variables already removed (see Child Process Credential Token Isolation above), so printenv in a subprocess does not list API keys, tokens or passwords under their usual names. The filter works on names: a secret stored under a name it does not recognise, such as a database connection string named MONGODB_URI, still reaches the process.
  2. In-Memory Controlled LLM Invocation: Agent core inference connections are established directly within the runtime memory without proxy overhead, eliminating CERTIFICATE_VERIFY_FAILED errors.
  3. Dedicated Agent-in-Sandbox Isolation: Leverages dedicated volume isolation and containerization, providing true multi-tenant physical boundaries with zero configuration friction.

Deterministic Execution-Defense vs Jailbreak Red-Teaming

To counter adversarial prompt injection and multi-turn jailbreak attempts (e.g., PAIR, Many-Shot):
  1. Untrusted Data Envelope: Wraps external content (web search and fetch results, browser page content, MCP results, knowledge-base results) and the main paths of shell and file output in a text envelope with a random id, and a system prompt rule tells the model not to follow instructions found inside. A few branches are returned without it (the exit list in the harness SECURITY_WRAPPER_GUIDE.md names them). This lowers indirect-injection risk; it is not a hard boundary.
  2. Non-Bypassable Layer 1–5 Onion Physical Guard: Bypasses fragile, slow, and evadable external LLM evaluators by enforcing fail-closed physical barriers at the system call boundary. Even if a model is semantically jailbroken, destructive operations and credential exfiltration are physically halted before OS execution.
  3. Causal Audit Trail: Tracks all tool calls, approval decisions, and blocks, fulfilling enterprise compliance and auditability requirements out of the box.

Kernel-Level Sandbox & Supply Chain Defense (Bubblewrap / Seatbelt & Google OSV)

To counter malicious third-party packages and eliminate sandbox escape risks without heavy brittle CLI interceptors:
  1. Agent-in-Sandbox Kernel Isolation (Linux Bubblewrap & macOS Seatbelt): All code execution runs in dedicated kernel-level namespaces (--unshare-user, --unshare-pid, --unshare-net). Root filesystem is mounted read-only (--ro-bind /usr), and host credentials (~/.ssh, ~/.aws) are physically unmapped (ENOENT).
  2. Default-Deny Network Boundary: Sandbox code execution is strictly network-isolated (--unshare-net) by default. Malicious CVE payloads cannot reverse-shell or exfiltrate local data.
  3. Runtime Supply Chain Health Probe: The system health snapshot audits every Python package installed in the runtime against an offline known-compromised package catalog (security_advisories.py) and Google OSV.dev batch queries (osv_scanner.py); a malicious or compromised package fails the check as critical. Skill installs separately audit package lifecycle scripts (package_audit.py).

Enterprise Outbound Proxy & Loopback Exemption

To ensure seamless, secure outbound connectivity across complex corporate firewall and TLS-inspection environments:
  1. Native Asynchronous Network Stack (httpx): Fully inherits system HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY without fragile Node.js-style global dispatcher patches.
  2. Mandatory Loopback Exemption (Anti-Deadlock Invariant): Automatically injects localhost, 127.0.0.1, and ::1 into bypass rules, completely preventing local UI, WebSocket, and IPC traffic from routing into external proxies.
  3. Enterprise TLS Inspection Compatibility (tls_compat.py): Trusts the operating system’s certificate store plus the CA bundles you name and relaxes only VERIFY_X509_STRICT for corporate proxies, without disabling certificate chain verification, eliminating SSL handshake errors across the agent’s Python HTTP clients.
  4. Child Process Proxy Credential Scrubbing: Strips embedded basic-auth proxy passwords before passing environments to untrusted workers, defeating credential extraction attacks.

Protected Instructions & Anti-Persistence Injection Shield

To guard against persistent backdoors planted through indirect prompt injection that tries to tamper with system steering files:
  1. Protected Instruction Hardening: Core steering assets including AGENTS.md, SOUL.md, CLAUDE.md, and .cursorrules are registered under protected path defense (path_security.py). Any write to them through the file tools forfeits “Allow Always” exemptions and raises an approval request that only you can answer: YOLO Mode and Smart Intent Guard do not release it, and when the approval expires it is denied even if the Timeout Action setting is “Allow”. File-tool writes to a repository’s git hooks and config (.git/hooks, .git/config) are held the same way, because they decide what your next git commit runs.
  2. Shell Redirect Escalation: The shell executor (shell_command_analyzer.py) reads a command line command by command. Redirects and write commands that name one of these files (echo > AGENTS.md, sed -i, tee) escalate to the same approval request, which “Allow Always”, YOLO Mode and Smart Intent Guard cannot release. The check reads the command text, so it is not a boundary against deliberate evasion: code that the bash tool runs as Python is not judged, and a write form the analyzer does not recognize is an ordinary request that YOLO Mode releases. Shell commands are not read for writes to git hooks or config either. The OS sandbox does not stand in for the check: where it is active (Linux Bubblewrap and macOS Seatbelt; it is off in container deployments, and Windows does not enforce this yet), it keeps only the repository’s git metadata (.git/config, .git/hooks) read-only inside the workspace, and no instruction file.
  3. Zero-Disk OS Keychain Custody of the Vault Master Key, AES-256-GCM Ciphertext for Saved Keys: The agent vault’s master key is delegated to the OS keyring (macOS Keychain, Linux SecretService, Windows Credential Manager). Keys saved in settings (model providers, search, MCP, channel credentials, the local-model key) are stored in SQLite only as AES-256-GCM ciphertext; their encryption key comes from an environment variable or a mode-0600 .encryption_key file in the state directory, not from the OS keychain, so a copy of the database without that file does not expose them.

Multi-Channel DM Session Enclave & Anti-Poisoning Gate

To keep different people’s conversations apart, stop open-mode strangers from inheriting owner privileges, and limit what untrusted senders can leave in long-term memory when agents are reached through external messaging channels (Feishu, WeChat, Telegram, Slack, etc.):
  1. Per-Conversation Session Keys (SessionKey): Each conversation is stored under a key built from the channel, the conversation type (direct message or group), the peer and, when present, the thread and the agent. Direct messages are keyed by sender and groups by chat, so different direct-message senders, channels, threads and agent personas keep separate histories, while the members of a group chat (or of one thread in it) share a single conversation;
  2. Stranger Privilege Escalation Defense Gate (Anti-Privilege Escalation Gate): Under the OPEN policy an unpaired sender does not inherit default_user_id (the owner identity); it is assigned an isolated guest identity (guest_{channel}_{sender_id}), and the untrusted ingress fence denies that identity’s runs the shell, file-write, memory-write, desktop-control, sub-agent, cron and skill-management tools when the model calls them;
  3. Long-Term Memory Anti-Poisoning Fence (Anti-Poisoning Fence): Turns from guests, unpaired senders and non-admin members, like turns in group chats, run in a memory compartment: their recall is confined to it and never reaches the owner’s private memory, and background memory extraction is off for them. For the untrusted senders among them, the fence also denies memory_save_tool and memory_manage_tool when the model calls them, and memory writes are scanned for injected instructions and leaked credentials before they are stored.

Controlled Micro-budget Spending Limit Gate (Commerce)

Myrm ships a deterministic spending limit gate that keeps payment-style actions inside a budget you set. The gate is a pure state machine configured from the Settings page and exposed through a REST API; it holds no card numbers and issues no cards. None of “Always allow”, YOLO mode or Smart Intent Guard can release a payment-like tool call: in a chat you are watching, every one waits for your approval, and a scheduled job cannot release one either: nobody is present to approve it, so the call does not run. Today the caps are applied to reservations made through the REST API; the agent’s own payment-like tool calls are not capped by them and go through the approval flow instead.
  1. Deterministic SpendGovernor Pure State Machine (spend_governor.py):
    • Zero External I/O: Designed as a pure state machine decoupled from specific payment providers, ensuring minimal latency and zero vendor lock-in.
    • Integer Cents Accounting: Replaces vulnerable floating-point math with exact integer cents (cents: int), completely eliminating rounding errors and cumulative precision drifts across concurrent transactions.
    • Dual Hard Limits: Enforces per_action_cap_cents and daily_cap_cents thresholds. Any over-limit reservation is rejected with the LIMIT_EXCEEDED code.
    • Merchant Allowlist: Accepts reservations only for approved merchant domains (wildcards like *.openai.com are supported); any other domain is rejected with UNTRUSTED_MERCHANT.
    • UTC Calendar Day Atomic Rolling & 3600s Lease Compaction: Atomically rolls daily counters at midnight UTC (YYYY-MM-DD), preventing 24-hour sliding window deadlocks; automatically evicts finalized COMMITTED/RELEASED leases older than 3600s to avoid memory leaks.
  2. Two-Phase Idempotent Lease Commit/Release:
    • Idempotency-Key Pre-allocation: Enforces idempotency_key deduplication, allowing safe retries across flaky networks without duplicate holds.
    • Hold/Commit/Release Lifecycle: Pre-allocates funds on hold, records the leased amount against the day’s spend on commit, and releases the hold on request.
  3. Offline Persistent Ledger & Crash-Resilient Boot Reconciliation (spending_ledger.json):
    • Cold-Boot Self-Healing (restore_daily_spent): When the budget service starts, CommerceBudgetService scans local committed transactions for the current UTC day and restores the exact daily spent watermark into SpendGovernor, so a restart cannot reset the day’s spending counter.
    • WebUI Spending Limits & Emergency Freeze: Provides real-time budget utilization gauges, merchant allowlist management, and a one-click Emergency Freeze that rejects every new reservation until you unfreeze.
  4. Regression-Tested: The commerce spending safety suite is backed by a dedicated regression test suite.

Session Canary

Hidden indirect prompt injections (text in matching background colors or inside HTML comments) can steer an agent into leaking what it knows. The session canary is on by default.
  • Per-session token: every agent session gets a random CANARY-... token. It is added once per conversation thread as a separate system message behind the user’s input, together with an instruction never to repeat it, so the system prompt itself carries no per-session text;
  • Leak detection: after every model turn the guardrail checks the reply text and the tool-call arguments for the token. A hit is recorded in the audit log as CANARY_LEAKED and the token is scrubbed from the reply text. Tool calls are not blocked.

Irreversible Destructive Action Hard Stop Line & Workspace Snapshot Rollback Suite

When autonomous LLM agents generate high-blast-radius or irreversibly destructive shell commands (such as rm -rf /, git reset --hard, git clean -fdx, find -delete, mkfs, dd, or inline destructive scripts via python -c "import shutil; shutil.rmtree('.')" / node -e), the risk is either catastrophic unconfirmed execution in autonomous/YOLO mode or irreversible repository annihilation caused by accidental approval clicks. To eliminate this existential risk, Myrm establishes a four-in-one physical hard-stop and workspace snapshot rollback safety architecture:

1. Bash AST Syntax Tree Hard Stop & Blast Radius Classification

  • Deep Syntax Tree Semantic Inspection: The Harness engine parses full command pipelines, compound sequences, and inline scripts using a zero-dependency lexical state machine and AST analyzer (destructive_rules.py, 386 lines), preventing evasions via environmental prefixes or nested quotes;
  • Deterministic Capability Level Escalation: Irreversible operations are physically classified into CapabilityLevel.IRREVERSIBLE_DESTRUCTIVE;
  • Stripping ‘Allow Always’ & Mandatory Explicit CONFIRM Typing: Destructive approval cards unconditionally strip and disable allow_always privileges to prevent permanent bypass backdoors. The front-end renders a fiery red alert banner (DestructiveConfirmationBanner), requiring the user to explicitly type CONFIRM before the approve button activates;
  • YOLO Mode Hard Veto: Destructive action hard-stops hold priority over --yolo autonomous flags, so YOLO Mode never releases a destructive command on its own. With Smart Intent Guard on, a destructive command that clearly matches your request can still be approved automatically; a workspace snapshot is taken first either way.

2. Zero-Copy Millisecond-Level Workspace Snapshotting

  • Isolated Temporary Index via GIT_INDEX_FILE: In the millisecond window before an approved destructive action runs, workspace_snapshot.py builds an isolated temporary Git index (git read-tree HEAD -> git add -A -> git write-tree -> git commit-tree);
  • 100% Untracked New File Capture: Unlike standard git stash, this isolated temporary index captures all untracked and modified files with zero race conditions, committing a dedicated snapshot ref (refs/myrm-snapshots/{snapshot_id});
  • Zero Disk Copy Overhead & Worktree Cleanliness: Operates without copying large directories or polluting the developer’s working stage, adding less than a few milliseconds of runtime overhead.

3. 10-Minute Dynamic Countdown & Anti-Penetration Rollback Gate (600s TTL)

  • Dynamic Countdown Undo Card (DestructiveUndoCard): Once a destructive action executes, the WebUI immediately mounts an interactive undo card featuring a 10-minute dynamic countdown with strict Lucide vector icons and dual-theme responsive styling;
  • Server 600s TTL Physical Guard: The POST /api/v1/approvals/{id}/rollback endpoint enforces a strict 600-second time-to-live ceiling, physically rejecting stale rollback attempts to prevent accidental corruption of subsequent intended work;
  • Instant Lossless Reversion: Clicking “Undo & Rollback Workspace” atomically restores the entire workspace state back to the exact pre-execution snapshot, completely reversing accidental deletions in milliseconds.

4. Combined Defense Suite

  • Myrm combines Bash AST hard stops, mandatory CONFIRM typing, zero-copy snapshots, and a 10-minute TTL anti-penetration rollback.

15. Object-Capability (OCap) Zero-Trust Delegation Mesh & Capability Attenuation Suite

1. The Death of Ambient Authority in Multi-Agent Systems

Ambient Authority means spawned subagents inherit full environment permissions, allowing malicious prompt injections to pivot horizontally and exfiltrate secrets or corrupt critical databases.
  • Hermes / OpenClaw: Restrict a subagent through tool allow and deny lists (delegate_tool_toolsets.py, delegated-tool-policy.ts); which paths an allowed tool may touch is not bounded per spawn;
  • Claude Code / Codex: A subagent inherits the parent’s permission mode or sandbox policy, so the boundary belongs to the session rather than to each spawn;
  • Myrm: Employs Object-Capability (OCap) delegation, issuing every delegate_task subagent (single and batch modes) an unforgeable HMAC-SHA256 capability handle that the local file and shell executors enforce on each operation. Council, alternatives and Dynamic Workflow children do not receive one. Among the products we reviewed, none binds a per-spawn, path-scoped signed capability.

2. High-Performance Architecture Innovations

  1. Unforgeable Token Signing & Scoped Confinement: Each subagent runs under a signed handle scoped to its parent’s own workspace plus any extra directories the parent’s path policy and the user’s session grants already allow, whether a path is given directly or through a symlink; the model’s own context never becomes the child’s runtime context. A spawn from an already confined parent is attenuated from the parent’s handle (attenuate_capability rejects any elevation with AttenuationError), so a child never exceeds its parent and a read-only parent only spawns read-only children. A read-only subagent is denied writes and shell execution, and an expired or tampered handle is denied. The handle bounds file operations to the granted paths and locks shell commands to the granted working directory; the command text itself is checked by the command validator, and strong isolation of what a command can reach is the job of the OS or cloud sandbox;
  2. Stateless Validation (CWE-400 Proof): Handle validity is a signature and expiry check, so the framework retains nothing per spawn: there is no registry to grow, prune or leak in a long-running daemon;
  3. Hierarchical Path Escape Defense (CWE-59 Proof): Combines lexical normalization with physical topological path resolution (os.path.realpath) to neutralize symlink boundary escape attacks;
  4. Prompt Cache Preservation: Capability enforcement executes purely in coroutine ContextVar and physical executor gates, introducing 0 bytes of dynamic pollution into system prompts.

3. Empirical Verification & Quality Gates

  • Harness Core Tests: unit tests for signing, attenuation, symlink containment and the guard in core/security/test_ocap_mesh.py;
  • Spawn Trust Boundary: entry-level tests driven from the delegate_task parameters (test_spawn_trust_boundary.py), and a scripted child run through the real executors (test_spawn_capability_wiring.py) that proves a read-only child cannot write and cannot spawn a writable child.

What Gets Stored When You Approve, and What Happens When You Don’t

Approvals are where trust is actually spent, so they are worth reading closely. What is kept. Every approval stores the exact request it authorised — not just the words “approved”. The record carries the action type and a risk grade, so a later audit can tell what was permitted, not merely that something was. What happens when you walk away. An approval that nobody answers is not left hanging. By default it is rejected on expiry, the record says so explicitly, and the task waiting on that decision is woken so it can continue with a “no”. Only a setting you choose changes that: Timeout Action set to Allow (Settings → Security Policy) approves an expired tool call automatically and the record says so, except for actions only you may approve (payments, irreversible outbound actions, destructive commands, and edits to protected instruction files, git hooks or git config), which are always rejected; a channel topic in Draft Review whose On expiry is set to Send automatically (Settings → Channel Routing) sends its held reply instead. How that shows up in the UI. The expiry moment is visible on the approval card, and the same separation you get in the note channel also holds here: a machine-written line such as “auto-approved” can never be presented as if it were something you said.
Honest note. “The approval record keeps the approved payload and expires on time” is true today. “The executed action is guaranteed to be byte-identical to what you approved, and only a human outside the agent can approve it” are still roadmap items. Do not read a well-kept approval log as a tamper-proof one.

16. Client Display Buffer, Accessibility Privacy Guard & Provenance Attribution Suite

1. Eliminating Client-Side Display Buffer & Accessibility Backdoors

End-to-End Encryption (E2EE) mathematically guarantees data confidentiality over the wire, but provides zero protection once data is decrypted and rendered onto the client operating system’s display buffer, notification center, or accessibility object trees. Industry post-mortems (such as Meta Muse unauthorized reading of Signal chats and financial balance disclosures) revealed that client accessibility APIs, OS notification shades, and unredacted screen captures act as severe system-level backdoors. To maintain uncompromising data sovereignty across Local, Desktop (Tauri), and Cloud deployments, Myrm establishes a six-pillar defense-in-depth privacy architecture:

2. High-Performance Core Architecture

  1. Zero-Model Dependency (External Policy Gate): Security rules sit entirely outside the language model (Sit outside the model). Neither prompt injection nor model jailbreaks can bypass memory-level blackouts or OS display affinity locks;
  2. Deterministic In-Memory Masking: Raw image buffers containing S3 financial accounts or 2FA codes undergo pixel replacement (Solid Blackout Bounding Box) inside CPU RAM prior to base64 encoding or multimodal API dispatch. Confidential pixels are physically eliminated before network serialization;
  3. Process-Level TCC Confinement: When developers launch Myrm from privileged terminal emulators (e.g., iTerm2 with full disk and accessibility permissions granted), child execution workers spawned via safe_exec have their process security credentials sanitized, preventing untrusted scripts from borrowing host privileges.