Security and operating boundary
Freeness gives a model a shell. Treat model responses, repository contents, tool output and editable context as untrusted. This early runtime has not received an independent security audit.
Isolation belongs outside the agent
Local mode executes as the runtime's OS user. Commands can read and change any accessible file, use the network, read credentials from files, inspect processes, and start descendants that escape a process group. Environment filtering, context validation and terminal filtering do not isolate those commands. Session metadata and the journal are diagnostic files, not tamper-proof records.
For untrusted work, run the runtime in a disposable container or VM as an unprivileged user. Give it only the task workspace and tools it needs. Keep host home directories, SSH agents, Docker sockets, cloud credentials and privileged mounts outside that environment. Enforce CPU, memory, disk, process and network limits at that boundary. A provider proxy outside the task environment can keep the real API credential out of the runtime container. The existing Dockerfile builds a binary; it does not implement such an execution boundary.
Do not expose serve to untrusted remote clients. Its stdin protocol is a local subprocess interface with no authentication.
Independent shell approval
Every main-agent shell invocation is gated by a separate API conversation, including detached jobs. The default uses the active connection; reviewer settings can name a separate saved provider/model. No tool definitions, editable context or agent-generated authorization claims are sent as reviewer instructions. The main system prompt is unchanged. The reviewer policy treats proposed command text as untrusted and asks it to deny destructive loss, credential access/exfiltration, privilege escalation and changes to the active approval controls.
A valid reply must contain one finished assistant choice and exactly {review_id, allow, reason} in its JSON text. Boolean approval must match a fresh random ID. Duplicate decision/transport fields, extra decisions, refusal/function calls, malformed or oversized replies and invalid IDs cannot produce a grant. A non-cloneable, single-use grant owns the approved arguments; only the shell executor can consume it. Cancellation is checked again before spawn. Denial yields a blocked tool result; API/configuration/protocol failure stops the run. There is no unguarded production execution mode, including in the deterministic demo.
The reviewer receives only the original human request, cwd and proposed arguments, not filesystem contents. Its credential and connection are pinned in parent-process memory before a run; child context/config edits cannot redirect an in-flight review. A custom reviewer endpoint requires a separately specified credential reference. Requests do not follow redirects; input/output sizes and network duration are bounded. The reviewer sees task intent and commands, so choose a reviewer provider permitted to receive that data. Settings use private, owned files; keys never enter the journal or argv. Agent and reviewer pending requests, usage and unknown costs are accounted separately, and caps check their sum.
An LLM approval is not a containment boundary. The reviewer can be fooled or misunderstand opaque scripts, mutable files and side effects. Using the same model creates correlated judgment risks. Allowed commands still execute with the user's OS authority, can read on-disk config keys and can tamper with local artifacts. Pinning and context separation prevent ordinary protocol bypasses, not hostile code running with equal OS permissions. Use the external isolation boundary above for untrusted work.
Runtime protections
- Provider requests require HTTPS except for loopback endpoints. Redirects are disabled. Credentials come from a private local key file (default), an optional OS credential-store reference or named environment variable, are excluded from shell inheritance by default, and are redacted from provider HTTP and stream error messages. Explicit
--pass-envvalues are caller-authorized disclosures; child code can still access secrets through the OS boundary described above. - First-run setup and
/connectuse a separate form, never the conversation editor. Key entry is masked and discarded after submission/failure. Keys travel to a Rust helper over child stdin, never argv or the session JSONL protocol. The helper accepts at most 16 KiB and uses value-free input errors. Connection settings store only a UUID reference or environment-variable name, with bounded, private atomic files and an exclusive writer lock. Duplicate names require explicit removal rather than overwriting a credential. - macOS uses native Security.framework generic-password items under
dev.freeness.provider, with cloud synchronization disabled. Linux uses/usr/bin/secret-toolwith a Secret Service keyring; credential bytes use stdin/stdout pipes and filtered process environments. Missing/locked stores fail closed; users can explicitly choose private local key storage. Linux deletion unlocks matching items and checks absence, because a bare clear operation may skip locked entries. The connection helper has bounded output/time and its process group is terminated on timeout. OS prompts and access controls remain the OS's responsibility. - Selecting a connection starts a fresh session and makes the pricing/cost-cap/context-window reset visible before selection.
/modelpersists a saved connection's model and clears pricing/window as before. Configuration writes are not atomic with OS keychain transactions: failed saves attempt credential cleanup, but process/host failure can leave an orphaned item. Secrets necessarily exist in application memory while being entered and used; JavaScript string buffers are not securely zeroized. OS credential storage does not isolate local shell code running as the same user. - Startup validates the selected credential's presence and HTTP-header format before session creation or request accounting. Errors never include its value, including non-Unicode values. Credential names use shell identifier syntax and cannot select standard inherited variables such as
HOMEorPATH. The read-onlydoctorcommand performs no API calls, shell execution or file writes; passing it does not establish provider authentication or writable disk capacity. - Shells start without profile files or inherited arbitrary variables. Commands receive no interactive stdin. The caller sets time, turn and optional cost limits. There are no automatic retries of requests or commands whose side effects may already have happened.
- Commands use separate Unix process groups. Completion, cancellation and timeout kill that group; output collection has a bounded drain period. Descendants that create new sessions can escape and must be contained by the outer environment. SIGKILL and host failure cannot run cleanup.
- New runtime directories use mode
0700and files use0600on Unix, independent of a permissive umask. Known runtime files are opened without following final symlinks; non-regular files, hard links and files owned by another user are rejected. Atomic replacements avoid writing through a target link and sync the containing directory. Parent directories must remain trusted: this is not a race-proof filesystem sandbox. - Context and prompt reads are bounded at 8 MiB, metadata at 1 MiB, and stdin protocol records at 8 MiB while reading. Oversized commands are discarded through the next LF so later commands stay aligned. Incomplete commands at EOF are rejected. Provider parsing, inline output and disk logs also have size limits. Session-wide disk quotas belong to the outer environment.
- Only a complete, validated provider response can execute tools. Tool names, IDs, arguments and context call/result groups are checked. Incomplete streams are not executed. Context edits cannot introduce system/developer roles. There are no semantic guarantees about instructions inside user or tool text.
- Provider responses must contain one coherent choice and a complete zero-based tool batch. Extra choices, data after a finish marker, sparse/duplicate tool indices, malformed tool-call transport fields and unsupported tool types fail before execution. Non-object JSON tool calls are rejected without panicking. Unknown finish reasons and malformed-field errors do not echo supplied values. Valid fragmented/interleaved calls remain supported.
- Completed response IDs, reported models, service tiers and optional legacy fingerprints are saved separately from editable context and model-bound resource feedback. Values are bounded, reject control characters and active-credential echoes, and must agree across stream frames. Missing values stay unknown. These are provider assertions; they cannot establish backend identity or prevent an artifact owner from changing the journal.
- Terminal displays filter control sequences. JSON events and disk logs preserve original content for debugging and may contain sensitive task data. Use a safe viewer for raw artifacts; do not
catuntrusted output into a terminal. - History is read from the journal through bounded display previews. It never restores removed messages into model context. History replies journal page metadata rather than duplicate payloads. The TUI rejects inconsistent history/session records and stops its backend on protocol corruption or an acknowledgement timeout; an unresponsive shutdown is force-terminated after a grace period. Forced termination cannot guarantee cleanup of descendants, so inspect artifacts and use the outer OS/container boundary.
- Frontend initialization failures also close the backend through that bounded shutdown path and stop the partially initialized terminal. Explicit
FREENESS_BINpaths and the newest local build must be regular executable files; invalid selections fail without using another binary. Default selection uses file modification times, which are a convenience rather than source verification or executable authentication. The caller must trust the selected program. - Incomplete usage stays unknown. Cost limits are soft checks between requests, so a single request can exceed the cap. Accounting is not a provider-side spending limit.
- Supplied malformed cached/total counts and contradictory repeated usage cannot become known zero-cache or complete-cost measurements. A later usage record cannot erase an earlier contradiction. Structured provider refusal text is surfaced with valid usage; a refusal combined with commands is rejected.
- Session discovery reads only owned, regular metadata files from owned default catalog directories. It rejects final symlinks, hard-linked files, special files and mismatched workspaces, bounds scan entries and aggregate bytes, and reports skipped or omitted inputs. The standalone command needs no credential and creates no catalog. Lock state is an observation; discovery does not validate context, prove that a session can resume, or unlock it. TUI query payloads are not copied into the active journal.
- Explicit image attachments use the same bounded regular-file checks and reject final symlinks, hard links and special files. Image parts accept inline Base64 PNG/JPEG/GIF/WebP data only, with media-header checks and size/count limits. The runtime never fetches image URLs or decodes pixels. Header checks do not establish complete codec validity. Explicit attachment bytes stay in private context snapshots and are omitted from run-start/history events; model commands or raw output can still contain them. Invalid edits recover the prior context, and an oversized append cannot replace it. A provider rejection does not trigger hidden image stripping or retries.
These protections reduce accidental exposure and protocol corruption. They do not prevent a malicious model or task from acting with the runtime user's authority.
Verification and dependencies
Run python3 scripts/verify.py after installing the locked dependencies. This checks formatting, lint, Rust and TUI tests, report parsing, and offline end-to-end cases using a fixed fake credential. Add --harbor-python .cache/harbor/bin/python to include the optional Harbor contract tests, and --baseline after installing the exact FreeHand revision in the benchmark guide. Baseline checks verify the installed commit and source hashes. No live keys are required.
The GitHub workflow uses read-only repository permissions, commit-pinned setup actions, locked dependencies, disabled checkout credential persistence and no live provider credentials. It is configuration for future repository hosting; local validation does not demonstrate that hosted CI has run. It checks npm advisories and runs a pinned RustSec scanner with warnings denied on Linux. To scan locally:
npm audit
cargo install cargo-audit --version 0.23.0 --locked --root .cache/security
.cache/security/bin/cargo-audit audit --db .cache/security/advisory-db --deny warnings
The advisory snapshot records the database revision, lockfile hashes and results. The 2026-12-03 scan found no known vulnerabilities or RustSec warnings in the project lockfiles, including development dependencies. Optional Harbor/FreeHand Python dependencies are outside that scan. Refresh advisory data when checking a later revision; a clean test or advisory scan is not a security certification.
The optional container smoke uses Harbor's real lifecycle with a non-root agent and a container-local scripted API. It records enforced CPU/memory limits and port exposure, checks private session files and credential filtering, and verifies task-container removal. The AMD64 offline demo has also run under emulation with a read-only root filesystem, no network, dropped capabilities and no-new-privileges. These specific checks do not establish a general-purpose sandbox or prove that every benchmark image has equivalent controls.
The optional FreeHand comparison uses the exact installed source revision and a configuration-only adapter to set its shell environment policy. The wrapper addresses an upstream option-coercion bug without modifying the baseline runtime. The shared fixture records each harness's file modes; it requires Freeness's private permissions without attributing that protection to the baseline. See the comparison settings and evidence.
Benchmark reports read native trial results rather than recursively trusting model-produced files named result.json. They honor Harbor's reward validity, preserve unknown accounting, and reject mixed comparison configurations. A native job lock checks planned input/repetition coverage without copying its potentially sensitive environment values into the summary. These are integrity checks on diagnostic artifacts, not protection against a process that can modify the job directory as the same OS user.
Paired comparison analysis also checks the prepared configuration hashes, local task trees and runtime hash, rebuilds expected locks with pinned Harbor, and verifies the recorded job locks, trial locks and requested trial configurations. Credential/environment references must match; unexpected literal credentials are rejected before native serialization, and mismatch errors omit configuration values. The analysis does not resolve credential references or execute jobs. These checks establish consistency of recorded inputs, not a trusted attestation of effective runtime settings or provider identity. Full normalized costs are checked against token counts and configured rates; partial accounting stays unknown.
Reported-model comparison uses bounded, component-by-component no-follow reads beneath the selected job directory. Downloaded response files must be regular, owned by the host user and have a single link; unsafe or incomplete evidence is unknown. The strict option requires complete evidence from both completed arms, and known reported-model drift is rejected. This protects the response reader from downloaded file links; the selected job directory, configuration, lock and result inputs remain trusted analysis inputs. No artifact or provider identity is cryptographically attested.
The optional public pilot is pinned independently of the paper task set. Its offline preparation checks full task trees and executable modes and rejects extra files, symlinks, special files and changed dataset metadata. Its default generated job runs reference solutions only, with no provider credentials. A Linux verifier adapter removes group/world write access from the root-owned /logs parent before running unchanged bundled graders; it fails if the parent is a final symlink or has an unexpected owner. This addresses a permission failure observed with Harbor 0.27 and the published scorer verifier. The pilot retains upstream network defaults and does not establish network isolation.
Optional comparison preparation writes two matched model job configurations without reading credential values or starting jobs. Keys stay as environment references until Harbor launches an agent. The runtime binary is copied and hashed, and its expected hash is checked before the adapter executes task-container commands and again after staging the upload. The controlled baseline rechecks the installed revision and recorded source hashes, and rejects a commit different from the prepared job. These checks detect input drift; prepared files remain editable by their OS owner. Agent execution deadlines and normalized soft cost caps are not provider billing limits. The real-container timeout gate verifies that an interrupted request retains the known configured-price subtotal while keeping complete cost unknown, even when FreeHand retains a numeric cost and cost_known=true. The subtotal cannot authorize further capped requests when complete accounting is unavailable.
Until a repository and private reporting channel are published, report suspected vulnerabilities privately to the project owner. Never include live credentials or sensitive session files in public issues.