Drop per-tool host/container sandbox; schedule semantic vector memory
Safety is an environment boundary of the whole process, not a per-tool sandbox: run strata-ctl itself in a container/VM/isolated machine for stronger protection. The planned "isolated mode" (Docker-MCP ShellRunner) is cancelled; ShellRunner stays only as a test/alternate-runner seam. README + agent/shell/sessions comments updated accordingly. Add a Roadmap section with the next headline feature: a Qoder-style semantic vector memory (embed + index conversation chunks, notes, uploads, learned facts; similarity retrieval injected per turn plus remember/search tools). Recommended shape: embedded sqlite-vec in the existing SQLite store behind the Store trait + a small local multilingual embedder; carries over to the planned ArangoDB vector indexes. Scheduled, not implemented.
This commit is contained in:
1 parent
765c197b95
commit
fb9b822f58
4 files changed
+43
-29
No files matched your search
@@ -167,17 +167,14 @@ answer, token by token), `tool_call` / `tool_result` (every command and its outp
|
|||||||
inline) and `final` — so the wait is always visible progress, **observability without
|
inline) and `final` — so the wait is always visible progress, **observability without
|
||||||
a confirmation gate**.
|
a confirmation gate**.
|
||||||
|
|
||||||
Two operating modes are planned, separated by the *environment* rather than per-call
|
Safety is an **environment boundary, not a per-tool sandbox**: `shell_exec` always
|
||||||
approval:
|
runs via `bash -lc` on whatever machine the framework runs on, starting in the
|
||||||
|
session's **personal folder** by default (override with `cwd`), with a timeout and
|
||||||
- **Base / host mode** (implemented): `shell_exec` runs directly on the host via
|
an output cap. There is deliberately **no host-vs-container tool split** — if you
|
||||||
`bash -lc`, starting in the session's **personal folder** by default (override with
|
want stronger protection, run *strata-ctl itself* inside a container, a VM or an
|
||||||
`cwd`), with a timeout and an output cap. This is a trusted machine; the agent has
|
isolated machine; the agent then only ever sees that environment. Execution sits
|
||||||
the same freedom you would give a local operator.
|
behind a `ShellRunner` trait (useful for tests and alternate runners), with no
|
||||||
- **Isolated mode** (planned): the same tool routes to a sandboxed runner — the
|
per-call confirmation gate and no separate "isolated" tool backend.
|
||||||
team's Docker-container MCP server. The user supplies the container; provisioning
|
|
||||||
is on them. Execution sits behind a `ShellRunner` trait, so the isolated runner
|
|
||||||
plugs in without touching the agent loop.
|
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
@@ -256,11 +253,25 @@ returns a clear 400), multi-slot batching, logprobs / structured output, automat
|
|||||||
engine restart after a crash, a full SSRF guard against DNS rebinding, and the
|
engine restart after a crash, a full SSRF guard against DNS rebinding, and the
|
||||||
OpenAI Responses native endpoint. The Anthropic adapter covers the core cases but
|
OpenAI Responses native endpoint. The Anthropic adapter covers the core cases but
|
||||||
not yet the `defer_loading` / `tool_addition` / `tool_reference` tool machinery, the
|
not yet the `defer_loading` / `tool_addition` / `tool_reference` tool machinery, the
|
||||||
thinking `budget_tokens` mapping, or prompt-cache token accounting. The GUI agent's
|
thinking `budget_tokens` mapping, or prompt-cache token accounting. Base/host agent
|
||||||
**isolated mode** (Docker-container runner) is still to come; base/host agent mode,
|
mode, per-session settings (copy-on-create), session notes, immutable names,
|
||||||
per-session settings (copy-on-create), session notes, immutable names, personal
|
personal workspace folders and file/image upload (shared store, token-based
|
||||||
workspace folders and file/image upload (shared store, token-based routing,
|
routing, images via Vision) work. Per-tool host/container sandboxing was
|
||||||
images via Vision) work.
|
**deliberately dropped**: protection comes from where you run the framework
|
||||||
|
(container / VM / isolated host), not from a second tool backend.
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
**Next headline feature — semantic vector memory (scheduled, not built).** A
|
||||||
|
Qoder-style vector database giving the agent long-term, cross-session semantic
|
||||||
|
recall, useful well beyond coding: embed and index conversation chunks, session
|
||||||
|
notes, uploaded documents and learned facts, then retrieve by similarity to inject
|
||||||
|
the relevant context into a turn, plus explicit *remember* / *semantic search*
|
||||||
|
tools. Recommended shape, preserving the single-binary property: an embedded
|
||||||
|
vector index inside the existing SQLite store (**sqlite-vec**) behind the `Store`
|
||||||
|
trait, fed by a small local multilingual embedding model run in-process. The
|
||||||
|
planned ArangoDB backend already offers vector indexes, so the same seam carries
|
||||||
|
over when the store is swapped.
|
||||||
|
|
||||||
## License and credits
|
## License and credits
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -1,12 +1,13 @@
|
|||||||
//! The GUI agent: a bounded model↔tool loop that lets the UI-managed model act.
|
//! The GUI agent: a bounded model↔tool loop that lets the UI-managed model act.
|
||||||
//!
|
//!
|
||||||
//! The agent's universal tool is `shell_exec` (see [`shell`]). The execution mode
|
//! The agent's universal tool is `shell_exec` (see [`shell`]). Execution runs on
|
||||||
//! is chosen by the [`shell::ShellRunner`] implementation: base mode runs on the
|
//! the host ([`shell::HostShell`]) behind the [`shell::ShellRunner`] seam, which
|
||||||
//! host ([`shell::HostShell`]); the isolated mode will route to a sandboxed runner
|
//! is kept for tests and alternate runners. There is no per-tool host/container
|
||||||
//! (e.g. the team's Docker-container MCP server) behind the same seam.
|
//! split: stronger protection comes from running the whole framework inside a
|
||||||
|
//! container, VM or isolated machine, so the agent only sees that environment.
|
||||||
//!
|
//!
|
||||||
//! [`run_loop`] is pure orchestration — generic over the "model step" — so it is
|
//! [`run_loop`] is pure orchestration — generic over the "model step" — so it is
|
||||||
//! testable without the engine and independent of the execution mode.
|
//! testable without the engine and independent of the concrete runner.
|
||||||
|
|
||||||
pub mod shell;
|
pub mod shell;
|
||||||
|
|
||||||
|
|||||||
+8
-6
@@ -2,9 +2,11 @@
|
|||||||
//! output. A shell is a universal tool — with it the agent can do file ops, run
|
//! output. A shell is a universal tool — with it the agent can do file ops, run
|
||||||
//! programs, inspect the system, fetch the web via curl, git, etc.
|
//! programs, inspect the system, fetch the web via curl, git, etc.
|
||||||
//!
|
//!
|
||||||
//! Execution sits behind the [`ShellRunner`] seam. Base mode ([`HostShell`]) runs
|
//! Execution sits behind the [`ShellRunner`] seam and runs on the host
|
||||||
//! directly on the host (a trusted machine); an isolated/sandboxed runner can
|
//! ([`HostShell`]). Protection is an environment boundary: run the framework
|
||||||
//! implement the same trait later without touching the agent loop.
|
//! itself in a container, VM or isolated machine for stronger isolation — there
|
||||||
|
//! is no separate per-tool sandbox backend. The trait stays for tests and
|
||||||
|
//! alternate runners.
|
||||||
|
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
@@ -56,8 +58,8 @@ impl ShellOutput {
|
|||||||
|
|
||||||
type ShellFuture<'a> = Pin<Box<dyn Future<Output = Result<ShellOutput>> + Send + 'a>>;
|
type ShellFuture<'a> = Pin<Box<dyn Future<Output = Result<ShellOutput>> + Send + 'a>>;
|
||||||
|
|
||||||
/// The execution seam: base mode runs on the host; a sandboxed runner replaces it
|
/// The execution seam: runs on the host by default; alternate runners (e.g. in
|
||||||
/// for the isolated mode. Dyn-compatible so the agent loop can hold `Arc<dyn _>`.
|
/// tests) implement the same trait. Dyn-compatible so the loop can hold `Arc<dyn _>`.
|
||||||
pub trait ShellRunner: Send + Sync {
|
pub trait ShellRunner: Send + Sync {
|
||||||
fn run<'a>(
|
fn run<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
@@ -67,7 +69,7 @@ pub trait ShellRunner: Send + Sync {
|
|||||||
) -> ShellFuture<'a>;
|
) -> ShellFuture<'a>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Base mode: execute directly on the host via `bash -lc`.
|
/// Execute directly on the host via `bash -lc`.
|
||||||
pub struct HostShell;
|
pub struct HostShell;
|
||||||
|
|
||||||
impl ShellRunner for HostShell {
|
impl ShellRunner for HostShell {
|
||||||
|
|||||||
+2
-2
@@ -523,8 +523,8 @@ pub(crate) async fn session_chat(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Base mode: the host shell. Isolated mode will swap in a Docker-MCP
|
// The host shell behind the ShellRunner seam (no per-tool sandbox:
|
||||||
// runner behind the same ShellRunner seam. Commands default to the
|
// protection is where the framework runs). Commands default to the
|
||||||
// session's personal folder (its home base).
|
// session's personal folder (its home base).
|
||||||
let runner: Arc<dyn ShellRunner> = Arc::new(HostShell);
|
let runner: Arc<dyn ShellRunner> = Arc::new(HostShell);
|
||||||
if let Err(env) = agent::run_loop(
|
if let Err(env) = agent::run_loop(
|
||||||
|
|||||||
Reference in new issue
Block a user