Skip to main content

Crate capsule_runtime

Crate capsule_runtime 

Source

Re-exports§

pub use artifact_config::configured_artifact_names;
pub use artifact_config::lower_artifact_config;
pub use artifact_config::ARTIFACT_CONFIG_ENV;
pub use artifact_config::MAX_ARTIFACT_CONFIG_BYTES;
pub use containment::check_containment_floor;
pub use containment::containment_shortfall_reason;
pub use containment::detect_achieved_containment;
pub use containment::detect_sealed_blocker;
pub use containment::detect_userns_grant;
pub use containment::explain_scope;
pub use containment::read_only_advisory_for;
pub use containment::render_read_only;
pub use containment::ExportsFilesReport;
pub use containment::FilesystemBoundaryReport;
pub use containment::FilesystemRestriction;
pub use containment::PreopenReport;
pub use containment::PreopenSurface;
pub use containment::ScopeReport;
pub use containment::StateStoreReport;
pub use diagnostic::diagnostic_workdir;
pub use diagnostic::set_diagnostic_workdir;
pub use diagnostic::Emitted;
pub use network_namespace::check_egress_namespace;
pub use network_namespace::detect_egress_namespace_blocker;
pub use network_namespace::skip_without_egress_namespace;
pub use network_namespace::EgressNamespaceBlocker;
pub use sealed::classify_installed_profile;
pub use sealed::classify_profile_attachment;
pub use sealed::inspect_installed_profile;
pub use sealed::inspect_profile_attachment;
pub use sealed::InstalledProfileState;
pub use sealed::ProfileAttachment;
pub use sealed::SealedBlocker;
pub use sealed::UsernsGrant;
pub use sealed::SEALED_APPARMOR_ATTACHMENT_PATHS;
pub use sealed::SEALED_APPARMOR_PROFILE_PATH;
pub use sealed::SEALED_APPARMOR_PROFILE_SHA256;
pub use child_launch::child_workdir_for;
pub use child_launch::launch_child_capsule;
pub use child_launch::ChildLaunchRequest;
pub use child_launch::LaunchedChild;
pub use child_launch::MUR_BINARY_ENV;
pub use delegation::CompletionAddress;
pub use delegation::Spawner;
pub use delegation::SpawnerHandle;
pub use delegation_plane::DelegationLaunch;
pub use delegation_plane::DelegationOrigin;
pub use delegation_plane::DelegationPlane;
pub use delegation_plane::DelegationRequest;
pub use delegation_plane::DelegationResult;
pub use delegation_plane::DELEGATION_RESULT_TIMEOUT;
pub use delegation_plane::DELEGATION_TIMEOUT_ENV;
pub use errors::RuntimeError;
pub use errors::UnreachableEntrypoint;
pub use lanes::TaskLane;
pub use limits::ExecutionLimits;
pub use origin::TaskOrigin;
pub use origin::TaskProvenance;
pub use origin::TrustClass;
pub use origin::PEER_ORIGIN_HEADER;
pub use origin::PEER_TRUST_HEADER;
pub use peer_handoff::audience_from_card;
pub use peer_handoff::handle_id;
pub use peer_handoff::handle_peer_request;
pub use peer_handoff::is_peer_path;
pub use peer_handoff::mint;
pub use peer_handoff::stored_path_for;
pub use peer_handoff::verify;
pub use peer_handoff::HandleError;
pub use peer_handoff::HandlePayload;
pub use peer_handoff::MintedHandle;
pub use peer_handoff::PeerError;
pub use peer_handoff::PeerMintKey;
pub use peer_handoff::PeerPlane;
pub use peer_handoff::AUDIENCE_HEADER;
pub use peer_handoff::HANDLE_ID_HEADER;
pub use peer_handoff::PEER_INBOX_DIR;
pub use peer_handoff::PEER_PATH_PREFIX;
pub use registration::check_roost_health;
pub use registration::deregister_session;
pub use registration::register_session;
pub use registration::SessionOutcome;
pub use resource_plane::check_export_root;
pub use resource_plane::check_peer_files_root;
pub use resource_plane::handle_resource_request;
pub use resource_plane::reason_phrase;
pub use resource_plane::DeclaredExport;
pub use resource_plane::ListEntry;
pub use resource_plane::ListResponse;
pub use resource_plane::ReadResponse;
pub use resource_plane::ResourceError;
pub use resource_plane::ResourcePlane;
pub use resource_plane::ResourceResponse;
pub use resource_plane::SymlinkPolicy;
pub use resource_plane::RESOURCE_PATH_PREFIX;
pub use resources::HostResourceLimits;
pub use retention::list_records;
pub use retention::locate_message;
pub use retention::prune_records;
pub use retention::prune_sessions;
pub use retention::remove_record;
pub use retention::truncate_record;
pub use retention::MessageLocation;
pub use retention::MessageStatus;
pub use retention::PrunedRecord;
pub use retention::PrunedSession;
pub use retention::RecordHeader;
pub use retention::RecordSummary;
pub use retention::RemovedRecord;
pub use retention::TruncationMarker;
pub use retention::TruncationOutcome;
pub use running::Liveness;
pub use running::ProcessState;
pub use running::RunningGuard;
pub use running::RunningRecord;
pub use running::SignalOutcome;
pub use runtime::check_env_allow_reaches_guests;
pub use runtime::check_no_reserved_tool_names;
pub use runtime::launch_session;
pub use runtime::launch_session_handling_sigterm;
pub use runtime::secret_shaped_env_grants;
pub use runtime::stage_session;
pub use runtime::stripped_env_allow_entries;
pub use runtime::warn_on_gateway_endpoint_in_network_allow;
pub use runtime::warn_on_interpreter_runtime_grants;
pub use runtime::warn_on_launch_only_gateway_credential;
pub use runtime::warn_on_secret_shaped_env_grants;
pub use runtime::warn_on_unmetered_gateways;
pub use runtime::warn_on_userns_restriction_disabled_host_wide;
pub use runtime::warn_on_workdir_exec;
pub use runtime::SecretShapedEnvGrant;
pub use runtime::StrippedEnvAllowEntry;
pub use spawn_credential::SpawnApproval;
pub use spawn_credential::SpawnCredential;
pub use spawn_credential::SPAWN_APPROVAL_HEADER;
pub use spawn_credential::SPAWN_CREDENTIAL_HEADER;
pub use spawn_envelope::EnvelopeAxis;
pub use spawn_envelope::EnvelopeViolation;
pub use spawn_envelope::SpawnEnvelope;
pub use staged_runtime::check_staged_runtime_floor;
pub use state_store::ensure_state_store;
pub use state_store::state_store_reports;
pub use state_store::validate_store_name;
pub use state_store::STATE_PREOPEN_NAME;
pub use types::capability_policy_from_runtime_manifest;
pub use types::ArtifactRequest;
pub use types::CapabilityPolicy;
pub use types::InstalledArtifactSummary;
pub use types::LaunchResult;
pub use types::LockExpectation;
pub use types::ResolvedLockArtifact;
pub use types::ResumeMode;
pub use types::ResumeRequest;
pub use types::StageRequest;
pub use types::StagedSession;
pub use workdir_writes::render_runtime_writes;
pub use workdir_writes::RuntimeWriteCondition;
pub use workdir_writes::RuntimeWriteKind;
pub use workdir_writes::RuntimeWriteReport;
pub use workdir_writes::RuntimeWriteScope;
pub use workdir_writes::SESSION_ID_PLACEHOLDER;

Modules§

artifact
artifact_config
Operator-authored per-artifact configuration: the config: block on an artifact’s entry in the capsule operator’s own manifest, lowered to compact JSON and delivered to that artifact alone as ARTIFACT_CONFIG_ENV.
bindings
child_launch
Launching a delegated child as an operating-system process of the parent’s own runtime.
containment
Containment classes: what an operator declares versus what a host actually achieves.
delegation
Which capsule delegated to this one, and how a delegated child says that it finished.
delegation_plane
Handing one task to one sub-capsule, and learning what became of it.
detached
Shell commands that outran their grace period and finished in the background.
diagnostic
The runtime’s one way to write a line to standard output or standard error.
errors
lanes
Which queued task runs next.
limits
Per-guest execution limits: epoch-based deadlines and store resource caps.
mac_token
One opaque token grammar, and the memory-only key that seals it.
murmur_home
The murmur home, ~/.murmur, and the modes of what it holds.
network_namespace
The capsule’s own network namespace: the structural half of the mechanism that replaced the seccomp-notify connect/sendto supervisor.
origin
Why a task woke the capsule, and how far its content is trusted.
peer_handoff
Peer file handoff: runtime-minted handles over a two-sided grant.
plan
process_driver
Loading a process driver: the artifact a transport: process manifest names under inference.driver, which knows how to drive one harness CLI.
registration
What a session tells mur-roost about itself at launch, and what it is handed back.
resource_plane
The resource plane: the read-only file surface a capsule declares under exports.files.
resources
Host-process resource bounds for every native subprocess this runtime spawns.
retention
Retention: what bounds the two stores that grow, and what it costs to bound them.
running
The machine-wide map of capsules that are currently reachable: one record per session that opened an A2A door, at ~/.murmur/running/<session_id>.json.
runtime
sealed
The sealed containment mechanism: a private mount namespace pivoted onto a composed root.
security
Process-level hardening against the /proc/<pid>/environ side channel.
spawn_credential
The two secrets a delegated spawn travels on, and the headers they travel in.
spawn_envelope
The capability ceiling a spawned capsule must fit inside, and the comparison that refuses one that does not.
staged_runtime
capabilities.shell.staged_runtime: staging a pinned host runtime tree into a capsule root.
state_store
Durable, capsule-scoped state stores: ~/.murmur/state/<store>/, granted per artifact by capabilities.state and mounted into a guest as a second WASI preopen named STATE_PREOPEN_NAME.
types
workdir_writes
What the runtime itself writes inside the capsule’s workdir, declared rather than discovered.

Macros§

runtime_err
runtime_out! for standard error, a drop-in for eprintln!. See to_stderr.
runtime_out
Write a formatted line to standard output, falling back to logs/bootstrap.log.

Structs§

BackstopMatch
The pattern that makes the credential backstop drop a name, verbatim, and where it came from.
HostProbe
The host facts the tier decision is made from, taken together as one reading.
IoMaxReport
The declared I/O ceiling and what became of it, carried into --explain-scope, into session_start.effective_grants and into W-SEC-021.
LifecycleConfig
LifecycleOverride
Lifecycle override: allows a parent (mur-roost) or CLI flag to constrain the lifecycle down from what the manifest declares.
PlanTraceAppender
A third O_APPEND handle to the session’s trace.jsonl, held by a plan run.
ResourceTraceAppender
A second, independent O_APPEND handle to the session’s trace.jsonl, used by the resource plane, by the peer plane’s listener, and by the peer-handoff tools in the agent loop.
ToolchainHelperReport
Everything warn_on_unreachable_toolchain_helpers decided. Both lists empty means every known driver was either probed with every helper covered, or answered nothing usable; a driver that could not be asked always lands in unprobed.
ToolchainHelperWarning
One compiler driver whose helper subprocess has no Execute-carrying grant under sealed.
UnprobedToolchainDriver
One compiler driver whose -print-prog-name= probe could not be run, so W-SEC-012 was not evaluated for the helpers named in unchecked_helpers.

Enums§

AfterTask
BackstopPatternSource
Which list a credential backstop pattern came from.
IoMaxStatus
Whether the declared capabilities.resources.cgroup_io_bytes_per_sec ceiling is actually on this session’s cgroup scope.
TaskAcceptance

Functions§

cgroup_delegation_available
Whether this host can hand the runtime a delegated cgroup v2 scope — the precondition [prepare_scope] fails closed on.
check_interpreted_entrypoints_reachable
Refuses a sealed capsule whose capabilities.shell.allow names a script that nothing declared could make importable inside the composed root.
credential_backstop_drops
Whether the credential backstop would drop a variable of this name — the same question [strip_credential_shaped_vars] answers per entry, asked of a name alone. See credential_backstop_match for which pattern decided it.
credential_backstop_match
The first credential backstop pattern that matches name, or None when the backstop keeps it — the one decision procedure behind [strip_credential_shaped_vars], credential_backstop_drops, W-SEC-024 and the E-CAP-016 staging refusal.
find_on_path
The first executable named binary on this process’s PATH, or None when there is none.
io_max_device_available
Whether the filesystem behind path has a block device an io.max ceiling can name.
preopen_reports
The filesystem surface each of the given artifacts will be preopened into, resolved but not opened, one entry per artifact that has a guest.
probe_io_max
Answers “would the declared io.max ceiling apply on this host?” by performing the write, against a throwaway cgroup created and removed inside this call.
requires_process_bounding
Does this policy give the capsule any way to run a native subprocess at all?
skip_without_host_support
Whether a test that launches a subprocess-capable capsule must stand down on this host, printing the blocker when it must.
warn_on_unreachable_toolchain_helpers
Warns (W-SEC-012, non-fatal, once per uncovered helper) when a sealed capsule allowlists a known compiler driver whose helper binaries have no grant carrying the Landlock Execute right. Returns what it warned about so the decision is assertable without capturing stderr.