Skip to main content

Module hardening

Module hardening 

Source
Expand description

Process hardening: best-effort defense-in-depth measures.

Functions§

agent_context
Whether murk is running on behalf of an AI agent, via the explicit MURK_AGENT opt-in. Agent context forces strict mode (see strict_mode) so the honest path never falls back to the operator’s stored key. murk agent exec sets it (alongside MURK_STRICT) for the child. This is a safe default, not a sandbox: a child that controls its own environment or can read ~/.config/murk/keys directly is outside murk’s boundary — real containment is OS-level isolation (see the note in docs/ai-agents.md).
ci_context
Whether murk appears to be running in CI (the conventional CI variable set truthy). Advisory only: CI context drives a nudge toward the scoped agent path but — unlike agent_context — does not by itself flip strict mode, so existing pipelines are never silently changed.
disable_core_dumps
Disable core dumps for this process.
is_ram_backed
Whether path lives on a RAM-backed filesystem (tmpfs/ramfs), meaning data written there never hits persistent storage.
self_scope
Whether the operator opted into self-scoping: honoring the vault’s agent allow-tag policy for their OWN key, as if they were an agent. On via an explicit MURK_SELF_SCOPE, or implicitly in an agent_context (declaring MURK_AGENT binds you to the policy even with your own key). A no-op on a vault with no policy set.
stdout_is_regular_file
Whether this process’s stdout is a regular file (as opposed to a pipe, terminal, or device).
strict_mode
The effective strict setting: strict is ON when either the operator set a truthy MURK_STRICT or this is an agent_context (MURK_AGENT). There is deliberately no way to turn strict OFF from inside an agent context — an operator who wants convenience simply doesn’t opt into agent context. Strict mode trades convenience for a safer default: don’t write a secret to disk (see is_ram_backed) and don’t fall back to the operator’s stored key (see env::resolve_key_with_source). This is the toggle the strict gates read.