start_task
Dispatch a coding task to a headless agent and return immediately, so you can poll status or wait for completion while the run continues in the background.
Instructions
Dispatch a coding task to a headless agent and return immediately.
conversation_profile explicitly requests a qualified native control
transport (native or shipped-medium35-high). Missing runtime/profile
qualification refuses before launch; this does not enable caller approvals.
Args:
prompt: Instructions for the agent. Be specific about the desired end state. Write it in
plain prose: preserve spaces and word boundaries, and never concatenate words or strip
whitespace to shrink the payload — harflow_mcp stores and delivers the text exactly as
submitted, so compressed text reaches the agent exactly as garbled. Blank or
all-whitespace prompts are rejected rather than trimmed into shape.
repo_path: Absolute path to a git repository; the agent's working directory.
backend: Which harness to use — "claude", "codex", "opencode", "vibe" or "antigravity". See
list_backends.
freedom: "read_only", "write_in_repo" (default), "publish", or "unrestricted". "publish"
sits between "write_in_repo" and "unrestricted": it authorizes an attempt to
remote publishing, including commit/push/PR creation/reviews, but that is not a promise the attempt succeeds — credentials,
remote permissions, branch protection and hooks are all
outside harflow_mcp's control. On Claude Code, write_in_repo denies a direct git commit
and git push; publish authorizes committing; inherited harness rules can still restrict it. enforcement.local_commit
reports that policy as denied, allowed, or not_enforced. How each level is enforced
depends on the backend; the returned enforcement says what actually applies, via
local_commit, publish_attempts_allowed and network_access among other fields.
model: Model for this run, in the backend's own naming. Rejected outright, rather than
silently ignored, when model selection is unsupported. Vibe accepts a configured
model alias through its qualified ACP transport and verifies the selected alias;
see list_backends' capabilities.supports_model_selection.
background_idle_seconds: Optional finite positive live-input background wait bound,
at most 21600 seconds. Capped/classic runs do not use live-input idle waiting.
Continuations inherit the saved effective bound unless overridden.
max_turns: Cap on agent turns. Only some backends support this; asking for it on one that
does not is an error rather than being silently ignored.
reasoning_effort: "low", "medium", "high" or "xhigh", passed to the backend verbatim.
Rejected up front when the chosen backend has no effort control at all (vibe is
config-only and has none), or is asked for a level outside the ones it declares (see
list_backends — antigravity accepts only low/medium/high, and its CLI would refuse
xhigh before the run starts, exit 1); harflow_mcp cannot tell whether the chosen
model honours it — on opencode in particular, a model with no declared variants
silently ignores an unsupported level rather than erroring, and on antigravity a model
id that encodes its own level makes the CLI refuse --effort at startup. See
list_backends' per-backend reasoning_effort caveats for what is and is not known there.
caller_approvals: Opt in to version-qualified exact-action caller decisions: Bash, plus Read
on Claude Code 2.1.310 (approving a Read can disclose files outside the repository).
Qualified Codex app-server and Vibe ACP transports also support exact-action decisions;
supported tools, freedoms, caps and platforms are in list_backends caller_approval_support.
Defaults off;
worker self-approval is prohibited. Decisions do not override saved policy or grant
reusable access. Inspect list_approval_requests and get_approval_request before responding.
caller_write_approvals: Additionally allow Write and Edit requests (including outside the
repository) to be approved one exact action at a time. Requires caller_approvals and a
version that qualifies it; defaults off, in which case Write and Edit requests are answered
with a delivered Harflow refusal. Harflow-protected paths are always refused.
interaction_owner: caller by default; monitor requires the verified human Monitor path.
network: Optional boolean asking for network access independently of freedom: True
asks harflow_mcp to impose no network barrier of its own, False asks it to impose one,
and None (the default) keeps each freedom's historical behaviour exactly. The
parameter governs harflow_mcp's own network barrier only — never reachability: a
corporate firewall or proxy defeats it too. Codex accepts sandbox network pins, whose effective barrier can be bypassed by inherited rules, and its support is non-rectangular (see
capabilities.network_control): enabling is refused at read_only and blocking at
unrestricted. On claude, opencode, vibe and antigravity, True is accepted — there is
nothing to impose — and False is an error rather than silently dropped;
enforcement.network_access stays "not_controlled" there. The established guarantee is
stated on the returned task's enforcement.network_access; requested pins alone are not proof.
group: Optional label (1-128 chars), inherited by any nested dispatch this task's own
agent makes through harflow_mcp (unless that dispatch gives its own). Useful for
tagging a family of dispatches you want to find together later via list_tasks. It
also names a scratch folder shared by every task in the group, exposed to the
agent as $HARFLOW_GROUP_SCRATCH and reported as scratch.group in task status
(see docs/shared-scratch.md); every task also gets $HARFLOW_CHAIN_SCRATCH, shared
with its resumes and continuations.
title: Optional short human-readable label (at most 90 characters after trimming, no
control characters) shown for this task in the Monitor. Purely informational. It is
never inherited from a calling task: a dispatch without a title has none. A
resume_task continuation carries the resumed task's title.
auto_continue: Integer 0–10 (default 0). Opt in to that many fresh successors after
backend-confirmed recoverable cutoffs and observed process/output settlement.
Supported cutoff profiles are backend-owned; missing answers alone never qualify.
Cancellation, permission denial, usage limits and workflow-owned tasks are excluded.
Detached task owners preserve automatic continuation across MCP server death.
Task-owner death retains uncertain reservations rather than duplicating execution.
notify: Configured destination alias, direct callers only. Intent is durable before spawn.
Receivers must deduplicate stable IDs; retries resume only while a server is active.
observe_repos: Optional list of up to seven absolute repository paths to observe alongside
the launch directory. Observation grants no filesystem or publishing authority.
extra_writable_paths: Optional bounded list of existing absolute local file or directory
paths. At most 16 paths, 4096 UTF-8 bytes each and 16384 bytes total. Relative paths,
missing/special paths, filesystem roots and canonical duplicates are errors. Only
version-qualified configurations in capabilities.extra_writable_paths are supported;
other harnesses/configurations reject the request. The certified bounded mode clears
ambient writable roots and excludes implicit temporary roots. Known external execution
configuration namespaces of all registered backends remain protected; existing unsupported
inputs reject requests. Inherited repository configuration authority gains no new exclusions. Grants permit reads
as well as writes, never publication. Omission inherits a detected owner's grants;
nested requests cannot widen them. Saved grants and path identities carry through
resume/continuation; replacement requires a new authorized task. Workflows and
native adapters do not accept these grants. Use preview_task_permissions before launch.
Keep qualified startup inputs stable: checks refuse observed changes but do not atomically
pin configuration or executables against independently authorized concurrent writers.
group_report_output: Opt in to a qualified read_only repository run with write access only
to its own nonempty group scratch folder. Defaults off; resumes/continuations inherit
unless overridden. Unsupported backends and conflicting grants are refused; see list_backends.
Prompt prose is preserved; use $HARFLOW_GROUP_SCRATCH/report-$HARFLOW_TASK_ID.md.
git_https_rewrite: Optional boolean overriding HARFLOW_GIT_HTTPS_REWRITE (default on).
Appends process-local GitHub SSH-to-HTTPS URL configuration; never changes Git files.
HTTPS credentials, sandbox access and reachability remain external requirements.
allowed_commands: Optional list of Bash command patterns granted for this run only, so a task can run
specific commands (a test runner, a build) without `unrestricted`. At most 16 patterns, 256 bytes
each and 2048 in total. Supported on qualified Claude Code and Vibe ACP at write_in_repo and publish
(see list_backends capabilities.allowed_commands); other backends and access levels refuse it. Each
pattern is a lowercase program followed by literal tokens, with at most one `*` as the final
token or the `:*` suffix (`pytest` style: `python3 -m pytest:*`), and a wildcard needs a literal
subcommand or target (`make test:*`). A pattern with no wildcard is exact and matches one command
line; `:*` or a final `*` is a prefix. A bare program name such as `swiftlint` is exact: it matches
only that command with no arguments, and the dispatch notice suggests `swiftlint:*` or
`swiftlint lint:*`. Options before a goal are literal and order-sensitive, so `mvn -o test:*`
does not match `mvn -q -o test`; `mvn -o:*` is refused because a goal must follow the options.
A launcher whose command has no subcommand, such as `npx tsc:*`, is refused; grant the exact
command, for example `npx tsc --noEmit -p .`. Programs whose arguments start with options, such
as `xcodebuild -workspace App.xcworkspace -scheme App test`, cannot take a wildcard: grant each
full command line exactly. Shells, wrappers, interpreter evaluation and gh below
`publish` are refused. Exact Git fetch, ff-only pull and non-force switch/create grants are
supported at write_in_repo and publish; wildcard/config/reset/force Git grants are refused.
Initial transition grants require clean checkouts; later dirty races remain Git controlled.
Commit/push authority is separate (`publish`); paths must stay inside the repository.
The grammar is a guard against mistakes, not a security boundary: grants are Claude permission-layer
approvals, not OS enforcement. An exact pattern matches one command line and a prefix matches that
command with further arguments. A granted program can run repository code, chained commands need every
part allowed, and the access level's git commit and push denies still win, except the exact
merge-conclusion grant (`git commit --no-edit` or `git merge --continue`) which omits the
broad commit deny and is gated on MERGE_HEAD. Ordinary commits stay refused.
Omitted or null grants
nothing. A nested dispatch may grant only exact patterns its caller holds (unless the caller is
unrestricted) and never inherits them. resume_task and continue_task inherit the saved list when
omitted and replace it when given. Status reports each grant's match as
enforcement.extra_allowed_command_matches. See docs/harness-permissions.md.
branch: Optional literal branch name, set together with base. Harflow fetches that base and
runs `git switch -c` before the agent starts, at any freedom except read_only. Refused
when the checkout is dirty, the branch exists, the base cannot be fetched, or a merge or
rebase is in progress. Never stashes, resets or forces. Resume and continuation reuse the
prepared branch and do not accept branch or base.
base: Remote-tracking base `<remote>/<branch>`, for example origin/develop. The first
component is the remote. Set together with branch.
fetch: true refreshes the default remote; a list of literal remote names refreshes those.
Harflow runs `git fetch --prune` before the agent, at every freedom and backend, including
read_only. A failure is recorded and the task still starts unless fetch_required is true.
fetch_required: When true, a fetch failure refuses dispatch and the agent does not start.
Requires fetch.
resources: Optional list of 1-16 resource names (lowercase letters, digits and `. _ : -`, at most
64 characters, starting with a letter or digit; for example `ios-simulator` or `repo:main`)
this task needs exclusively. Capacity is one per name: the task does not start until it
holds every name, strictly first come first served per name, all or none. While it waits
it has no task record: the call returns at once with `status: "running"` and
`launch_state: "waiting_for_resources"`, and get_task_status, wait_for_task, list_tasks and
cancel_task all work on it. Names are released when the run's exit is observed. Resources
grant no access and are accepted at every freedom; they need a supervised server or
`harflow-ctl`. A task started by a task that holds resources may only use names that parent
declared (they are borrowed, never queued); declare every resource at the outermost task.
A task started from inside a workflow attempt cannot request any in this release.
resume_task, continue_task and automatic continuation re-queue the same names. See
docs/resources-and-worktrees.md.
resource_wait_seconds: How long to wait for `resources`, 0..21600 (default 3600). 0 means grant
now or fail. A task that waits out the bound never starts and reports `not_started`.
worktree: Optional `{base_ref?, branch?, detach?}`: run the task in its own linked Git worktree,
`<HARFLOW_WORKTREE_ROOT>/<task_id>` (default root `~/.harflow-worktrees`), so it can write
without touching your checkout or index. `base_ref` (default the repository's HEAD) is
resolved to a commit after any resource wait; `branch` (default `harflow/<task_id>`) must
not exist yet, or `detach: true` checks out the commit with no branch. The task's
`repo_path` and working directory are the worktree, and `worktree.source_repo_path`
keeps the original. Refused at `read_only`, for nested dispatches and for a repository that
configures Git filter drivers (including LFS); repository hooks do not run while it is
created. Nothing removes a worktree or deletes its branch automatically: use
`harflow-ctl worktree-list` and `worktree-remove`. The call returns once the launch is
accepted, typically with `launch_state: "granted"` while the worktree is made. See
docs/resources-and-worktrees.md.Returns the new task_id and its starting state. The run continues in the background; poll get_task_status or call wait_for_task to follow it.
If this task is itself dispatched from inside another harflow_mcp task's agent (a nested MCP
call), that ancestry is recorded — spawned_by, root_task_id, depth — on a best-effort
basis (see lineage_detected on the returned task: which detection method found the caller,
or null if none was found and this is treated as a root task). When a caller is detected,
this dispatch is also checked against it: a nested dispatch weaker than its caller on depth or
on any enforcement field is refused outright (NestedDispatchRefused). This cap is
best-effort, not a sandbox boundary — nothing stops an agent from dispatching outside
harflow_mcp entirely.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>",
"repo_path": "<repo_path>"
},
"name": "start_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | ||
| fetch | No | ||
| group | No | ||
| model | No | ||
| title | No | ||
| branch | No | ||
| notify | No | ||
| prompt | Yes | ||
| backend | No | ||
| freedom | No | ||
| network | No | ||
| workflow | No | ||
| worktree | No | ||
| max_turns | No | ||
| repo_path | Yes | ||
| resources | No | ||
| auto_continue | No | ||
| observe_repos | No | ||
| fetch_required | No | ||
| allowed_commands | No | ||
| caller_approvals | No | ||
| reasoning_effort | No | ||
| git_https_rewrite | No | ||
| interaction_owner | No | caller | |
| group_report_output | No | ||
| conversation_profile | No | ||
| extra_writable_paths | No | ||
| resource_wait_seconds | No | ||
| caller_write_approvals | No | ||
| background_idle_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||