Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(config): add local jail runtime configuration

Steven Enamakelccbef50bc2b5
diff --git a/crates/openhuman-core/src/config/schema/README.md b/crates/openhuman-core/src/config/schema/README.md
index 01216287ba..d826341d45 100644
--- a/crates/openhuman-core/src/config/schema/README.md
+++ b/crates/openhuman-core/src/config/schema/README.md
@@ -41,6 +41,7 @@ is mounted as a submodule of `load/dirs.rs` via `#[path]`.
| `[[model_routes]]`, `[[embedding_routes]]` | `routes.rs` | `ModelRouteConfig`, `EmbeddingRouteConfig` |
| `[runtime]` (+ `[runtime.docker]`), `[shell]`, `[reliability]`, `[scheduler]` | `runtime.rs` | `RuntimeConfig`, `DockerRuntimeConfig`, `ShellConfig`, `ReliabilityConfig`, `SchedulerConfig` |
| `[runtime_pool]` | `runtime_pool.rs` | `RuntimePoolConfig`, `RuntimePoolLangConfig` |
+| `[runtime.local_jail]` | `runtime_local_jail.rs` | `LocalJailConfig` — filesystem grants for the local OS jail |
| `[runtime_python]` | `runtime_python.rs` | `RuntimePythonConfig` |
| `[scheduler_gate]` | `scheduler_gate.rs` | `SchedulerGateConfig`, `SchedulerGateMode` |
| `[memory]`, `[memory_tree]`, `[storage]` | `storage_memory.rs` | `MemoryConfig`, `MemoryTreeConfig`, `StorageConfig`, `StorageProviderConfig`, `LlmBackend` |
diff --git a/crates/openhuman-core/src/config/schema/mod.rs b/crates/openhuman-core/src/config/schema/mod.rs
index a9a842a509..8782c04f1d 100644
--- a/crates/openhuman-core/src/config/schema/mod.rs
+++ b/crates/openhuman-core/src/config/schema/mod.rs
@@ -62,6 +62,7 @@ mod privacy;
mod proxy;
mod routes;
mod runtime;
+mod runtime_local_jail;
mod runtime_pool;
mod runtime_python;
mod scheduler_gate;
@@ -106,6 +107,7 @@ pub use routes::{EmbeddingRouteConfig, ModelRouteConfig};
pub use runtime::{
DockerRuntimeConfig, ReliabilityConfig, RuntimeConfig, SchedulerConfig, ShellConfig,
};
+pub use runtime_local_jail::LocalJailConfig;
pub use runtime_pool::{RuntimePoolConfig, RuntimePoolLangConfig};
pub use runtime_python::RuntimePythonConfig;
pub use scheduler_gate::{SchedulerGateConfig, SchedulerGateMode};
diff --git a/crates/openhuman-core/src/config/schema/runtime.rs b/crates/openhuman-core/src/config/schema/runtime.rs
index fdb4c30ecd..7180e70faf 100644
--- a/crates/openhuman-core/src/config/schema/runtime.rs
+++ b/crates/openhuman-core/src/config/schema/runtime.rs
@@ -12,6 +12,9 @@ pub struct RuntimeConfig {
pub kind: String,
#[serde(default)]
pub docker: DockerRuntimeConfig,
+ /// Filesystem grants for the local OS jail (`[runtime.local_jail]`).
+ #[serde(default)]
+ pub local_jail: super::LocalJailConfig,
#[serde(default)]
pub reasoning_enabled: Option<bool>,
/// Reasoning ("thinking") effort for agent turns: `none`, `minimal`,
@@ -98,6 +101,7 @@ impl Default for RuntimeConfig {
Self {
kind: default_runtime_kind(),
docker: DockerRuntimeConfig::default(),
+ local_jail: super::LocalJailConfig::default(),
reasoning_enabled: None,
reasoning_effort: None,
}
diff --git a/crates/openhuman-core/src/config/schema/runtime_local_jail.rs b/crates/openhuman-core/src/config/schema/runtime_local_jail.rs
new file mode 100644
index 0000000000..28cfb469a6
--- /dev/null
+++ b/crates/openhuman-core/src/config/schema/runtime_local_jail.rs
@@ -0,0 +1,53 @@
+//! `[runtime.local_jail]` — filesystem grants for the local OS jail
+//! (Landlock on Linux, Seatbelt on macOS).
+//!
+//! With a real jail in force, a command can touch only what the policy grants.
+//! The built-in set covers the everyday toolchain (`~/.cargo`, `~/.rustup`,
+//! `~/.nvm`, `~/.npm`, `/usr/local`, `/opt`, git config); this section extends
+//! or trims it.
+//!
+//! Credential stores (`~/.ssh`, `~/.gnupg`, `~/.aws`, ...) are never granted:
+//! entries naming one, or a parent that would expose one (such as `~`), are
+//! dropped with a warning. Paths accept a leading `~/`.
+
+use schemars::JsonSchema;
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
+#[serde(default)]
+pub struct LocalJailConfig {
+ /// Grant the built-in toolchain homes that exist on this machine
+ /// (`~/.cargo` read-write; `~/.rustup`, `~/.nvm`, `~/.npm`, `/usr/local`
+ /// and `/opt` read-only) plus the user's git config. Set `false` to
+ /// confine commands to the workspace, the system baseline and
+ /// `extra_read_only` / `extra_read_write`.
+ #[serde(default = "default_true")]
+ pub toolchain_homes: bool,
+ /// Extra read-only (and executable) paths. Missing paths are skipped.
+ #[serde(default)]
+ pub extra_read_only: Vec<String>,
+ /// Extra read-write paths. Missing paths are skipped.
+ #[serde(default)]
+ pub extra_read_write: Vec<String>,
+ /// Let jailed commands read `/proc`. **Off by default**: `/proc/<pid>/environ`
+ /// and `/proc/<pid>/cmdline` expose the environment and arguments of every
+ /// process the user owns, including the core's own credentials. Enable it
+ /// only when a workflow needs tools such as `ps` or `top`.
+ #[serde(default)]
+ pub allow_proc: bool,
+}
+
+fn default_true() -> bool {
+ true
+}
+
+impl Default for LocalJailConfig {
+ fn default() -> Self {
+ Self {
+ toolchain_homes: true,
+ extra_read_only: Vec::new(),
+ extra_read_write: Vec::new(),
+ allow_proc: false,
+ }
+ }
+}