Skip to main content

keel_core/
lib.rs

1//! Keel core: bind a [`Policy`] to an [`EnforceBackend`] and a [`RecordSink`]
2//! as a durable **execution space**.
3
4mod error;
5mod managed;
6mod space;
7mod space_fs;
8
9pub use error::{KeelError, KeelResult};
10pub use managed::ManagedProcess;
11pub use space::{Space, SpaceHandle, SpaceOptions, SpaceState};
12pub use space_fs::{SpaceFs, SpacePathMeta};
13/// Re-export for hosts (e.g. Zene) using [`ManagedProcess::wait_with_output_cancel`].
14pub use tokio_util::sync::CancellationToken;
15
16pub use keel_enforce::{
17    local_process as backend_local_process,
18    local_process_confined as backend_local_process_confined,
19    process_guard as backend_process_guard, soft_fs_allowed, soft_fs_resolve, worktree_sandboxed,
20    worktree_soft, BackendInfo, EnforceBackend, LocalProcessBackend, LocalProcessOptions,
21    NullBackend, ProcessExit, ProcessGuardBackend, SpawnRequest, SpawnedProcess, StdioMode,
22    TerminationReason, WorktreeBackend, WorktreeOptions,
23};
24
25#[cfg(unix)]
26pub use keel_enforce::{apply_policy_file_and_ready, prepare_kernel};
27pub use keel_policy::{
28    baseline_deny_rules, check_egress, load_policy_from_sandbox_toml, narrow_policy,
29    profile_read_only, profile_strict, profile_workspace, resolve_policy_with_files,
30    CredentialGrant, EgressDecision, ExecPolicy, FsAccess, FsRule, NetworkPolicy, NetworkRule,
31    Policy, PolicyBuilder, PolicyId, SandboxConfig, SpaceId, TaskId, TaskSpec,
32};
33pub use keel_record::{
34    content_sha256, default_space_sink, keel_home, space_dir, space_events_path,
35    space_policy_path, verify_chain, verify_jsonl, ChainVerifyError, EventKind, HashChainSink,
36    JsonlSink, MemorySink, MultiSink, RecordEvent, RecordSink, GENESIS_PREV,
37};