Skip to main content

confium_sandbox_process/
lib.rs

1//! Confium out-of-process plugin sandbox.
2//!
3//! Each plugin runs in its own subprocess, communicating with the
4//! host over length-prefixed JSON-RPC frames on stdin/stdout. This is
5//! the second of Confium's two sandboxing tracks (the first is the
6//! in-process WASM runtime in `confium-sandbox-wasm`).
7//!
8//! ## Surfaces
9//!
10//! - [`Sandbox`] — the runtime trait (impl: [`ProcessSandbox`]).
11//! - [`SandboxInstance`] — a loaded, capability-bound plugin.
12//! - [`Capability`] — the capability model (interface / network /
13//!   key / filesystem).
14//! - [`Value`] — values crossing the sandbox boundary.
15//! - [`protocol`] (public) — the wire types and helpers for the
16//!   length-prefixed JSON-RPC framing.
17//!
18//! ## Protocol
19//!
20//! Every frame is `4-byte big-endian length` + `length bytes of UTF-8
21//! JSON`. Requests:
22//!
23//! ```jsonc
24//! {"method": "<function>", "args": [<value>, ...]}
25//! ```
26//!
27//! Responses:
28//!
29//! ```jsonc
30//! {"result": [<value>, ...]}     // success
31//! {"error": {"message": "<text>"}} // failure
32//! ```
33//!
34//! See `TODO.roadmap/08-security-model.md` § "Track B" for the
35//! motivation and the OS-level restriction roadmap.
36
37pub mod error;
38pub mod process_sandbox;
39pub mod protocol;
40pub mod sandbox;
41
42pub use error::Error;
43pub use error::Result;
44pub use process_sandbox::ProcessInstance;
45pub use process_sandbox::ProcessSandbox;
46pub use sandbox::Capability;
47pub use sandbox::FilesystemMode;
48pub use sandbox::Sandbox;
49pub use sandbox::SandboxInstance;
50pub use sandbox::Value;