Skip to content

v2.2.0

Latest

Choose a tag to compare

@geekforbrains geekforbrains released this 08 Aug 01:47

Security

  • Agent-created tables can no longer inject SQL. A column's type and
    default were interpolated into the CREATE TABLE / ALTER TABLE text that
    runs through db.exec(), which executes every statement in the string. The
    type allow-list lived in two route files and was missing from the third,
    POST /api/agents/:id/tables — the agent-facing one — and no route validated
    default at all, so a non-string value (a JSON array, say) slipped past the
    quoting branch. Either one could append arbitrary DDL, e.g. dropping a table.
    Validation now lives in tables.ts next to the DDL it guards, so no route can
    skip it: types are allow-listed (TEXT / INTEGER / REAL, case-insensitive)
    and defaults must be a string, finite number, or boolean.
  • Setting a password now revokes that user's existing sessions. A reset is
    the remedy for a compromised account, but sessions opened under the old
    password survived it for the rest of their TTL (30 days by default). The user
    redeeming the token stays signed in; every other session for them is dropped.

Fixed

  • The postrun gate gets the HARBOUR_* run credentials it was documented to
    have.
    v2.2.0 gave prerun the shared env contract on the understanding that
    postrun already had it — postrun was in fact the gate passing only job-linked
    vars, so a postrun script following the documented
    curl "$HARBOUR_URL/api/runs/$HARBOUR_RUN_ID/activity" pattern expanded empty
    variables. All three gates now build their environment through the same
    buildRunEnv helper.
  • Deleting a project cleans up what the FK cascade can't reach. The
    project's physical t_* SQLite tables (holding agent-written rows) stayed in
    the database file unreachable from the UI, and its runs' uploads/runs/<id>/
    directories stayed on disk. Job and agent deletion already did this cleanup;
    project deletion was the one destructive path that didn't.
  • CLI detection uses command -v instead of which. which is an external
    binary a sanitized PATH may not carry, which made an installed claude or
    codex look missing to both the runner's capability detection and the
    dashboard's CLI-tools check.
  • A CLI-bootstrapped database now matches a server-created one exactly. The
    bootstrap path created a redundant idx_runners_token index that the canonical
    schema does not define (token_hash is already UNIQUE), so the two paths
    produced schemas that differed by one index. Harmless, but it contradicted the
    comment promising they were identical. Existing databases can drop it:
    DROP INDEX IF EXISTS idx_runners_token;.

Dependencies

  • next 16.2.1 → 16.3.0, picking up fixes for App Router middleware/proxy
    bypass, RSC cache poisoning, and several DoS advisories.
  • shadcn moved to devDependencies (it supplies build-time CSS, not runtime
    code) and uuid bumped. The production dependency tree now audits clean.
  • @types/node moved from ^20 to ^24, matching the enforced Node 24 runtime.

Breaking: jobs no longer have a description

  • The jobs.description column is gone, with the create/edit dialogs, both
    create APIs, and the docs that referenced it. Nothing consumed the field: it
    never appeared in list rows and was never sent to the agent, so the job's
    instructions were already carrying the meaning. Agent descriptions are
    unchanged. On an existing database:
    ALTER TABLE jobs DROP COLUMN description;.

Jobs and gates

  • Timeout is settable when a job is created, not only via
    PUT /api/jobs/:id afterwards. The create dialog exposes it for both kinds,
    and POST /api/agents/:id/jobs now accepts timeoutMinutes the way
    POST /api/jobs already did. Default is still 30 minutes.
  • The prerun gate gets the same environment as postrun and workflow gates —
    job-linked secrets as $NAME plus the HARBOUR_RUN_ID / HARBOUR_API_KEY /
    HARBOUR_URL run credentials. Prerun was the one gate without them even
    though the same values already arrived in its stdin payload, so a script that
    worked as a workflow command silently saw empty variables as a prerun. The
    30-second cap on prerun/postrun (vs the job's timeout_minutes for a
    workflow command) is now documented rather than merely true.

Agents and runs

  • Agents no longer post their summary twice. The runner already posts the
    CLI's final output to the run's activity, but the work prompt buried that and
    offered harbour update log with no guidance on when to use it — so agents
    logged a summary and ended with one. The prompt and the agent guide now
    frame log as mid-run progress only and state that the final response is
    posted automatically.

Interface

  • Runs, Jobs, and Agents share one list-row shape: title, a meta line of
    icon+text facts, and a right side that collapses to a single signal instead
    of a badge pile.
  • The job detail meta block shows the run timeout, and the title format when
    one is set — both were previously settable but invisible outside the edit
    dialog.
  • An agent's model and effort read as one fact (opus / medium). The model row
    used to disappear entirely when no override was set, leaving just the CLI and
    an effort level with nothing to attach it to.
  • Job and run detail pages mark the agent with its colored bot icon rather than
    a bare dot, matching the list rows.
  • The agent detail header drops the gray CLI pill — the same fact sits in the
    detail block directly below it.

Breaking: orgs are gone — Harbour is flat

  • Orgs, memberships, roles, and the instance-admin flag are removed. The
    hierarchy is now instance → projects → agents & jobs → runs, and every
    authenticated user can do everything. Projects organize work — slug unique
    instance-wide — and are no longer a tenancy boundary: lists span all projects
    by default (filter with ?projectId=), and a job may link docs, secrets, and
    tables from any project. Pinning now auto-injects a resource into every run
    of every job in its own project.
  • Project delete is a hard delete — no archive state; the cascade takes the
    project's agents, jobs, runs, docs, secrets, and tables with it.
  • Renames. Admin API keys are now just API keys (/api/api-keys,
    hbr_ prefix) and the admin guide is the management guide, served at
    /api/management-guide. The CLI's harbour admin create is
    harbour user create (env var HARBOUR_USER_PASSWORD); the harbour migrate command is removed. Runner scope drops orgId (only agentId
    remains). Workspace and script paths lose the org segment:
    workspaces/<project>/<agent> and workflows/<project>[/<agent>]/<job-leaf>.
  • Migration: none. Harbour has no schema migrations — a fresh database is
    the only path across this change.

Runs record working duration, token usage, and attempts

  • Every run now shows what it cost. Four cumulative counters on runs — attempts, duration_seconds, input_tokens, output_tokens — accumulate across resumes and retries for the run's whole life. Duration counts working time only (each exit from running folds in the attempt's elapsed time; time parked waiting/pending is excluded), and input tokens count all input-side usage, cache reads and creation included. The run page shows duration and total tokens, run rows carry duration, and job pages roll up totals plus an average duration.
  • The Runner Protocol gains an optional usage callback. The bundled runner normalizes each CLI turn's token usage (Claude's modelUsage, Codex's turn.completed) and posts the delta to POST /api/runs/:id/usage with the run's exec token; the server accumulates. Optional and additive: a runner that omits it — including every existing third-party runner — is unaffected, and the run simply records no tokens. See the Runner Protocol.
  • Workflow runs get duration and attempts for free — the same lifecycle transitions drive them; tokens stay 0 (no CLI).
  • Migration. The orgs removal above already makes a fresh database the only supported path across this release, which covers this change too. If you are instead carrying data forward by hand, add the columns yourself or the server refuses to boot with a schema-drift error: ALTER TABLE runs ADD COLUMN attempts INTEGER NOT NULL DEFAULT 0; ALTER TABLE runs ADD COLUMN duration_seconds INTEGER NOT NULL DEFAULT 0; ALTER TABLE runs ADD COLUMN input_tokens INTEGER NOT NULL DEFAULT 0; ALTER TABLE runs ADD COLUMN output_tokens INTEGER NOT NULL DEFAULT 0;

Agents report through harbour update, and policies can be scaffolded

  • New command: harbour update {title,log,status} — the channel a running
    agent uses to report back. It reads the run's identity and a per-run
    credential from the environment the runner injects (HARBOUR_URL,
    HARBOUR_RUN_ID, HARBOUR_API_KEY), so it needs no URL or key on the
    command line, and exits non-zero outside a run.
  • Why it exists. The run protocol was curl, so the only allow rule that
    covered reporting was Bash(curl *) — which also hands the agent the whole
    internet and quietly defeats the rest of its policy. Bash(harbour update *)
    grants reporting and nothing else: an agent holding only that rule cannot
    fetch a URL, read a file, or run any other command. Keep the rule scoped to
    harbour update; Bash(harbour *) would also grant the admin CLI.
  • Agent runs now get HARBOUR_URL / HARBOUR_RUN_ID / HARBOUR_API_KEY in
    the spawned CLI's environment. Workflow runs already did; this is the
    agent-side counterpart. Job env vars are layered first, so a job secret can't
    shadow the reporting credentials.
  • The work and finalize prompts teach the command instead of curl recipes
    for title/status/activity. The finalize turn matters most: it spawns the CLI
    again under the same policy, so a curl-based finalize would strand a
    restricted agent at the backstop after its work had already succeeded.
  • New command: harbour policy init <agent> [--force] — scaffolds the
    starter policy for an agent in its CLI's own format (.claude/settings.json
    or .codex/config.toml), refusing to overwrite an existing file without
    --force. What it writes is the minimum that works: reporting only. Pairs
    with harbour policy check, which validates what it wrote.

Breaking: agents no longer bypass CLI permissions by default

  • Every agent now has a Permissions setting, and the default inverts the old
    always-bypass behavior.
    Enforced (the new default) requires a policy
    file in the agent's workspace, written in the CLI's own native format; when
    the file is missing or invalid, the run fails closed with an actionable
    reason instead of running without limits. Unrestricted is a per-agent
    dashboard toggle that deliberately restores the old bypass flags
    (--dangerously-skip-permissions /
    --dangerously-bypass-approvals-and-sandbox) and shows a badge on the
    agent. Harbour validates the policy file and points the CLI at it but never
    authors its content — see the new
    agent permissions guide.
  • Claude Code policy: <workspace>/.claude/settings.json — the CLI's own
    settings format (permissions rules, defaultMode, hooks, and the OS
    sandbox block). Passed as --settings <file> --permission-mode <mode> --setting-sources project; --settings rather than cwd discovery because
    project-scope settings silently ignore the sandbox keys that do the
    containing. defaultMode defaults to dontAsk and may not be
    bypassPermissions (bypassing is the dashboard toggle's job). The policy
    must let the agent report — Bash(harbour update *), which
    harbour policy init writes — or every run ends failed; Claude's
    "Ignoring permissions" stderr warnings are surfaced as run activity.
  • Codex policy: <workspace>/.codex/config.toml — the CLI's own config
    format, with sandbox_mode set to workspace-write (danger-full-access
    is refused; use the dashboard toggle instead). Passed as
    --skip-git-repo-check -s <mode> -c approval_policy=never. Optional
    .codex/rules/*.rules execpolicy files add a command deny-list on top,
    validated up front with codex execpolicy check. The OS sandbox is the
    boundary — rules are a deny-list only, and unmatched commands run.
  • Codex policies must enable network access with
    [sandbox_workspace_write] network_access = true. Codex's sandbox
    otherwise blocks every connection — loopback included — and reporting to
    Harbour is an HTTP call either way, so such an agent could do
    work but never report a title, activity, or final status, and every run
    would end failed at the finalize backstop. Harbour refuses the policy up
    front instead; read-only is refused for the same reason.
  • Scoping a Codex agent's network reach takes two more keys, both
    documented in the permissions guide: [features.network_proxy] with a
    domains allow-list (keep 127.0.0.1/localhost on it, or reporting
    breaks), and web_search = "disabled" to remove the built-in web tool,
    which is not a command and so is reachable through any .rules deny-list.
    Codex's own docs present named [permissions.<name>] profiles for this;
    that form silently does nothing in a workspace policy under codex exec,
    so the guide steers to the proxy form. Harbour validates neither — a policy
    can pass every check with network wide open.
  • Workspace trust is recorded automatically for both CLIs before an
    enforced run spawns — Claude via hasTrustDialogAccepted in
    ~/.claude.json, Codex via a [projects."<dir>"] entry in
    $CODEX_HOME/config.toml — because each CLI silently ignores a workspace
    policy in a directory it does not trust.
  • New CLI command: harbour policy check [--agent <slug>] reads the
    agents table straight from the database (read-only, no server needed) and
    resolves every agent's policy with the same code the runner uses — one line
    per agent plus a summary, exit 1 when any enforced agent would be refused.
    Usable as a pre-deploy gate when upgrading.
  • Migration. The orgs removal above already makes a fresh database the only
    supported path across this release, which covers this change too — a new DB
    gets the column from the schema. If you are instead carrying data forward by
    hand, add the column yourself or the server refuses to boot with a
    schema-drift error: ALTER TABLE agents ADD COLUMN permissions TEXT NOT NULL DEFAULT 'enforced';.
  • Every existing agent becomes Enforced, however you arrive — that is the
    point of the change. Before its next run each agent needs a policy file in
    its workspace or a deliberate flip to Unrestricted in the dashboard; a run
    that finds neither fails closed with the reason in its activity. Run
    harbour policy check to see where every agent stands.

Runs

  • The dashboard's Recent feed shows individual runs again — the v2.1.0
    collapsed summary rows are gone. Skipped runs no longer appear in the feed
    (they remain reachable via the All Runs "Skipped" filter); a job shows at
    most a few of its latest successes (the new "Successes Per Job" setting,
    recent_runs_per_job, default 3) so a frequently-firing job can't bury
    other activity; failed and killed runs always appear individually. The
    "Collapse repeated successes" setting (recent_collapse_success) is
    removed.

Agents

  • Codex model dropdown updated to the 5.6 lineup: gpt-5.6-sol,
    gpt-5.6-terra, gpt-5.6-luna. Removed gpt-5.5 and gpt-5.4. Reasoning
    levels gain max (Codex now accepts the same low/medium/high/xhigh/
    max ladder as Claude).

Install and operation

  • New production installs default to 127.0.0.1:4272. npm start and
    harbour start now share that explicit loopback default with the bundled
    runner; use HARBOUR_PORT during setup for a coordinated custom install, or
    use server-only PORT/CLI --port with HARBOUR_URL or
    ~/.harbour/runner.url configured separately. Bare development
    starts consistently use port 3001. Page metadata uses the same local default
    unless HARBOUR_PUBLIC_URL is set at build time. Existing service
    definitions are not rewritten; when retaining port 3000, explicitly keep
    the server PORT and runner HARBOUR_URL aligned.
  • Setup is platform-safe. macOS runner installation persists its
    non-secret configuration and uses modern launchd commands. Linux setup no
    longer attempts to install a launchd service and points operators to the
    documented systemd units instead. Both platforms now use the same supported
    harbour start production path rather than mixing next start with a
    standalone-output build.

Removed

  • OpenCode and LLM connections are removed — the provider surface is back to
    Claude Code and Codex only while the agent model is refined. Gone: the
    opencode CLI option, the LLM Connections dashboard page and nav entry,
    the /api/llm-connections routes, the llm_connections /
    llm_connection_secrets / agent_llm_connections tables, the claim payload's
    agent.provider and runner-private runtime.llm.api_key blocks, and the
    runner's OpenCode config generation, env isolation, and session fingerprints.
    A Secret is no longer reservable as a provider credential, so secret deletes
    no longer 409 and no Secret is withheld from job env. Output redaction and
    the cross-CLI session-resume guard are kept. On a fresh database the three
    tables are simply never created; existing databases keep them unused
    (harmless — nothing reads them). The work is parked on the
    feat/opencode-connections branch.
  • Gemini CLI is no longer an agent provider. New and updated agents accept
    only claude or codex; the dashboard no longer detects or offers Gemini,
    and the bundled runner no longer advertises, launches, resumes, or parses it.
    Existing Gemini-backed agent rows are not migrated or supported.
  • Captain, the in-browser CLI console, is removed — the /captain dashboard
    page and message UI, the /api/captain conversation routes, the server-side
    process manager/providers/workspace libs, the Captain settings panel and nav
    entry, and the captain_* tables. Captain launched an unsandboxed host CLI on
    behalf of any org editor, which fits poorly with Harbour's least-privilege
    posture; agent jobs, workflows, and the admin API cover its real uses. On a
    fresh database the captain_* tables are simply never created; existing
    databases keep the now-unused tables (harmless — nothing reads them).

Docs

  • Documented the one-time npx playwright install chromium step the local e2e
    suite needs (version-pinned bundled Chromium, not system Chrome).