You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mode B: symbi run spawns a governed Claude Code subprocess (executor=claude_code path via CliExecutor with the SYMBIONT_* env handshake, stdio symbi mcp back-channel, max-turns primary bound + graceful SIGTERM/SIGKILL timeout); add code_reviewer agent, cli-executor on by default, and Mode B docs
| E2B (hosted) |`with { sandbox = "e2b" }` (DSL only — no `--sandbox` flag) |`E2B_API_KEY` env var | Quick-start demos, evaluation without setting up a sandbox host. **Not for production workloads with privacy or compliance requirements.**|
134
134
135
+
## Managed CLI agents (Mode B)
136
+
137
+
An agent whose metadata declares `executor = "claude_code"` is run by spawning a
138
+
governed Claude Code subprocess via `crates/runtime/src/cli_executor` (the
139
+
`cli-executor` feature, on by default) instead of the ORGA reasoning loop. The
140
+
reference agent is `agents/code_reviewer.symbi`; the path lives in
141
+
`src/commands/managed_cli.rs`.
142
+
143
+
`symbi run code_reviewer --target <dir>`:
144
+
- passes the spawn through the policy Gate (fail-closed; allow via Cedar or
145
+
`SYMBI_INSECURE_ALLOW_ALL=1`);
146
+
- injects the env handshake `SYMBIONT_MANAGED=true`, `SYMBIONT_SESSION_ID`,
147
+
`SYMBIONT_BUDGET_TOKENS`, `SYMBIONT_BUDGET_TIMEOUT`, `CLAUDE_PROJECT_DIR` (the
148
+
symbi-claude-code plugin defers its hooks to the outer Gate on `SYMBIONT_MANAGED`);
149
+
- loads the plugin via `--plugin-dir` (resolve order: `--plugin-dir` flag,
150
+
`SYMBIONT_CLAUDE_PLUGIN_DIR`, then sibling-repo autodetect) and wires the stdio
151
+
`symbi mcp` back-channel via `--mcp-config --strict-mcp-config`;
152
+
- bounds the run with `--max-turns` (primary, cooperative) and `--budget-timeout`
153
+
(hard wall-clock backstop; `CliExecutor` kills with graceful SIGTERM → SIGKILL).
154
+
155
+
Do **not** pass `--bare` to the spawned `claude` — it skips reading `~/.claude`
156
+
(credentials included) and breaks subscription auth.
157
+
135
158
## ToolClad Tools
136
159
137
160
Tools live in `tools/<name>.clad.toml` and are auto-discovered at startup by `symbi up`, the HTTP Input server, and `symbi tools`. The watcher (`crates/runtime/src/toolclad/watcher.rs`) hot-reloads on file changes — no restart needed.
| E2B (hosted) |`with { sandbox = "e2b" }` (DSL only — no `--sandbox` flag) |`E2B_API_KEY` env var | Quick-start demos, evaluation without setting up a sandbox host. **Not for production workloads with privacy or compliance requirements.**|
134
134
135
+
## Managed CLI agents (Mode B)
136
+
137
+
An agent whose metadata declares `executor = "claude_code"` is run by spawning a
138
+
governed Claude Code subprocess via `crates/runtime/src/cli_executor` (the
139
+
`cli-executor` feature, on by default) instead of the ORGA reasoning loop. The
140
+
reference agent is `agents/code_reviewer.symbi`; the path lives in
141
+
`src/commands/managed_cli.rs`.
142
+
143
+
`symbi run code_reviewer --target <dir>`:
144
+
- passes the spawn through the policy Gate (fail-closed; allow via Cedar or
145
+
`SYMBI_INSECURE_ALLOW_ALL=1`);
146
+
- injects the env handshake `SYMBIONT_MANAGED=true`, `SYMBIONT_SESSION_ID`,
147
+
`SYMBIONT_BUDGET_TOKENS`, `SYMBIONT_BUDGET_TIMEOUT`, `CLAUDE_PROJECT_DIR` (the
148
+
symbi-claude-code plugin defers its hooks to the outer Gate on `SYMBIONT_MANAGED`);
149
+
- loads the plugin via `--plugin-dir` (resolve order: `--plugin-dir` flag,
150
+
`SYMBIONT_CLAUDE_PLUGIN_DIR`, then sibling-repo autodetect) and wires the stdio
151
+
`symbi mcp` back-channel via `--mcp-config --strict-mcp-config`;
152
+
- bounds the run with `--max-turns` (primary, cooperative) and `--budget-timeout`
153
+
(hard wall-clock backstop; `CliExecutor` kills with graceful SIGTERM → SIGKILL).
154
+
155
+
Do **not** pass `--bare` to the spawned `claude` — it skips reading `~/.claude`
156
+
(credentials included) and breaks subscription auth.
157
+
135
158
## ToolClad Tools
136
159
137
160
Tools live in `tools/<name>.clad.toml` and are auto-discovered at startup by `symbi up`, the HTTP Input server, and `symbi tools`. The watcher (`crates/runtime/src/toolclad/watcher.rs`) hot-reloads on file changes — no restart needed.
|[Code Reviewer (Mode B)](#code-reviewer-mode-b)| Governed Claude Code subprocess |`executor = "claude_code"`; spawns Claude Code under CliExecutor with the `SYMBIONT_*` handshake |
24
+
25
+
### Mode B: Governed Claude Code
26
+
27
+
**Code Reviewer** (`code_reviewer.symbi`) is the reference *managed-CLI* agent. Its
28
+
metadata declares `executor = "claude_code"`, so `symbi run code_reviewer` spawns
29
+
a governed Claude Code subprocess via the runtime's `CliExecutor` instead of the
30
+
LLM reasoning loop. The spawn passes the policy Gate, sets the `SYMBIONT_MANAGED`
31
+
handshake (the symbi-claude-code plugin then defers its hooks to the outer Gate),
32
+
and wires the stdio `symbi mcp` back-channel.
33
+
34
+
```bash
35
+
# Allow the spawn at the Gate via a Cedar policy, or for local dev:
36
+
SYMBI_INSECURE_ALLOW_ALL=1 symbi run code_reviewer --target /path/to/repo \
37
+
--max-turns 12 --budget-timeout 15m
38
+
```
39
+
40
+
`--max-turns` is the primary cooperative bound; `--budget-timeout` is a hard
41
+
wall-clock backstop. See the "Mode B" section of `docs/getting-started.md` for the
system_prompt = "You are a senior code reviewer running under Symbiont governance. Review the working tree (prefer the staged and unstaged diff) for correctness bugs, security issues, and clarity problems. Do NOT modify files. Produce a concise, severity-tagged list of findings with file:line references and a one-line summary verdict."
10
+
}
11
+
12
+
# Mode B (ORGA-managed) agent.
13
+
#
14
+
# `symbi run code_reviewer` reads `executor = "claude_code"` from the metadata
15
+
# above and takes the deterministic CliExecutor path instead of the ORGA
16
+
# reasoning loop. It spawns one governed Claude Code subprocess with:
0 commit comments