Security
OpenPawz is designed with defense-in-depth: 20+ security layers protect against prompt injection, data exfiltration, SSRF, MITM attacks, memory forensics, agent fixation, inter-agent manipulation, and unauthorized actions.Zero Attack Surface by Default
OpenPawz exposes zero network ports in its default configuration. There is no HTTP server, no WebSocket endpoint, and no listening socket for an attacker to reach — the only communication channel is Tauri’s in-process IPC between the WebView and the Rust engine.Network listeners
Four optional listeners exist. All are disabled by default and bind to localhost only (127.0.0.1):
Because everything binds to
127.0.0.1, these services are unreachable from the network even when enabled. Binding to 0.0.0.0 (LAN/WAN exposure) is a manual opt-in that triggers a security warning in the logs and recommends TLS via Tailscale Funnel.
:::warning
Changing bind_address to 0.0.0.0 on any listener exposes it to your local network. Only do this behind a firewall or VPN (e.g. Tailscale), and ensure the authentication token is strong.
:::
Cryptographic key storage
No cryptographic key is ever stored on the filesystem. All keys live in the OS keychain (macOS Keychain / Windows Credential Manager / Linux Secret Service) inside a unified key vault — a single keychain entry (openpawz / key-vault) storing a JSON blob of all purpose keys. This reduces OS keychain prompts from 7+ to 1 on launch or binary change.
All in-memory key material is wrapped in
Zeroizing<String> (via the zeroize crate) so secrets are securely overwritten with zeroes when dropped or replaced — preventing key material from lingering in freed heap memory.
From the memory vault key, three independent key families are derived via HKDF-SHA256 domain separation:
There is no
device.json, no key file, and no config file containing secrets. If the OS keychain is unavailable, the app refuses to store credentials rather than falling back to plaintext.
Soul files (agent behavior)
Agent personality and behavioral rules (SOUL.md, IDENTITY.md, USER.md) are stored in the encrypted SQLite database (agent_files table) — not as files on the filesystem. They are read and written exclusively through Tauri IPC commands, which are local WebView-to-Rust calls with no network involvement.
An external attacker would need:
- Physical access to the machine, AND
- The OS keychain credential to decrypt the database
Content Security Policy
The Tauri WebView enforces a strict CSP that restricts all connections to127.0.0.1:
Human-in-the-Loop (HIL)
Every tool is classified by risk level. High-risk tools require explicit human approval before execution.Auto-approved tools (no approval needed)
fetch · read_file · list_directory · web_search · web_read · memory_search · memory_store · soul_read · soul_write · soul_list · self_info · update_profile · create_task · list_tasks · manage_task · email_read · slack_read · telegram_read · image_generate
HIL-required tools (human must approve)
exec · write_file · delete_file · append_file · email_send · webhook_send · rest_api_call · slack_send · github_api
Agent policies
Per-agent tool access control with four presets:
You can also create custom policies with specific tool allowlists/denylists.
Risk classification
Prompt injection defense
All incoming channel messages are scanned for injection attempts before reaching the agent.Detection
Pattern-based scoring across 9 categories (8 in the Rust backend scanner, 9 in the TypeScript frontend scanner which addsobfuscation):
Severity levels
Channel bridges automatically block messages with
critical severity.
Container sandbox
Execute agent commands in isolated Docker containers:Presets
Command risk assessment
Commands are scored before execution:- Low —
ls,cat,echo - Medium —
pip install,npm install - High —
curl,wget, network commands - Critical —
rm -rf /,chmod 777, dangerous patterns
Browser network policy
Control which domains agents can access: Default allowed: AI provider APIs, DuckDuckGo, Coinbase, localhost Default blocked: pastebin.com, transfer.sh, file.io, 0x0.st (data exfiltration risks)File system protection
Sensitive paths are blocked from agent access — agents cannot add these as project folders or browse into them.
Additionally, the home directory root itself (
~, /home/user, /Users/user) and the filesystem root (/, C:\) are blocked as too broad.
:::tip Per-project scope guard
When a project is active, all file operations are constrained to the project root. Directory traversal sequences (../) are detected and blocked even within the allowed path.
:::
Credential security
Credentials are protected by two independent encryption layers:Layer 1: Skill credential encryption (AES-256-GCM)
- API keys encrypted with AES-256-GCM using a 32-byte random key
- Encryption key stored in the unified OS keychain vault (
openpawz) - High-risk credentials (Coinbase, DEX) are server-side only — never injected into prompts
- Credentials are decrypted only at execution time
Layer 2: Database field encryption (AES-256-GCM)
Sensitive database fields are encrypted with AES-256-GCM via the Web Crypto API before being stored in SQLite.
:::info Two independent layers
The AES-256-GCM skill layer protects skill credentials stored in the
skill_credentials table. The AES-256-GCM database layer protects other sensitive fields across the database. Both derive their keys from the unified OS keychain vault (openpawz) using separate purpose keys.
:::
TLS certificate pinning
All AI provider connections use a certificate-pinned TLS configuration that explicitly ignores the operating system trust store. This means a compromised or rogue CA installed on the user’s machine cannot intercept provider traffic.Why this matters
Most TLS MITM attacks rely on installing a custom root CA on the victim’s machine (corporate proxies, malware, government surveillance). By pinning to Mozilla’s root store, OpenPawz rejects certificates signed by any non-Mozilla CA — even if the OS trusts it.Covered providers
All providers routed through the pinned client: OpenAI, Anthropic, Google Gemini, OpenRouter, DeepSeek, Grok, Mistral, Moonshot, Ollama, and any custom OpenAI-compatible endpoint.Outbound request signing
Every AI provider request is signed with SHA-256 before transmission for tamper detection and compliance auditing.How it works
Before each.send(), the engine computes:
Use cases
- Tamper detection — If a proxy modifies the request body in transit, the recorded hash won’t match a re-computed hash of the actual payload received by the provider
- Compliance audit — Security teams can export request hashes to verify that specific prompts were sent at specific times
- Replay detection — Each hash includes a timestamp, making every entry unique even for identical request bodies
Memory encryption (secure zeroing)
API keys and other sensitive credentials are protected in RAM usingZeroizing<String> wrappers from the zeroize crate, ensuring they are overwritten with zeros when no longer needed.
What this prevents
When a provider is dropped (e.g. user switches providers, session ends, or the app closes), the API key memory is immediately zeroed rather than left as a dangling allocation. This protects against:- Memory dump attacks — Forensic tools or malware scanning process memory for API key patterns
- Swap file leaks — Unencrypted API keys persisted to disk via OS swap/page file
- Use-after-free — Freed memory still containing the key being reallocated to another buffer
Implementation
Engram memory content encryption
Project Engram adds field-level PII encryption for memory content. Unlike credential zeroing (above), this protects the actual memories stored by agents — not just API keys.PII detection
Before storage, every memory passes through a two-layer PII scanner with 17 regex patterns:
Layer 2 (LLM): An LLM-assisted secondary scanner catches context-dependent PII that static regex cannot detect (e.g., “my mother’s maiden name is Smith”, “born in Springfield”). Content flagged by Layer 1 or exceeding a configurable character threshold is sent to the active model for classification. The LLM returns structured JSON with detected PII types and confidence scores.
Encryption details
Query sanitization
All search queries are sanitized before reaching the storage backend to prevent injection:- Search operators (
AND,OR,NOT,NEAR,*,",(,)) are stripped - Column filter syntax (
:) is removed - Empty queries after sanitization are rejected
Prompt injection scanning
Memory content is scanned against 10 known prompt injection patterns before storage. Matches are redacted with[REDACTED:injection] markers, preventing poisoned memories from manipulating agent behavior on future recalls.
GDPR Article 17 — Right to erasure
Thegdpr_purge command performs a complete data erasure for a user:
- All memory content rows deleted
- All vector embeddings deleted
- Search index entries removed
- Graph edges removed
- Padding table repacked to prevent file-size leakage
PRAGMA secure_deleteensures freed pages are zeroed
Inter-agent memory bus trust
The cross-agent memory bus (pub/sub for sharing memories between agents) enforces publish-side authentication to prevent memory poisoning.Capability tokens
Each agent holds anAgentCapability signed with HMAC-SHA256 against a platform-held secret key. The token specifies:
- Max publication scope — Agent, Squad, or Global
- Importance ceiling — Maximum importance an agent can assert (0.0–1.0)
- Write permission — Whether the agent can publish at all
- Rate limit — Maximum publications per GC window
publish() call verifies the token signature in constant time before any bus operation.
Read-path token verification (signed scope tokens)
Everygated_search() call performs 4-step cryptographic verification:
- HMAC signature integrity — Token signature verified against platform signing key (HKDF-derived)
- Identity binding — Token
agent_idmust match the requesting agent - Scope ceiling check — Requested search scope must not exceed the token’s
max_scope - Membership verification — For squad/project scopes, SQL membership checks confirm the agent belongs to the relevant squad or project
Publish-side defenses
Trust-weighted contradiction resolution
When two agents publish contradictory facts on the same topic, the system resolves based on trust-weighted importance:Threat model
Snapshot HMAC
Working memory snapshots (saved on agent switch or session end) include an HMAC-SHA256 integrity tag computed from a dedicated HKDF-derived key. On restore, the HMAC is verified before the snapshot is loaded — tampered snapshots are rejected and logged.Anti-fixation defenses
Five defense layers prevent agents from ignoring user instructions or getting stuck on old topics:User override detection
Explicit user commands to stop or redirect the agent are recognized via phrase matching across 5 categories:
Escalation levels:
- Level 0: Gentle redirect — “Stop your current task, respond to this message”
- Level 1: Firm redirect — “You ignored them once already. STOP.”
- Level 2+: Hard override — “USER COMMAND: The user has told you times to stop”
Anti-forensic vault-size quantization
The Engram memory store mitigates vault-size oracle attacks — a side-channel where an attacker can infer how many memories are stored by observing the SQLite database file size. This is the same threat class addressed by KDBX inner-content padding.What this prevents
An attacker with read-only access to the filesystem (malware, backup exfiltration, shared-machine forensics) cannot determine:- Exact number of stored memories
- Whether memories were recently deleted (no file-size drop)
- Growth rate of the knowledge store over time
Implementation
Threat model comparison
Tool execution security
Tool execution is governed by multiple safety mechanisms in the engine’s central tool executor.Source code introspection block
Agents cannot read engine source files — anyread_file call targeting paths containing src-tauri/src/engine/, src/engine/, or files ending in .rs is rejected. This prevents agents from exfiltrating their own implementation details or discovering internal security mechanisms.
Credential write block
Thewrite_file tool blocks content that contains credential-like patterns:
- PEM private keys (
-----BEGIN ... PRIVATE KEY-----) - API key secrets (
api_key_secret,cdp_api_key) - Base64-encoded secrets with
secretorprivatekeywords
Execution limits
Output truncation
Tool results are capped to prevent context window overflow:Network policy enforcement
Thefetch tool enforces domain-level network policy — blocked domains are always rejected, and when an allowlist is active, only listed domains are permitted.
Exfiltration detection
Outbound network commands are audited for data exfiltration patterns:- Piping file contents to
curl,wget, ornc - File upload flags (
curl -T,curl --data-binary @,wget --post-file) - Redirects to
/dev/tcp/ scpandrsyncto remote hosts
exec tool invocations. It supplements — but does not replace — the container sandbox for high-security environments.
:::
Flow execution security
The visual flow builder executes agent pipelines with multiple isolation and safety mechanisms.Memory scoping
Flow memory queries are agent-scoped — theagentId is passed to every pawEngine.memorySearch() call. Results are score-filtered at ≥ 0.3 to prevent low-relevance noise from entering agent prompts. In tesseract flows, each parallel cell receives its own resolved memory context via an immutable map — no shared-state mutation between cells.
Cell isolation in tesseract flows
Each tesseract cell executes in its ownConductorDeps wrapper:
Timeout protection
The per-cell timeout prevents resource exhaustion:Circular import prevention
The flow engine prevents circular module dependencies betweenconductor-atoms.ts and conductor-tesseract.ts using type-only imports (erased at compile time) and a compileSubgraph? callback injection pattern. This ensures the module graph has no runtime cycles.
Budget enforcement
Daily spending limits with progressive warnings:Trading safety
Channel access control
Each user gets an isolated session — no cross-user data leakage.
Keychain key management
All cryptographic keys are read from the OS keychain exactly once per process lifetime and cached in-memory using a hardened caching pattern. This eliminates repeated system password prompts during normal operation.Cache architecture
Each key cache usesRwLock<Option<Zeroizing<T>>>:
Key generation
All new keys (vault, DB, memory, audit signing) are generated usingOsRng from the rand crate, which delegates to the kernel CSPRNG (getrandom syscall on Linux, Security.framework on macOS, BCryptGenRandom on Windows). thread_rng() is never used for key material.
Constant-time passphrase comparison
The lock screen passphrase is verified usingsubtle::ConstantTimeEq (the subtle crate). This prevents timing side-channel attacks where an attacker could infer how many bytes of the passphrase matched by measuring response time.
SSRF protection
Thefetch tool validates all URLs against a blocklist of internal and cloud metadata endpoints before making any outbound request:
Blocked requests return an error without making any network call. This prevents agents from accessing internal services, cloud instance credentials, or other resources on the local network.
Audit chain integrity (HMAC)
Every entry in the security audit log is signed with HMAC-SHA256 using a dedicated signing key stored in the unified OS keychain vault (openpawz), separate from all encryption keys.
This forms a tamper-evident hash chain: modifying or deleting any audit entry breaks the chain from that point forward.
Inter-agent communication security
All messages sent between agents viaagent_send_message are scanned for prompt injection before delivery:
- Content field — scanned against the full injection pattern set
- Metadata field — independently scanned (injection payloads can be hidden in metadata)
- Blocking threshold — messages with
HighorCriticalinjection severity are blocked and never delivered
Worker delegate security
Worker agents (spawned by the orchestrator for delegated subtasks) operate under a restricted tool policy that cannot be overridden:Blocked tools
exec, write_file, delete_file, append_file, and all trading write operations are removed from the worker’s available tool set before execution begins.
MCP tool name blocking
MCP tools whose names contain dangerous operation keywords are blocked at the name level:exec · shell · run_command · terminal · system · write_file · delete_file · remove_file · file_write · rm_rf · rmdir · unlink
This prevents a rogue MCP server from exposing tools like mcp_server_exec or mcp_server_write_file that would bypass the direct tool blocklist.
MCP registry injection scanning
Results returned from MCP tool executions are scanned for prompt injection on both success and error paths. This prevents a malicious MCP server from embedding instruction overrides in:- Success responses — tool output that gets forwarded to the agent’s context
- Error messages — error strings that are included in the agent’s next prompt turn
High or Critical severity are sanitized before reaching the agent.
Memory tool hardening
Thememory_store and memory_update tools enforce additional safety constraints:

