Skip to content
codecoradevPublic

About

Durable Rust agent harness: chat-first personal assistant with mission mode — resumable after crashes, replayable forever

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

tole

CI crates.io crates.io License: MIT

Durable Rust agent harness: a conversational agent with risk-tiered approval gates, a write-once JSONL session log, and a register state machine — resumable after crashes, replayable forever.

Status: v0.12.0 is the latest release (see CHANGELOG.md; its BREAKING changes, each with how to opt out, are listed first under [0.12.0]; the 0.11 changes, each with its migration step, are in docs/migrating-0.11.md). 0.10 shipped the inline terminal UI (tole-tui, bare tole on a TTY). 0.11 is the automation and secrets release:

  • Automation: tole cron (scheduled script and agent jobs, per-job time zones, parked approvals resumed from /approvals), tole hook and POST /hooks/<route> on tole serve (signed webhooks that fire a cron job), outbound signed webhooks ([webhook_out.<name>] in the user config: a finished cron run, approval requests and (opt-in) a finished serve turn are posted to a receiver such as a chat gateway; tole webhook test), tole route (model routing by task weight), and tole serve --cron as the in-process ticker.
  • Profiles and delegation: [profiles.<name>] personas (--profile), the delegate tools (budget carved from the parent, depth-limited, one completion report per child), tole audit [goal] [--json] to read the tree, an opt-in approval queue for delegated children (tole delegation approvals), the advisor tier (consult_advisor) and tole discuss / the discuss tools for budgeted multi-round discussions (tole audit --discussions reads them).
  • Skills: approval is required by default (tole skills approve), agents grow skills only through drafts (skill_propose, tole skills drafts), and tole curator keeps the library small.
  • Plugins: every MCP server needs the owner's approval, pinned in a plugin lock (tole plugin list|diff|audit|approve|revoke|add); third-party skills are pinned by approved hash with a stated source in an append-only ledger.
  • Secrets: scoped release with [secrets], known-value redaction at every egress sink and in the session log, sensitive files read redacted (read_file_raw for the verbatim read), and owner-only subcommands that refuse under a session (docs/threat-model.md).
  • Sandbox: third-party stdio MCP servers can run in bubblewrap (Linux, opt-in), and [sandbox.consumers] does the same for model commands. Since 0.12 the mission --verify command and the --on-turnend stop gates are sandboxed BY DEFAULT (optional): sandboxed where bubblewrap works, run unsandboxed with a loud warning only on a host with no sandbox at all. A cargo-based verify cannot see ~/.cargo inside it, so set verify = "off" / turnend = "off" under [sandbox.consumers] in the user config to opt out (see CHANGELOG.md and docs/sandbox-design.md §9.4).
  • 0.12 (face parity and the gateway events): a tole serve session now gets the default prompt, approved skills and model routing like tole chat does, serve and acp sessions attach the owner's MCP client servers behind the plugin lock (epic #941), and serve adds fork, compact, rename, missions and plan mode per session (docs/faces.md); signed outbound webhooks gain the opt-in turn_finished event. Breaking: verify and turnend are sandboxed by default (verify = "off" under [sandbox.consumers] opts out), POST /approvals/{id}/decision acts only on the first decision, and the uteke home moves under CODECORA_HOME.
  • Web: built-in web_search and web_fetch, with an optional nginjen backend.

The multi-client daemon stays design-only (docs/daemon-design.md); the UI-client seam of tole serve (transcript pages, SSE events, image upload) is in, with tole serve --socket <path> (a Unix socket in a private directory, a per-launch --token-fd credential, and protocol/version on /health; macOS, Linux and Windows (the Windows one is a named pipe behind the same seam, #1051)). tole serve (both transports) now stops gracefully on SIGTERM and SIGINT on Unix: new requests get 503, running turns are detached and stay resumable, and it exits 0 once drained or non-zero after --shutdown-grace (default 20 s) or a second signal, see docs/mobile-control.md (#1014). The desktop client (a thin client of a local tole serve, a remote server later) is un-parked and planned in issues #1028 to #1044 (in so far: the crates/tole-desktop-model and crates/tole-desktop crates with the app shell window behind the off-by-default gpui feature, their guardrails, a Desktop CI workflow and an offscreen render harness for UI review (scripts/desktop-render.sh), and the typed tole-client, #1028 and #1040, the supervisor of the local serve and the connections model of #1029, and the approvals and task drivers that keep the approvals queue and one task true to a serve, the skills driver that keeps the Skills and Connected tools pages true to GET /skills and GET /tools (read-only), the Skills and Connected tools pages (#1034: read-only, each tab shows the model's states, not read yet, reading, failed, partial or the rows, and refreshes every 30 seconds and on a button; the owner approves a skill or trusts a tool at a terminal, never from the window), the automations driver that keeps the Automations page true to GET /cron/jobs and GET /cron/runs and pauses or resumes a job once per press, showing the new state only after the serve answered (the Automations page uses it, see below), and the backend that starts the approvals, skills and automations drivers, and one task driver for each task the window opens (at most three, the fourth is refused), when the supervisor's serve is ready and stops them when it is not or was replaced (the open tasks are kept and started again), and gives the window one plain-data view, with a pure function that applies it to the shell state (the sidebar counts and the connection dot; an unknown count is never written as zero), and the app module that starts the serve for the folder the app was started in, off the window's thread, keeps the backend following it and bounds every wait when the window closes, and the window that shows it: on macOS and Linux cargo run -p tole-desktop --features gpui in the folder to work in opens the window on the real local serve (the connection dot and the approvals and skills counts follow it, an unknown count shows ? and never 0, and while the serve is not ready a line says why, with a Try again or Restart Tole button; closing the window leaves the serve running; the folder / and the home folder are refused, with a notice and no serve; the window shows the folder it was started in even when an already running serve of another folder is reused, because attaching does not compare workspaces, which is still the open owner decision D8; the ordered stop of the backend on close is skipped, silently, when the toolkit still holds its handle to the app, and the process then just ends); the task view of #1031 uses a driver for each task: the "New task" button of the home page makes a session in the selected folder (Backend::new_task, one call on a short-lived thread, refused at once, asking the serve nothing, when three tasks are open, when the serve is not ready or while the last one is still being started (one call at a time, so two clicks make one session), and each of those, and a serve that could not make the session, is told on the home page in its own words) and opens it as a task, up to three, as tabs; the main area of an open task shows the transcript from the driver's window of rows (the owner's words as a bubble, Tole's answer as Markdown that never opens a link, a "Working" group that folds with its technical details one click further, a plan, a thinking and a writing mark; a long task builds only the rows near the screen, the list reports the heights it measured back, keeps a running task at its end until the owner scrolls up and keeps the text being read in place, with "Jump to latest"), the status row (the sentence and its dot from the model, the "Look only" chip (always off for a task this window starts, which is created without plan mode; reading it from a session opened elsewhere is not built), Stop while a turn can be stopped) and the composer (a box that grows; Enter sends, Shift+Enter breaks the line and Enter while an input method composes is the input method's, by the model's rules; a note while a turn runs, shown as the owner's words without the wrapper core adds for the model; the words come back into the box when the driver refuses the command or fails the send, never after the transcript showed the message, and stay in the box with a note when no driver can take them; closing a tab drops its unsent words); a section of the sidebar takes the main area back and the tasks stay open as tabs; still open on the task view: the right panel (Files, Changes, History, Usage), image attachments, the approval card in the task, opening a past task from the sidebar (the sessions grouped by folder are #1030), the scroll rate of a 2,000-entry session on a real laptop (the render harness recorded a median of 11 ms and a 95th percentile of 23 ms per frame for 2,000 rows in a debug build with software rendering), and the hand check of an input method on macOS and Linux; the Skills and Connected tools pages use drivers too, and so does the Approvals page (#1032: the Waiting and Decided lists and the card, answered once with "Allow once" or "Don't allow" through the approvals driver; the card inside the task view and the link back to the task are not built yet), and so does the Automations page (#1033: the table of automations with its on/off switch, whose state moves only when the serve answers, the count at the right of the top bar only for a list that was read, is current and is all of the jobs, a list that was not read never drawn as an empty one, the notices and the note about where the scheduler runs; a press on a row, a switch or the dismiss button goes to the driver by the exact id of the row; the history of a run, the link from it to Approvals and the render scenes are not built yet), and the other pages are not built yet); the owner decided on 2026-11-27 that the desktop goes full native Rune and that the Rust core stays (this replaces the 2026-11-25 React on GPUIX decision of the closed epic #1241; the GPUI renderer is frozen, fixes only, until the Rune parity gate and the owner's go; Rune is a git dependency, allowed in deny.toml as the one named git source (owner decision 2026-12-02); the Rune gate harness and its CI are in, in a second workspace desktop/ (F1.2, F2), and the F1 gates are recorded with a proposed go with conditions on 2026-12-03, pending the owner's confirmation, the owner having directed F3 to start (the R2 and R3 checks on the owner's Mac and the GPUI baseline are still open); the Rune shell (rail, header, sidebar, status line and notice, in desktop/ui, F3 step 1) is built from the model; the home page (board S2) is drawn in it, and the other five boards are not built yet); the design note with the owner's decisions and the screen drafts is docs/desktop-design.md. A container recipe for a remote tole serve (a Dockerfile, a compose file with a TLS proxy that keeps the event stream unbuffered, and the threat-model notes) is in docs/container.md; it was run end to end on one Docker host with a stand-in provider (the committed Dockerfile was built there on 2026-11-29 for amd64 with two sandbox-forced differences, no apt-get step and the proxy CA for cargo, and not for arm64, see its "What was and was not verified"; a recipe for the same server without Docker, as a systemd service whose unit was syntax-checked but not yet run under systemd, is docs/vps-without-docker.md), and a workflow (.github/workflows/container.yml, #1015) builds it for linux/amd64 and linux/arm64 and publishes it to ghcr.io/codecoradev/tole in two channels: nightly from develop and, from a release tag, X.Y.Z, X.Y and stable (no latest; "Channels and tags" in the page). It has not run yet, and the package is made public by a one-time owner step (#1015; #1044). Five faces on one durable core: the CLI (run / chat / resume / sessions / jobs / mission), tole mcp (tool server), tole acp (editor agent), tole serve (REST + multi-session MCP-over-HTTP daemon), and the inline terminal UI (tole-tui, bare tole on a TTY; MVP stage, docs/tui.md); what the faces share and the few differences that are deliberate are in docs/faces.md. Identity (owner-approved): a chat-first personal assistant WITH a mission mode for autonomous work — budgeted turn-chaining (tole mission --max-steps/--max-minutes/ --max-tokens/--verify), durable task-list tools (todo_write/ todo_read), cost reports, and remote approvals via the serve face (the 0.9.0 mobile track consumes them from a phone). Shipped in 0.7.0: ACP intra-turn visibility + true text streaming, ACP auto model picker, run ergonomics (--prompt-file/--name/--timeout), read-only web_fetch/web_search (SSRF-guarded), and startup update notification + tole upgrade. See CHANGELOG.md and docs/epics.md.

Ecosystem position

tole is the agent harness of the CodeCora ecosystem — the hands:

  • cora-code (cora) — code intelligence. Attached automatically when the cora binary is on PATH: tole detects the built-in cora mcp server and registers its 18-tool surface (brain search, callers, impact, affected tests, dead-code, review — registry names mcp_cora_*). Opt out with --no-auto-mcp. Code review (cora ≥ 0.19): with the review tools attached, the system prompt names cora's agent-as-reviewer flow — the model passes a diff to mcp_cora_cora_review_prepare, judges it itself (no LLM key in cora), then calls mcp_cora_cora_review_finalize with the same diff and its findings. Review gate before commit (#534, cora ≥ 0.20.0): while both review tools are attached, a git commit is refused until the STAGED diff has a validated review. tole records and hashes nothing itself: cora's own commit gate does (mcp_cora_cora_review_finalize leaves a marker bound to the exact change set; cora hook verify answers 0 validated / 10 blocking / 11 not validated), and tole asks it before the commit runs. It covers the git tool and run_command / job_start running git commit (a git -C <dir> commit is checked in <dir>; one that redirects git's git dir or work tree, such as --git-dir, GIT_DIR= or -c core.worktree=, cannot be checked and is refused under block); TOLE_REVIEW_GATE=warn lets the commit through with a note, off (or --review-gate off) never gates, and with no review tools attached (--no-auto-mcp, no cora) there is no gate. A cora too old for hook verify fails open with one warning; tole doctor reports the state. It is a guardrail for a cooperating agent, not a security boundary: see the threat model for what it does not see. --trust internal allows the mcp_cora_* tools without prompting. The guidance is in the pinned prompt of run, chat, the TUI and mission (#536). serve and acp sessions attach only the MCP servers the OWNER names (--mcp-server or the user config, read at start-up, through the same plugin lock; a project-config mcp_server is refused at start-up and the cora auto-detection never applies, #946), so they carry the review section when the cora review tools are configured; tole mcp and mission serve their own registry, refuse the flag and have no review tools.
  • uteke (uteke) — semantic memory. uteke_recall (recall) and uteke_document (markdown → durable knowledge) register automatically when the uteke binary is on PATH, and the optional memory loop closes the circle.
  • Supported versions: cora ≥ 0.19.0 and uteke ≥ 0.21.1 (both optional). tole doctor reports each one as supported, too old (with the upgrade command) or not installed. tole setup cora (#535) installs or upgrades cora for you: it runs cargo install cora-code --locked after a [y/N] at a terminal (or --yes; with neither it refuses and exits 2), does nothing when cora is already supported, and --check only reports. Cargo verifies the registry checksum; tole downloads nothing itself.
  • Anything else that speaks MCP over stdio joins the same registry via repeatable --mcp-server name=command [args...] flags. Every MCP server, cora included, needs your approval (#599): on a terminal, tole shows its full tool list once and asks, and the approval pins a hash of its tool names, descriptions and schemas in $CODECORA_HOME/tole/plugins.lock. A server whose tools change later, or that you never approved, is not registered (missions, cron and serve never ask; approve once interactively, or give cron and CI a user lock ahead of time, see the migration note in docs/third-party-plugins-design.md §8); tole doctor shows the state; tole plugin list|diff|approve|revoke manages it (approve --hash <sha256:…> for scripts). Servers that offer prompts show up in tole chat as /mcp:<server>:<prompt> [k=v ...] (rendered server-side, sent as your next message); servers that offer resources add a ReadOnly mcp_read tool. Servers with neither add nothing.
  • Remote MCP servers over Streamable HTTP (#530) use the same flag with a bare url: --mcp-server research=https://mcp.example.com/mcp. The bearer token comes from the environment only, TOLE_MCP_<NAME>_TOKEN (name upper-cased, - becomes _, e.g. TOLE_MCP_RESEARCH_TOKEN), is re-read on every (re)connect and is sent only to that endpoint; it is never accepted in the spec or a config file, and it and the url are scrubbed from errors. The url must be https (plain http only for localhost / 127.0.0.0/8 / ::1), may not contain credentials, and a redirect to another origin is not followed. The tools register as mcp_<name>_<tool> and are always Write like every MCP tool; pre-authorize a trusted read-only server with --allow 'mcp_research_*'. Needs the mcp feature (on by default in tole-cli); embedders without it link no HTTP client.
  • tole as an MCP server: tole mcp serves the registry's hardened tools (jailed file ops, git, jobs, memory) to any MCP client. ReadOnly tools are always callable; Write tools require --allow patterns; Destructive tools are structurally absent.
  • tole as an ACP agent: tole acp speaks the Agent Client Protocol — editors (Zed et al.) drive durable tole sessions, and tool approvals surface as permission requests in the editor. Native pickers via ACP config options (#176): TOLE_MODELS (comma-separated ids) advertises a model switch that persists durably per session across resumes, and an approval selector (ask / auto, session-scoped) plus an allow_always option on Write permission requests let the human relax the gate from the editor without weakening the Destructive tier.
  • tole as an HTTP daemon: tole serve (issue #96) exposes the session host over token-authenticated REST — remote clients create sessions, run turns, and poll status without SSH-ing into the box. Binds 127.0.0.1 by default. --auth basic (#742, first slice: one user, a PBKDF2 password hash from tole serve-hash, TLS at a reverse proxy) adds HTTP Basic next to the bearer token; OIDC and read-only scopes are not built. POST /sessions/{id}/cancel (#178, REST face) stops an in-flight turn — it settles stopReason: "cancelled". POST /sessions/{id}/interrupt (#377) steers the running turn instead, without losing its work: the {"text", "urgent"} message is injected at the turn's next safe point as an attributed entry (409 when no turn is running). POST /sessions {"profile": "<name>"} (#740, create and resume) opens a session as one [profiles.<name>] table of your user config (persona, allow list, memory room, model; fixed for that session). POST /sessions/{id}/detach (#217) stops waiting without aborting: the running tool settles, the turn ends stopReason: "detached" (resumable), and background jobs keep running and nudge the session when they finish (409 when no turn is running). --transport mcp (issue #137) serves multi-session MCP over Streamable HTTP instead: one authenticated MCP connection addresses N durable tole sessions (tole_session_new/prompt/cancel/interrupt/detach/status/list + the registry tools routed to each session's workspace jail).

Every ecosystem integration is probe-first: a missing binary degrades to a one-line warning, never a phantom tool.

Install

cargo install tole-cli        # the `tole` binary from crates.io
# or build from source:
git clone https://github.com/codecoradev/tole && cd tole
cargo build --release -p tole-cli && ./target/release/tole --help
# `mcp-http` (needed by `tole serve --transport mcp`) is a default
# feature since #168 — a plain build/install already includes it.

Quickstart

# Any OpenAI-compatible endpoint works; TOLE_* is canonical,
# OPENAI_* is read as a fallback.
export TOLE_BASE_URL=https://api.openai.com/v1
export TOLE_MODEL=gpt-4o-mini
export TOLE_API_KEY=...

tole run "summarize the last commit"        # one durable turn
tole                                        # terminal UI: bare `tole` on a TTY opens it (streaming transcript, approvals, slash commands)
tole chat                                   # multi-turn REPL on one durable session
tole chat --memory uteke                    # …with cross-session memory
tole chat --resume <id>                     # pick the thread back up (also: --last)
tole resume <id> "next instruction"         # continue a settled session
tole sessions                               # list durable sessions (+ serve profile when set), then the size of the store
tole sessions --all [--grep <text>]         # every project's sessions + where they live
tole sessions --tree                        # sessions with their forks nested
tole sessions archive --to DIR --older-than DAYS [--execute]   # move old, settled session files, unchanged, out of the store (a dry run unless --execute; owner only)
tole branch <id> [--at <entry>]             # fork a session at a settled entry, then resume the fork
tole import-claude <transcript.jsonl>       # import a Claude Code session as cc-<id>, then resume it
tole cron create "@daily" --script "backup.sh"  # scheduled job; `tole cron tick` (every minute from cron/systemd) runs what is due; list|pause|resume|remove|runs
tole cron create "0 9 * * 1-5" "Summarize open PRs" --allow write_file --model M  # agent job; `tole serve --cron` hosts the ticker
tole cron create "@daily" "Triage new issues" --skill triage --profile ops  # agent job with a skill (name or SKILL.md, content pinned on save: a changed skill blocks the run until `cron edit --skill` re-pins) and a user-config profile; Writes need --allow AND the profile's allow
tole cron edit NAME --deliver file:reports/prs.md   # also: run NAME (now), cancel NAME, status (ticker alive?)
tole cron create "@every 15m" "Summarize what changed" --watch folder:inbox  # change watch: checks every 15m (5m to 1d) and runs the job only when `inbox/` (inside the workdir) changed; also `file:PATH` and `command:ARGV` (stdout hashed); the first look is a baseline, taken at the first due tick (a change inside the first interval is missed); --notify-on-no-change shows the quiet ticks
tole hook add gh --key-env GH_HOOK_KEY --job triage --event push --template "commit: {head_commit.message}"  # webhook route in the USER config (never a project one); the key is named, never given or shown; allow_writes/filters are hand edits
tole sandbox set github --profile strict  # bind an MCP server to a sandbox profile in the USER config (never a project one); also: list, show SERVER; profiles are defined by hand in [sandbox.profiles.NAME]
tole route "Summarize open PRs" --kind cron --risk read_only  # dry run of [router] (#586): which tier and model a run would get, the configured model and its source (e.g. `from env TOLE_MODEL`), and why; no provider call
tole pack apply --example daily-digest --workdir ~/notes  # template pack (#1394): shows the plan, asks, then creates what is missing: a profile (persona, no allow) in the USER config, its skills as unapproved text, and PAUSED cron jobs; run it again and it opens what exists, changes nothing; also: apply FILE [--dry-run] [--yes], list. Owner only (refuses under an agent session); enable with `tole cron resume ID`, approve a skill with `tole skills approve NAME --hash H`
tole hook test gh --event push --payload push.json  # local dry run: sign, filter, print the fenced context; fires nothing (--fire --url http://127.0.0.1:PORT posts it to a loopback serve); also: list, remove ROUTE
tole status [id]                            # pc / seq / turns / token + cache usage / request-size split; model, effort, context used/window, tokens, compactions (default: latest session)
tole audit [goal] [--json]                  # this workspace's delegation tree, read-only, capped and redacted (default: list the goals)
tole audit --discussions                    # the multi-round discussions in the data dir, read-only (also: --discussion <ID>)
tole delegation approvals list [--all]      # owner-only (#714): the approval requests of delegated children, read-only
tole delegation approvals show <ID>         # one request in full: who asked, the chain, the call, a redacted input (fenced as data)
tole delegation approvals allow <ID>        # allow ONE call of ONE request: shows it, then type the id back (--yes skips the typing; --fingerprint <HEX> pins the content)
tole delegation approvals deny <ID>         # deny it (no answer is a denial too); allow and deny refuse under an agent session
tole discuss start --question "Q" --criterion "C" --participant coder --participant reviewer --budget 60000 --dry-run  # owner-only multi-round discussion among user-config profiles; the budget is a hard cap, any number of participants is accepted (8 recommended, 16 at most) and the dry run shows the cost for that many; a question over 12000 characters or a criterion over 400 is refused with an error naming the limit, never cut; `--file PATH` (repeat, at most 4) names background files inside the current folder, passed by reference: inline participants read a capped, sanitized excerpt, counted in the dry-run estimate (only known secret values and token shapes are redacted, a `.env`-style file line by line: a password in prose or in a config file goes as written to every inline participant's provider, so name only files you would paste into the question), a path outside the folder, a symlink or a FIFO is refused, and a resume refuses a file that is gone or changed; `--tool SERVER.TOOL` (repeat, at most 8) lets the participants use a connected tool of an MCP server named in the `mcp_server` list of your config, or the cora preset (e.g. `nginjen.search`; a `--mcp-server` flag does not reach the helpers, which are separate processes; a tool name that registration would change, such as one with a `.` or a space, or one over the 64-byte limit, is refused, and the registry name it allows is printed): every participant then runs as an independent read-only child that cannot write or run programs, and the FIRST call of each tool in the discussion is asked of you in the delegation approvals queue (answer it with `tole delegation approvals list|allow|deny` from the same folder; needs `[delegation] approvals = "owner"`), where allow covers that tool for this discussion only; drop --dry-run to run it (also: resume ID, list, show ID)
tole plugin audit [NAME] [--json]           # read-only report: tier, approved vs live manifest hash, grants, sandbox profile, scan findings, last sandbox fallbacks, skills with source and ledger (starts only what `list` would)
tole plugin list                            # every MCP server with its lock state (approved, changed, unapproved, revoked); also: diff NAME, approve NAME [--hash H], revoke NAME
tole skills list                            # discovered skills with approval status and hash; approve NAME [--hash H], revoke NAME, drafts list|show|reject|verdict|promote|revoke, index|retire|search
tole curator status                         # the skill curator: run [--dry-run], restore, pin, lock, adopt, pause, schedule
tole config check                           # effective config values, where each came from, and the trust state; also: trust, untrust
tole setup cora                             # install or upgrade the cora binary (--check only reports, --yes skips the prompt)

Every subcommand has its own --help. The full list is run, chat, resume, mission, sessions, branch, import-claude, status, doctor, audit, discuss, route, cron, hook, pack, plugin, skills, curator, config, approvals, serve, mcp, acp, setup and upgrade. Less common flags worth knowing: tole cron create --catch-up one --grace-minutes N runs one late occurrence after downtime (default skip), --paused saves a job disabled, tole cron tick --max-concurrent N, tole hook add --rate-per-minute N --max-body-bytes N, tole route --kind --job --risk --budget-left, and tole serve --port --bind --transport mcp --cron --token-file --shutdown-grace.

Template packs (#1394). A pack is one TOML file (at most 64 KiB) that holds a profile (persona text), optional skills (text) and agent cron jobs; tole pack apply FILE (or --example daily-digest|release-checklist, two built-in READ-ONLY examples; tole pack list) prints the whole plan, asks [y/N], and creates only what is missing, so applying a pack twice is the same as once. A profile has no paused state, so the safe start is: every job is saved paused (tole cron resume ID enables it), every skill is written unapproved (a job that names it is blocked until tole skills approve NAME --hash H), and no allow is set anywhere (a run can only read). The pack file has no key for allow, grants, a skill path, a workdir, a script, a model name or paused; model_tier is only a printed hint. It writes the profile table into the USER config by text (comments kept) and refuses a name that is a hand-written profile, or an existing one with allow, grants, skills or models; text with hidden characters (zero-width, bidi, tag block, joiners) and a memory_room that is not the profile's own are refused too. apply (--dry-run included) refuses under an agent session; the confirmation is read from stdin and EOF is a no. Not yet: hooks, the cron watch field, directory packs, updating an existing object in place, a catalog. Design: docs/automation-design.md, "Template packs".

Sessions live in .tole/sessions/<id>.jsonl (override with --sessions-dir): append-only, crash-safe, replayable. After a SIGKILL mid-turn the log still parses and tole resume <id> finishes the turn in the same session; a write that was in flight is not run again unless you allow it (its outcome is unknown). Pinned by the kill loops in docs/crash-resume.md, which also lists what a kill test cannot show (a power cut).

Useful flags (all subcommands): --system (persona, pinned in the session header), --workspace <dir> (file-tools jail root), --allow <glob> (repeatable pre-authorization for Write tools, e.g. --allow 'write_*'; run_command:<argv> matches commands by argument, e.g. --allow 'run_command:git status *' — a lone * is "any further arguments", the program is matched literally; a leading ! denies and wins over every allow and --yes, e.g. --allow '!run_command:rm *'; with a command deny set, only commands an explicit run_command: allow names run unattended — everything else asks), --yes (auto-allow every Write; Destructive still prompts), --effort <minimal|low|medium|high> (reasoning effort sent as reasoning_effort; session register beats it across resumes), --mcp-server, --no-auto-mcp (skip the cora auto-preset), --trust <preset> (one-word trust: internal / read_only / workspace — read_only plus write_file/edit_file auto-allowed only inside an explicit --workspace jail, and not for files another tool may execute — dot-paths (.git/hooks, .envrc, .vscode/), build and task files (build.rs, Makefile, package.json, ...) and scripts keep prompting, as do delete_file and run_command; a home or filesystem-root workspace is refused, and the guard is also available as --allow 'write_file@workspace'. Not a sandbox: review what it wrote before you run it), --skill <path> (load a SKILL.md), --plan-mode (read-only wire), --on-turnend <cmd> (final-message gate).

Configuration (environment)

Variable Purpose
TOLE_BASE_URL, TOLE_MODEL, TOLE_API_KEY LLM provider — any OpenAI-compatible endpoint (OPENAI_* equivalents read as fallback)
TOLE_FALLBACK_BASE_URL, TOLE_FALLBACK_API_KEY, TOLE_FALLBACK_MODEL optional reserve provider (#209): a step that fails because the primary is unavailable (connection failure, timeout, 5xx, 429) is retried on the reserve, and the switch is recorded in the session log (tole_route). The reserve needs its own key (the primary's is never sent to another host); the model defaults to the primary's. Request errors (401/403/404/400) never fail over
TOLE_SYSTEM_PROMPT default persona when --system is absent
TOLE_CONTEXT_WINDOW the model's context window in tokens, for context compaction (#440). Without it, tole reads the window from the provider's /models (context_length, max_model_len, ...) once a prompt passes 8k tokens; with neither, compaction stays off. chat, resume and mission compact between turns once a prompt reaches --compact-at (default 0.8) of the window: the settled turns before the last one become one durable compaction entry (a fenced summary), the session file keeps everything, and tole status lists each compaction. --no-compaction (or config no_compaction = true) turns it off; config keys context_window, compact_at. Gateways whose /models carries no window (the fleet gateway lists only id, created, owned_by) never compact on their own: set TOLE_CONTEXT_WINDOW (e.g. 200000); tole doctor --tier catalog warns when no window is known. Overflow recovery: if the provider rejects a request as larger than its context window (HTTP 400/413/422 context_length_exceeded, "maximum context length", ...) the turn ends with the provider's message and (compaction will run on the next resume); the next resume <id> "<prompt>" (or the next chat message) first forces one compaction pass — whatever the window or threshold — then runs the prompt. Compaction stays between turns, never inside one; --no-compaction also disables the recovery pass. The turn that overflowed is kept verbatim, so if it alone exceeds the window, ask for less output per turn
TOLE_REASONING_EFFORT reasoning effort sent as reasoning_effort on chat completions (#457): minimal, low, medium or high; unset (default) sends nothing, so the request body is unchanged. Also --effort <level> (flag > env > config reasoning_effort > user config). A session's durable fact/reasoning_effort register overrides it, so a session keeps its level on resume. A provider that answers HTTP 400 naming reasoning_effort gets ONE retry without it (remembered for the rest of the turn and recorded under tole_degraded in the step's usage row); an invalid level is a startup error. tole config check shows the effective value and its source
TOLE_VISION 0 declares the model non-vision: image input (--image) fails with a model-capability error before any request; 1 declares it vision-capable. Unset = the server decides (a 400/415/422 that names images becomes the same capability error)
TOLE_SKILL skill files to preload (SKILL.md paths, separated like PATH); same as repeated --skill, which replaces it; refused by tole mcp and mission like --skill (serve and acp load skills, #945)
TOLE_SKILL_APPROVAL required (default since 2026-11-11, #591) or off (every discovered skill loads, the old behaviour; environment only, no config file can set it): a discovered skill loads only when its whole directory hashes to the owner's approval; a session with unapproved skills prints one startup note with the count and the fix, and tole doctor shows the same. --skill <file> and a profile's skills are not gated (you named the file). Approve with tole skills approve <name> (--hash <sha256:…> to pin the hash you reviewed), check with tole skills list (status, hash, approval time), undo with tole skills revoke <name>; tole skills fetch <registry-id> --pinned-sha <sha256> approves a skill you placed yourself after checking its hash against your pin and uteke's record (terminal only, downloads nothing, #878); `tole skills adopt
TOLE_MEMORY memory loop backend (uteke) — same as --memory uteke
TOLE_NO_UPDATE_CHECK 1 disables the startup update-check banner (issue #220)
TOLE_SKILL_INDEX which skills a session is shown (#590): local (default; every discovered skill is listed, as before) or uteke (the pinned core plus the top K recalled by meaning from the uteke skill library (uteke skill search, uteke >= 0.24.1; an older uteke falls back to uteke doc with a note) for the run prompt, and the skill_search tool; an interactive session gets the pinned core only). With --profile <name> only skills scoped to that profile (or unscoped) are recalled. Every query is redacted against the process secrets before it reaches uteke. Index the skills first with tole skills index. uteke without the binary falls back to local with a note; anything else fails startup
TOLE_SKILLS_PINNED comma-separated skill names always listed with TOLE_SKILL_INDEX=uteke (at most 5; a name with no local skill is skipped with a note)
TOLE_SKILL_RECALL_K skills recalled by meaning per task, 0 to 10 (default 5); anything else fails startup
TOLE_SKILL_FLOOR cosine similarity floor for that recall, 0.0 to 1.0 (default 0.35: a documented starting value, not a calibrated one; check it with tole skills search on your own store); fewer or zero skills is fine
TOLE_REVIEW_GATE off / warn / block (default): what a git commit does while the cora review tools are attached and its staged diff has no validated review (#534); --review-gate sets it and wins; anything else fails startup. Also a config key review_gate (flag > env > config > user config); a project's .tole/config.toml can keep or tighten the gate but never loosen what your user config sets (the stricter of the two layers applies), and the key is covered by the project-config trust gate
TOLE_DISCUSSION_TIMEOUT_SECS request timeout of one discussion provider call, in whole seconds, 1 to 3600 (default 120); beats the user config's [discussions] request_timeout_secs (#786). It may go below that key's 10 s floor: it is the test hook (#813), not a setting to rely on. Anything else (text, 0, above 3600) stops tole at startup naming this variable. A project config cannot set it
TOLE_REQUEST_TIMEOUT_SECS request timeout of one chat or mission provider request, in whole seconds, 30 to 3600 (default 900, was a fixed 120); beats the user config's [provider] request_timeout_secs (#1236). The global timeout of one request (connect, send and reading the whole streamed reply); a timeout is still a transient failure and is retried. tole doctor's own short probes and discussion calls do not use it (see TOLE_DISCUSSION_TIMEOUT_SECS). Anything else (text, 0, below 30, above 3600) stops tole at startup naming this variable. A project config cannot set it
TOLE_THEME TUI color theme (#463): default, light or mono; beats the user config's [tui] theme. A set, non-empty NO_COLOR selects mono when neither is set. An unknown name falls back to default with a note. A project config cannot set it
TOLE_VERBOSE 1 prints the startup probe misses (uteke / cora binary not found, no GitHub origin), which are silent by default; tole doctor reports the sibling binaries either way
TOLE_MEMORY_NAMESPACE override the loop's uteke room (default: repo-<directory name>; the name predates rooms)

Image input

tole run|chat|mission --image <path|data-url> (repeatable) attaches images to the first message (#212). Any later message can carry images too (#559): in tole chat, type /image <path|data-url> to queue one for your next message (/image lists the queue, /image clear empties it; a message that could not be recorded keeps its images queued). The TUI has the same /image, and pasting a single image path or data:image/… URL attaches it (#560; no OS clipboard images in a terminal). tole acp accepts ACP image content blocks (base64 data), advertises promptCapabilities.image, and runs an image-only prompt; the blocks take the same spill-and-reference path as a data: URL, the declared mimeType is not trusted (the bytes are sniffed), the optional uri is never read, and audio or embedded-resource blocks are still ignored. A path must resolve inside the workspace jail (symlinks and .. escapes are refused); an inline data:image/…;base64,… URL is spilled to ~/.codecora/tole/images/ first. PNG, JPEG, GIF and WebP (sniffed from the bytes), 10 MiB each. The wire carries OpenAI-compatible image_url content parts; the session log stores only the reference (path, mime, bytes, fnv1a64), and every later step — including resume — re-reads the file, re-checking the jail and the hash (a changed or missing file reaches the model as an [image unavailable: …] note, never silently). Images are input, not tools: no approval is involved. They cost tokens on every step (the data URL counts in the request's tole_wire.history_chars). Needs a vision model; a non-vision model is a loud model-capability error, not a dropped image. Image content is untrusted input (text inside an image can carry instructions, like a fetched web page). There is no model-callable image tool: images are always supplied by the user (see the threat model).

tole serve takes images too (#558): POST /sessions/{id}/images (raw body) stores an upload under ~/.codecora/tole/images/serve/, a prompt references it with "images": [<id>], and GET /sessions/{id}/images/{fnv1a64} reads back an image the session's log records. Quotas: TOLE_SERVE_IMAGE_SESSION_QUOTA (bytes, default 64 MiB per session) and TOLE_SERVE_IMAGE_TOTAL_QUOTA (bytes, default 512 MiB). See docs/mobile-control.md.

Provider retries

A transient provider failure is retried inside the turn, up to 3 times (4 attempts), before the turn fails: HTTP 429, any 5xx, connection or timeout errors, a stream read failure and an empty completion (no content and no tool calls, streaming or not). Waits are 1 s, 2 s, 4 s plus up to 25% jitter; a Retry-After header in seconds replaces the wait, capped at 30 s. Other 4xx errors (auth, model, invalid request) fail immediately. Each retry is written to the session log as a provider transient failure, retrying error entry before the wait, the wait ends early on cancel (Esc, ACP session/cancel), and the budget is per turn, not per step. With a reserve provider (#209) a failed step still fails over first; retries run when every provider in the chain has failed. An empty completion that outlasts its retries fails the turn without trying the reserve.

Provider doctor

tole doctor answers "is this provider/model actually usable?" in tiers:

--tier Checks
offline config resolves, base URL shape, key present (no network)
catalog (default) live GET /models; the configured model must be served. Also warns (!, exit code unchanged) when no context window is known for it — compaction then stays off until TOLE_CONTEXT_WINDOW / context_window is set
full a chat call, a streamed call and a real tool-call loop (spends a few tokens)

Tiers are cumulative and stop at the first blocker, which is printed with the command that fixes it. The exit code is non-zero when the requested tier is not reached, so tole doctor --tier full is the gate for "ready to release" claims. API keys and URL credentials never appear in the output.

After the provider tiers, an ecosystem: section reports the sibling binaries against the supported floor (cora ≥ 0.19.0, uteke ≥ 0.21.1). It is informational: an old or missing sibling never fails the run.

Every run is recorded in a coverage ledger ($CODECORA_HOME/tole/doctor-ledger.json, owner-readable only: level reached, first blocker, fix, timestamp per provider

  • model; --no-ledger skips it). tole doctor --summary prints READY n-of-m plus the first blocker and its fix command without running anything; the latest run wins per provider + model, so re-run --tier full before a release claim.

Configuration (project and user files)

<cwd>/.tole/config.toml (no parent-directory walk) holds per-project defaults. It is loaded by every command except config, upgrade and approvals; use --config <path> to name another file (a path given on the command line is trusted without a trust record) or --no-config to ignore any file entirely (no discovery, no trust check, no output). When a config is loaded, one line tole: using config <path> goes to stderr. Precedence: flag > env > config > default, and a project without a config file behaves exactly as before.

User config (#433). $CODECORA_HOME/tole/config.toml (default ~/.codecora/tole/config.toml) holds a user's global defaults with the same keys and validation, e.g. a skill to preload everywhere. It sits below the project file: flag > env > config > user config > default, key by key (a project key replaces the user key, lists included). It needs no trust record (it lives outside any repository, like the trust store), prints tole: using user config <path>, and --no-config ignores it too (when the user config sets [sandbox] or [secrets], --no-config needs a terminal, see the sandbox design note). tole config check lists both files and shows which layer wins each key.

Keys. Every key is optional; the schema is strict (an unknown key, a wrong type or a secret-like key is an error with file:line; the file is capped at 64 KiB).

Key Mirrors Effective value
model, base_url, system_prompt, memory the provider env, --system, --memory flag > env > config
sessions_dir, workspace --sessions-dir, --workspace flag > config > default
[mission] max_steps, max_minutes, max_tokens mission --max-* flag > config > default (160 / 60 / 4,000,000)
[tui] theme, [tui.colors] TOLE_THEME, NO_COLOR user config only (a project's [tui] is ignored with a warning): env > user config > NO_COLOR (mono) > default; see docs/tui.md
[mission] verify, verify_timeout mission --verify, --verify-timeout flag > config > default (300)
[mission] turn_cap_trips (none) config > default (3, #1239): how many consecutive turns a tole mission tolerates at the per-turn step cap before it stops as exhausted_turn_cap; must be at least 1, 0 is a startup error
[discussions] request_timeout_secs TOLE_DISCUSSION_TIMEOUT_SECS user config only (a project's [discussions] is ignored): env > user config > default (120); the config accepts 10 to 3600 seconds (1 to 9 is an error naming the key and the floor, #813), the env 1 to 3600. The global timeout of ONE discussion provider call (connect, send and reading the whole reply, which is not streamed), not an idle timeout; raise it for reasoning models that think for minutes. An invalid env value is a startup error. tole config check and tole doctor show the effective value and its source
[discussions] outcome_template - user config only: prose (default) or decision-table (#1047); anything else is a load error naming both. With the table, tole discuss start, resume and show <id> add a table of the last digest of a reported discussion (item, value, source, confidence) after the text; local, no model call
[provider] request_timeout_secs TOLE_REQUEST_TIMEOUT_SECS user config only (a project's [provider] is ignored): env > user config > default (900); 30 to 3600 seconds for both, anything else is a startup error naming the key and the range. The global timeout of ONE chat or mission provider request, not an idle timeout; raise it for reasoning models on a loaded gateway that think for minutes. tole config check and tole doctor show the effective value and its source
[cron] daily_token_cap (none) user config only (a project's [cron] is ignored): tokens all cron agent runs of one UTC day may spend; past it they settle budget
[delegation] max_depth, max_live_processes, goal_budget, goal_steps, goal_minutes (none) user config only (a project's [delegation] is ignored): depth below the orchestrator (1–3, default 2), delegated processes live at once before spawns queue (default 8), and a goal's default budget (1,000,000 tokens, 400 steps, 120 minutes; used by the delegate tool, next PR)
[delegation] min_free_memory_mb, child_memory_mb, max_load_per_cpu, min_free_disk_mb, min_free_pids_percent, spawn_interval_secs, machine_max_live, child_nice 1024, 512, 1.5, 2048, 10, 2, max(2, CPUs), 10 user config only: the machine resource guard delegate and delegate_poll run before every delegated launch. A child starts only when the machine-wide live count is under machine_max_live, the last start was at least spawn_interval_secs ago, free memory covers min_free_memory_mb plus child_memory_mb for it and each child still ramping up (cgroup v2 limits count), the one-minute load per CPU is at most max_load_per_cpu, min_free_pids_percent of the process-id limit is free, and min_free_disk_mb is free on the data dir, workspace and worktree filesystems; otherwise the spawn waits in the queue, and the replies carry its queued_reason and waited_secs (tole doctor shows the headroom). Children run at niceness child_nice. Zero, negative or absurd values are config errors
[delegation] approvals, approval_secs, approval_level_secs "off", 900, 120 user config only, for the escalating approval queue of delegated children (#714). approvals is "off", "owner" or "chain"; with owner or chain (both opt-in; off stays the default so nothing waits that did not before) a delegated child parks at a non-allowlisted Write instead of denying it, and no answer is a denial. You answer with tole delegation approvals or /approvals in tole serve; in chain mode a level holding a delegate_decide grant answers first, within its own allow list. off is today's behavior exactly; tole doctor hints at owner when delegation is in use (a [delegation] table, or a recorded delegated run in this workspace) and approvals is unset (#813). See docs/approving-delegated-work.md. approval_secs (1 to 3600) is how long a request may wait in all, approval_level_secs (1 to 3600, at most approval_secs) how long each agent level gets before it moves up. No answer is a denial
[cron] max_concurrent 4 user config only: runs one tick (tole cron tick, the tole serve --cron ticker) executes at once, 1 to 64; tole cron tick --max-concurrent N overrides it for that tick
[cron] timezone (none: plain UTC) user config only: the time zone of a job saved without tole cron create --timezone (UTC, +07:00 or an IANA name like Asia/Jakarta). Jobs saved earlier keep no zone
[cron] tz_source system on unix, else offset-only user config only: where IANA zone names resolve. system reads the host's zoneinfo at run time ($TZDIR, else /usr/share/zoneinfo; no zone data in the binary); offset-only takes only UTC and fixed offsets
[curator] enabled, stale_days, archive_days, grace_days true, 14, 30, 30 user config only (a project's [curator] is ignored): the skill curator (#593). enabled = false makes tole curator run and the weekly job report and change nothing. An agent-grown skill unused for stale_days is stale, for archive_days it is archived whole; a skill never used is left alone for grace_days. archive_days must exceed stale_days (checked with the defaults filled in), each at most 3650
[hooks.<route>] hmac_key_env / hmac_key_file, insecure_loopback, rate_per_minute, max_body_bytes (none), false, 30, 262144 user config only: a POST /hooks/<route> on tole serve. Each route has an HMAC key, named by an environment variable or held in a file (a regular file, at most 4 KiB, at least 16 bytes); the key is never shown. A route without a key stops tole serve at startup, and insecure_loopback loads on a loopback bind only. Limits: 1–600 deliveries per minute and at most 1 MiB per body
[router] enabled, allow_tiers, [router.tiers], [[router.rules]] off user config only (a project config can only set enabled = false or narrow allow_tiers): model routing by task weight (#586). Each rule picks a tier (light, standard, heavy) when all its conditions hold (kinds, min_chars/max_chars, min_risk/max_risk, profiles, jobs, budget_below, keywords). The cheapest matching tier wins, and no match keeps the configured model. A matching rule replaces the configured model whether it comes from TOLE_MODEL, the config's model or a profile's default; only a session's own model (/model) and a cron job's --model pin are never routed. A rule without profiles applies only to runs without a profile. A tier resolves through [router.tiers], or through profiles.<name>.models for rules naming profiles; an undeclared tier is an error, never another model. tole route is the dry run. A new run, mission, delegated child or cron run is routed once, before its first provider call: an explicit model (a session's /model, a job's --model) wins, the decision goes to the session's fact/route register (redacted), and a resumed session keeps its model
[hooks.<route>] cron_job, events, filter, template, allow_writes (none), all, (none), (none), false user config only: what a verified delivery does.
• A delivery whose event (X-GitHub-Event / X-Tole-Event) is not in events, or whose JSON body fails filter, gets 200 ignored and fires nothing. The native event is signed (scheme v2, #678); GitHub's X-GitHub-Event is not, so put what must hold in filter.
• A match fires the existing job cron_job (202 once the run is claimed). It goes through the checks a scheduled run does: a paused, running, untrusted or out-of-budget job gets 409.
• The fired run sees template ({dot.path} placeholders, scalars only, redacted and capped) as fenced untrusted data appended to its prompt for that run only.
• It has no Write tools unless allow_writes = true.
• [hooks.<route>.filter] takes one of equals, contains, in, regex, exists on a path, or all / any / not over nested filters. contains is a substring match on a string, but a whole-element match on an array: labels contains "bug" matches ["bug"], not ["bugfix"]. Regexes are regex-lite (at most 256 bytes; strings over 16 KiB never match)
sensitive_files (list of name globs) (none) extra file names read_file, the git diff filter and cora_search treat as sensitive (* wildcards, no directory part), e.g. ["*.secret", "vault-*.json"]; the project layer's list is added to the user's and can never remove a name
redaction_allowlist (list of regexes) (none) user config only: values the secret-shape detector (#597) keeps instead of masking, e.g. ["^ghp_0{20}"] for a test fixture; each regex is matched against the candidate secret; a project config cannot set it
review_gate --review-gate, TOLE_REVIEW_GATE flag > env > config > user config > block; a project config can keep or tighten but never loosen
[secrets] (none) binds each secret NAME to the tools whose child processes may receive it; a project config can only narrow (see below)
trust (list of presets) --trust flag > TOLE_TRUST env > config
allow (list of globs) the subcommand's own --allow flag > config
mcp_server (list) --mcp-server flag > config
on_pretool, on_posttool, on_turnend (lists) --on-pretool / --on-posttool / --on-turnend flag > config
skill (list of paths) --skill flag > config (paths resolve against the cwd)
plan_mode, no_auto_mcp, no_skills (booleans) --plan-mode, --no-auto-mcp, --no-skills flag || config
[profiles.<name>] --profile <name> user config only (a project's [profiles] is ignored with a warning); see Profiles below

The API key only ever comes from the environment (a secret-like key in the file is an error). An empty env variable counts as unset.

  • Lists are replaced wholesale. A higher layer replaces the whole list for that key; lists are never merged. A non-empty --allow list replaces the config allow list entirely (an empty flag list means "not given"), exactly like --trust over TOLE_TRUST. Every subcommand has its own --allow; the config allow is the fallback when THAT subcommand's --allow is empty.
  • Booleans can only be turned on. effective = flag || config: a flag can turn a setting on but there is no flag that forces it off, so a config true is dropped only with --no-config (or by editing / untrusting the file).

Profiles (#584). A profile is a dormant persona in the user config: a persona file, an allow list, skills, a memory room and model tiers. Nothing runs for it and nothing is read for it until a command selects it with the global --profile <name>; then only its persona file is read.

[profiles.coder]
system_prompt_file = "~/.codecora/tole/profiles/coder.md"  # or relative to the user config's directory
allow = ["write_*"]
skills = ["~/skills/rust/SKILL.md"]
memory_room = "profile-coder"          # default: profile-<name>
grants = ["GITHUB_TOKEN"]              # secret NAMES only, never values (used by #585/#598)
advisor_max_uses = 3                   # consult_advisor calls per run, 1-20 (#587; needs models.advisor; missions, delegated children and cron runs only, out of the run's token budget)
[profiles.coder.models]
light = "small-model"
standard = "mid-model"
heavy = "big-model"
advisor = "big-model"                  # consulted, never executes (#587)
default = "standard"                   # light | standard | heavy

[secrets] (#598) binds each secret NAME to the tools whose child processes may receive it; every other secret-shaped variable is scrubbed from them. run_command, job_start, cron scripts, the mission --verify command (verify) and the --on-turnend stop gates (turnend) get no secret by default (#676); GITHUB_TOKEN defaults to the gh and git tools and your pre/post tool hooks and MCP servers. A project config can only narrow a binding. Sensitive files (.env*, *.env, *.pem, id_*, .npmrc, .netrc, *.key, credentials, .git-credentials, .pgpass, .htpasswd, .pypirc, .dockercfg, docker config.json, *.p12, *.pfx, *.jks, *.keystore, *.tfvars, kubeconfig, secrets.y*ml, and any name in the sensitive_files config list) read as KEY=«redacted»; to read one verbatim, approve a read_file_raw call (or --allow read_file_raw). tole doctor lists which secrets are set and which tools may receive each. Migration note: docs/secrets-integrations-design.md §9.

[secrets]
GITHUB_TOKEN = { tools = ["gh", "git", "hook", "mcp", "run_command"] }  # restore it for commands
NPM_TOKEN = { tools = ["run_command"] }

A selected profile is one layer of the usual precedence: per-key flag (--system, --allow, --skill) > profile > env > config > user config. The default tier's model replaces the model of the provider triple (it beats TOLE_MODEL); the persona replaces the system prompt (for mission, the default base prompt); the memory loop uses the profile's room, except in a child agent, whose mailbox room always wins. A non-empty profile allow list replaces the config allow list rather than merging with it, exactly as a non-empty --allow does: while the profile is selected, the config's patterns do not apply. Names are [a-z0-9_-]; an unknown name is a startup error that lists the defined ones. tole config check says so next to each boolean.

  • Same effect as the flag. plan_mode = true removes the write/delete/run tools from the wire like --plan-mode; allow/trust feed the same allowlist as the flags, so Destructive tools still always prompt (they can never be allowed through the file, and on the non-interactive faces they stay unregistered).
  • Faces that refuse a flag refuse it from the config too. serve, acp, mcp and mission refuse --on-pretool/--on-posttool (and --on-turnend where the flag is refused); mcp and mission also refuse --skill, --no-skills and --mcp-server (serve and acp accept them, #945, #946, but refuse a skill or mcp_server that comes from the project config at start-up), and mission refuses --plan-mode. A value that arrives from the config is refused with the same message plus use --no-config to ignore the project config; tole never silently drops a project's safety hook.
  • Feature-less builds. In a build without the mcp feature, mcp_server / no_auto_mcp in the config is an error naming the key and the feature; without shell-tools the same holds for the hook keys and memory.

tole config check prints every key that is set with its effective value and where it came from (flag, env VAR, config, default), using the same resolution code as startup (lists show the effective list, booleans effective: true (config) or (flag)).

The file is untrusted input (it lives in a cloned repo), so it needs a content-bound approval before it takes effect:

  • On an interactive command (run, chat, resume, mission) with a terminal on both stdin and stderr, an untrusted or changed config is shown in full and you are asked trust this config? [y/N]. Everywhere else (sessions, status, serve, acp, mcp, no terminal, or --prompt-file -) tole FAILS CLOSED with the exact instruction (tole config trust) and runs nothing; serve/acp/mcp never ask because their stdin/stdout are protocol channels.

  • tole config trust [--config <path>] [--yes] validates the file, prints its path and FULL content (plus a line diff against the previously trusted version) with control and bidi characters escaped, then asks [y/N]. Without a terminal it refuses unless --yes is given (the content is still printed).

  • The approval is stored outside the repo in $CODECORA_HOME/tole/trusted-configs.json (default ~/.codecora, mode 0600) as a snapshot of the file keyed by canonical project directory. A config is trusted only while its bytes are identical to that snapshot; any edit makes it untrusted again.

  • tole config untrust [--config <path>] removes the record (no error if absent). tole config check prints trust: trusted, trust: NOT trusted or trust: CHANGED since it was trusted; its exit code stays 0 for a valid file whatever the trust state.

  • A corrupt or unsupported-version store is an error naming the file; tole never overwrites it.

The schema is strict (unknown keys, wrong types, malformed TOML, unknown trust presets and files over 64 KiB are errors, reported as path:line:col: message). Flat snake_case keys mirror the global flags (model, base_url, sessions_dir, workspace, plan_mode, memory, trust, allow, mcp_server, no_auto_mcp, on_pretool, on_posttool, on_turnend, skill, no_skills, system_prompt) plus one [mission] table (max_steps, max_minutes, max_tokens, verify, verify_timeout, turn_cap_trips). Secrets never belong in a project file: any key whose name contains secret, password, token or api_key (any depth, any case) is a hard error.

Tools

Tool Risk Notes
read_file, write_file, edit_file RO / Write jailed to --workspace (TOCTOU-safe, symlink-refusing); read_file returns at most 20,000 chars per call (offset/limit in chars, next_offset to continue)
read_file_raw Write the verbatim read of a sensitive file (.env*, keys, credential files): approve the call or start with --allow read_file_raw (#598)
delete_file Destructive always prompts; never allowlistable, even with --yes
git Write status / diff / add / commit only — push stays human; while the cora review tools are attached, commit needs a reviewed staged diff (see the review gate under Ecosystem position, #534)
gh Write read-only ops, argv-validated per op; repo defaults to the checkout's GitHub remote, optional per-call override (validated)
run_command Write argv-split (no shell), cwd-jailed, timeout + output cap
verify_package RO crates.io / npm registry check before any install — hallucinated names get NOT FOUND + candidates, edit-distance-1 candidates get a typo-squat warning
load_skill RO loads a discovered SKILL.md on demand (--skill pins one upfront; --no-skills disables)
skill_search RO with TOLE_SKILL_INDEX=uteke (#590): finds skills by meaning in the uteke index; returns names and descriptions from the local skill files, bodies still come through load_skill
gitea Write Gitea counterpart of gh over the instance REST API — registers when origin is a Gitea remote AND TOLE_GITEA_TOKEN/GITEA_TOKEN is set; same six ops
delegate, delegate_poll Write / Write the CLI faces (run, chat, mission) and server sessions (tole serve, tole acp, #994; the start is an approval in the server's queue, and a --plan-mode server has none): start a delegated child (task, optional profile, mode, budget, allow, role) as a budgeted tole mission whose budget is carved from the parent's, within [delegation] limits and the machine resource guard (a held-back spawn is queued, never failed); the child hands in one delegate_report and is done only with a complete one; tole audit prints the tree (#585)
delegate_pending, delegate_decide ReadOnly / Write #714, only with [delegation] approvals = "chain" and only where the session's own allow list holds a delegate_decide grant (typed by you with --allow, or a profile's pattern the parent's list covers), alongside delegate; never for a discussion participant. delegate_pending lists the requests of your delegated children that wait for you, shown as data (redacted, capped, fenced). delegate_decide takes {request, decision} and nothing else, decision being allow, deny or escalate (one level up): only what your own allow list already allows, only while you are the request's current level, once; a request in an always-owner class (secrets, trust or approval records, plugin, skill or MCP effects, a Write outside the workspace, an oversized input) never reaches an agent level. Without the grant nothing is registered and the owner answers with tole delegation approvals
cron_create Write an agent saves a cron job paused and within its own allow list; only the owner's tole cron resume enables it (#581). Session faces at depth 0 outside plan mode; never in a cron run
skill_propose Write an agent proposes a skill as a draft that is never loadable; the owner reads it with tole skills drafts and promotes it (#592)
consult_advisor RO missions, delegated children and cron runs of a profile with models.advisor: asks the advisor model about a hard decision, within the run's own token budget; only its fenced verdict comes back (#587)
discuss, discuss_status, discuss_stop Write / Write / Write wherever delegate is (CLI faces and server sessions): a multi-round discussion among user-config profiles, started in the background under the rules of delegate (budget carved from the caller); status and stop work only on discussions the same session started (#588); more than 8 participants is allowed (up to 16) but the result then carries an advice line (#856). The owner's entry point is tole discuss
agent_start, agent_poll Write / Write deprecated aliases of delegate / delegate_poll in the CLI faces and in server sessions; the child is a durable child session; the aliases take the delegate path, so it may start grandchildren up to [delegation] max_depth (on a server session never on its own: see #994), results via per-child uteke mailboxes (ephemeral by default); agent_poll is Write because a settled poll consumes (cleans) the mailbox, and --trust internal allowlists it by name; --agents-worktree gives each child its own git worktree; siblings are told (#380) when another child changes a file they read or wrote, at their next safe point; role (explore/implement/verify/fix) and consumes (artifacts by reference) give children a typed handoff, and an implement/fix child without passing verification is not closed (#383)
systemone_decide RO typed decisions (choice/score/noul + confidence) from a System One backend — active when SYSTEMONE_API_KEY is set; SYSTEMONE_BASE_URL picks the backend (hosted Jev default, self-hosted compatible)
job_start, job_poll Write / RO detached long-running jobs with log tailing
cora_search RO hybrid codebase search via cora brain; native fallback — skipped when the cora MCP surface is attached
uteke_recall, uteke_document RO / Write semantic memory recall / markdown → room
mcp_* (from --mcp-server, stdio or https:// url) Write server metadata is never trusted for risk; approval gate always applies; the server itself must be approved in the plugin lock first (#599)
mcp_read RO resources/read of a server that advertised resources and is admitted by the lock
web_fetch, web_search RO built in (#625, default web-builtin feature): web_search asks DuckDuckGo Lite, then Bing, then Brave (keyless; the query is redacted and capped; the engines get nginjen-lite's browser-like User-Agent), and web_fetch returns markdown (default), compact (shortest, but drops the text of inline bold, italic, code and image alt), text, html or links, honouring robots.txt and sending tole/<version> (+https://github.com/codecoradev/tole), at most one request per second per host, with every redirect hop SSRF-vetted. With NGINJEN_BASE_URL and NGINJEN_API_KEY both set, both tools use that nginjen service instead (POST /search, POST /scrape with a bearer key sent only to it; the fetch target is vetted first, and a result from nginjen's Jina fallback is discarded). A TOLE_WEB_* backend below wins over both when set; tole doctor names the lane each tool uses. Without web-builtin: text-only internet (no JS/browser): fetch is direct HTTPS, size-capped, content-type allowlisted, HTML→text — or, with TOLE_WEB_FETCH_URL set, goes through your fetch backend for JS-heavy or bot-protected pages (default contract GET ?url=<target> → {"content":"…"}; TOLE_WEB_FETCH_METHOD=POST sends {"url"}, TOLE_WEB_FETCH_HEADERS like the search ones, TOLE_WEB_FETCH_FIELDS='content=markdown' maps the field; https targets only, vetted locally first; backend only, no direct fallback; the target URL is disclosed to the backend operator; a malformed value fails startup); search needs TOLE_WEB_SEARCH_URL (default contract GET ?q= → {"results":[{title,url,snippet}]}; TOLE_WEB_SEARCH_METHOD=POST sends {"query","limit"}, TOLE_WEB_SEARCH_HEADERS='Authorization=Bearer ${KEY}' adds headers sent only to the backend, TOLE_WEB_SEARCH_FIELDS='snippet=description,results=items' maps fields; a malformed value fails startup) — no backend, no tool; results are model content, never executed
todo_write, todo_read Write / RO durable mission task list (at most one in_progress); state lives in session entries — write results are the record, crash-resume restores the last settled list; covered by --trust internal
search_history RO finds a case-sensitive text fragment in this session's own earlier entries, the turns a compaction summarized away included (#1354): messages, tool calls, tool results, tool errors and earlier summaries; each hit is the entry id, seq, kind and a bounded excerpt, oldest first, under a byte cap; the current session only, and only what the model was shown (docs/threat-model.md, "Context compaction"); on every face that runs a session, not on tole mcp

Remote approvals

TOLE_SERVE_TOKEN=... tole serve                # on the box (or --token-file <path>)
tole approvals list --url http://box:7801 --token $TOKEN
tole approvals allow apr-... --url http://box:7801 --token $TOKEN

When a serve-face session hits a non-preauthorized Write (#200), the pending decision becomes a queue entry and the turn settles resumably (fail-closed). A remote operator lists and decides: allow stores a one-shot approval and resumes the session (the replayed effect re-consults the gate — exactly once), deny records the verdict. Entries expire to denied (15 min) so nothing hangs silently; every decision lands a durable audit register on the session. MCP/ACP parity is a follow-up. This is also the surface uteke-mobile drives — docs/mobile-control.md is the mobile-control guide (#202).

Approving delegated work

A delegated child has no terminal, so a Write its allow list does not cover is denied at once. With [delegation] approvals = "owner" (user config; the default is off) it asks instead and waits, and you answer with tole delegation approvals list|show|allow|deny or /approvals in tole serve; no answer is a denial. "chain" also lets a parent holding a delegate_decide grant answer within its own authority. tole doctor shows the mode. Guide: docs/approving-delegated-work.md.

Mission mode

tole mission "ship the feature" --max-steps 48 --max-minutes 15 \
  --verify "cargo test" --yes

Autonomous turn-chaining toward a goal (#199; running one unattended, which tools to pre-approve and how to write the --verify gate: docs/mission-patterns.md): the existing turn machinery looped until the model declares MISSION_COMPLETE (and --verify exits 0, when set) or a budget trips (--max-steps, --max-minutes, --max-tokens). Every chained turn is a normal durable turn — after a crash, tole resume <id> finishes the cut-off turn and tole mission --resume <id> continues the mission (it refuses a cut-off turn; the goal is optional there and is read back from the session, #1334), cancel works unchanged, Destructive tools stay un-auto-allowable, and a durable summary lands on the session either way. Plans ride the todo_write/todo_read tools (#198); budget exhaustion settles resumably, never a dead session. A long goal can come from a file with tole mission --goal-file <path> (- = stdin; at most 64 KiB; not together with the goal argument), and tole mission --help ends with the unattended recipe (#1337). Run ergonomics (#216): run --prompt-file <path> (- = stdin), --name <alias> (stored in the session header — tole sessions shows it and resume accepts the alias), and --timeout <secs> (wall-clock cap; expiry cancels at a checkpoint — resumable, never dead). A mission says so on stderr, once per start, when it has no --verify gate or the gate looks like it always succeeds (true, :, exit 0, ... || true; #1335), and once per resource when tokens, steps or minutes pass 80% of their ceiling (#1336); both are warnings, nothing changes. Budget default (#201, raised by #1226): 160 steps / 60 min / 4,000,000 tokens, the same under --trust internal; to go back to the old, smaller ceiling (48 / 15 / 200k) set --max-steps, --max-minutes and --max-tokens, or [mission] in the config — explicit flags always win; a durable cost report (turns, steps, tokens, per-risk-tier tool calls, cached tokens) lands on the session and tole status renders it. tole status (and GET /sessions/{id}/status, as usage_report) also shows the usage derived from the ledger for any session: prompt / completion / reasoning / cached tokens, the cache-hit rate, and the request size in characters split into system+tools vs history at the first and last step (#211; recorded per step under tole_wire; sessions recorded before it read n/a). It also lists per-user-turn stats (#379: input / output / cache-read / cache-write / reasoning tokens, turns in the status JSON), summed from the same ledger so they survive restarts; a value no step reported is n/a / null, never 0. Reported only — --max-tokens accounting is unchanged.

Approval gates

Every non-ReadOnly call goes through an Approver. Destructive tools are denied structurally: the registry refuses them without an interactive approver, allowlists deny them on sight, and --yes never covers them. There is no bypass path. Known secret values are redacted at every egress sink and, since #596, before a line reaches the durable session log: the log stores the form the provider saw ("redacted": ["NAME"] names what an entry hid; lines written by older versions stay raw). Since #597 the secret shapes tole never knew (AWS, GitHub, npm, Slack and Google keys, bearer headers, JWTs, PEM blocks, URL passwords, NAME=value secrets) are masked at the same sinks as prefix[REDACTED:<kind>] by the ruleset shared with uteke (uteke-privacy); redaction_allowlist keeps a false positive. See the threat model for the forms a redactor cannot recognise.

Memory loop

--memory uteke (or TOLE_MEMORY=uteke) turns the harness into a cross-session memory loop — host-initiated on both ends, the model can neither trigger nor suppress it:

  • Before the first turn of a fresh session, memories relevant to the prompt are recalled from the owner's uteke store and injected into the message inside a clearly marked fenced block; the durable log records exactly what the provider saw.
  • When the session settles with a final answer, a compact summary is stored back — the next session's recall can find it.

Memory lives in the uteke room repo-<dir> (uteke ≥ 0.21.1; rooms replace the deprecated namespaces; TOLE_MEMORY_NAMESPACE overrides the room). Memory stored by earlier tole versions in the namespace of the same name is still recalled while the room is empty. The injected batch is hard-capped at 24 items / 64 KiB (a larger limit is clamped; a hit is never cut mid-way) and deduplicated. A batch is all-or-nothing: an unparseable recall payload fails the whole batch with a stderr note rather than injecting fewer items, and the turn proceeds without memory.

Workspace layout

  • crates/tole-core — platform-agnostic library: state machine, JSONL storage, Tool/Approver/Storage/Provider traits, tools, and the OpenAI-compatible provider (crates.io; embedders build with --no-default-features — CI keeps the mobile targets compile-checked).
  • crates/tole-cli — headless CLI host (the tole binary).
  • evals/ — agentic eval harness: Tier 1 CI contracts, Tier 2 live missions, Tier 3 release baselines (see evals/README.md).

Documentation

Development

cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
cora review --staged      # ecosystem-standard review gate before every commit

CI enforces the same set across Linux, plus cross-compile checks for aarch64-apple-ios and aarch64-linux-android.

Design sources

Research notes and design sources: adapted from pi's harness spec (MIT).

License

MIT.

About

Durable Rust agent harness: chat-first personal assistant with mission mode — resumable after crashes, replayable forever

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages