Skip to main content

Crate keel_core

Crate keel_core 

Source
Expand description

Keel core: bind a Policy to an EnforceBackend and a RecordSink as a durable execution space.

Structs§

BackendInfo
CancellationToken
Re-export for hosts (e.g. Zene) using ManagedProcess::wait_with_output_cancel. A token which can be used to signal a cancellation request to one or more tasks.
CredentialGrant
Just-in-time credential handle (opaque to the agent; injected by Keel).
FsRule
A single filesystem rule.
HashChainSink
Wraps an inner sink and seals each event into a SHA-256 hash chain.
JsonlSink
Append-only JSONL file sink.
LocalProcessBackend
Landlock / Seatbelt enforce backend.
LocalProcessOptions
Options for LocalProcessBackend.
ManagedProcess
Process spawned under a space: stdio access + tree kill + audit on wait.
MemorySink
In-memory sink for tests and demos.
MultiSink
Fan-out sink.
NetworkRule
NullBackend
Policy
Bound execution policy. Immutable after space creation (v0).
PolicyBuilder
PolicyId
ProcessExit
Result of waiting on a SpawnedProcess.
ProcessGuardBackend
RecordEvent
SandboxConfig
Merged view of global + project sandbox config.
Space
Live execution space: one policy, one backend, one record stream.
SpaceFs
Filesystem facade bound to an open space.
SpaceHandle
Public handle returned after create.
SpaceId
SpaceOptions
Options for opening a space.
SpacePathMeta
SpawnRequest
SpawnedProcess
Low-level child handle with process-group / Job / AppContainer-aware wait/kill.
TaskId
TaskSpec
Requested changes when forking a space for a subtask.
WorktreeBackend
Worktree isolation backend (optionally layered on another backend).
WorktreeOptions
Options for WorktreeBackend.

Enums§

ChainVerifyError
Result of verifying a sequence of chained events.
EgressDecision
Result of an egress decision.
EventKind
ExecPolicy
Whether the agent may spawn subprocesses / shells.
FsAccess
How a path may be accessed.
KeelError
NetworkPolicy
Network reach for the execution space.
SpaceState
StdioMode
How to connect a child’s standard stream.
TerminationReason
Why a managed process stopped.

Constants§

GENESIS_PREV
Genesis previous-hash for the first event in a chain.

Traits§

EnforceBackend
A live enforcement context for one space.
RecordSink

Functions§

apply_policy_file_and_ready
Load policy JSON from path and apply (used by keel sandbox-exec).
backend_local_process
Local-process only (no worktree).
backend_local_process_confined
Local-process with host Landlock/Seatbelt (isolate_apply = false). Prefer [keel_core::Space::create_confined] for the full Space lifecycle.
backend_process_guard
Soft process-guard only.
baseline_deny_rules
Full baseline deny set (paths + globs).
check_egress
Evaluate whether a dial to host:port is permitted.
content_sha256
SHA-256 hex of arbitrary bytes (e.g. file contents written via SpaceFs).
default_space_sink
Create the default on-disk JSONL sink for a space (~/.keel/spaces/<id>/events.jsonl).
keel_home
Keel state directory ($KEEL_HOME or ~/.keel).
load_policy_from_sandbox_toml
Load config for workspace and resolve a profile name.
narrow_policy
Build a child policy from parent + spec. Fails if the child would expand reach.
prepare_kernel
Validate that the policy can be mapped and the platform supports sandboxing.
profile_read_only
Explore without modifying the project tree. Writes only to keel home + temps.
profile_strict
Narrower reach: no default world-read; workspace + essential system paths only.
profile_workspace
Everyday coding: broad read, write limited to workspace + keel home + temps.
resolve_policy_with_files
Resolve policy: optional explicit file path overrides name lookup.
soft_fs_allowed
Soft filesystem allow check.
soft_fs_resolve
Resolve a path for SpaceFs-style I/O: workspace-relative join, then canonicalize existing paths (follows symlinks). For new paths, canonicalize the nearest existing ancestor and rejoin the full relative suffix after it (so foo/bar.txt keeps both foo/ and bar.txt, not only the leaf).
space_dir
Directory for one space: ~/.keel/spaces/<id>/.
space_events_path
Default event log path: ~/.keel/spaces/<id>/events.jsonl.
space_policy_path
Optional persisted policy snapshot path.
verify_chain
Verify an ordered event list forms a valid hash chain.
verify_jsonl
Load JSONL from a string and verify the chain.
worktree_sandboxed
Worktree + LocalProcess (kernel FS on children) — closest to Grok’s “isolated tree + OS sandbox” stack for coding agents.
worktree_soft
Worktree isolation only (soft process-guard inside).

Type Aliases§

KeelResult