DocsConfigure

Profiles & workflows

Design how agents work in the Behaviors editor, and understand the plain JSON files behind it.

A single agent loop decides its own path. A workflow decides it for the agent: which steps run, what each may use, what must be verified, and what happens on failure. Each agent step runs under a profile that sets its instructions, tools, limits and completion checks.

Both are edited in the Behaviors tab and stored as plain JSON in your workspace:

Kind Location
Profiles .rusty/profiles/<id>.json
Workflows .rusty/workflows/<id>.json

Note

Rusty ships with 12 profiles and 20 workflows, available in every project. Choose one from the Mode menu in Agent Mode. They are read-only, so they always stay in a known-good state. To change one, choose Customize a copy: you get your own editable copy, saved in your workspace. This page is about customizing and writing your own. To learn what the built-in ones do and how to run them, start with Workflows.

The Behaviors editor

Tip

Every control is described in The workflow editor, and Your first workflow walks through making one. This section is a short summary.

Open Behaviors in the left rail. A switch at the top left toggles between Workflows and Profiles, and the list beside it shows what you have. The built-in workflows and profiles are tagged Built-in.

  • The workflow view draws steps as nodes and their connections as edges. The buttons above the canvas add steps: Input, Agent, Verify, Approval, Subflow and Output. Select a step or an edge to edit it in the inspector, drag from a step's right handle to another step to connect them, and drill into an agent step to see its profile.
  • The profile view draws profiles as nodes, with switch_profile rules drawn as edges between them.
  • Steps show the state of the latest run, such as succeeded or running, and a badge such as Last run cancelled summarizes it.
  • Run in Agent Mode starts the selected workflow from Agent Mode, with that chat's model and tools. New workflow creates one.
  • Edits are validated as you make them, and a step or profile with a validation problem is flagged.
  • A dot marks unsaved changes, and the button at the top right reads Saved when everything is written.

For a built-in workflow the inspector is read-only and says Built into Rusty · available in every project, with Customize a copy at the top.

The workflow inspector

With nothing selected, the inspector at the right edits the workflow itself:

Field Meaning
Name and Description How the workflow is listed and described.
Revision A number you can bump as you change it.
Status Draft, Published or Deprecated.
Optional limits Budgets for a whole run. Leave a field empty for no limit.

The optional limits are Steps, Total attempts, Duration (seconds), Stall timeout (seconds), Model requests, Tool calls, Tokens and Cost (USD). You can also stop a running workflow at any time.

Because the documents are plain JSON, fields the editor does not know about survive a load and save. Use the JSON toggle in the inspector header to see and edit a document's raw JSON. Canvas positions are stored under metadata.editor.position, which the engine ignores.

Run a workflow

In Agent Mode, the Mode menu above the message box picks what the chat follows: Single agent, a Stage, a Workflow, or Auto. See Workflows for how to run one and how stages build on each other, and Auto flows for letting Rusty choose.

While a chat follows a workflow, the skill menu stays on build and reads tools set per step: each step's profile decides its tools.

Built-in profiles and workflows

The 12 built-in profiles (Research, Analyze, Plan, Architect, Debug, Build, Verify, Review, Security, Document, Refactor and Optimize) and 15 built-in workflows are described in Built-in workflows, including what each step can do. Their IDs start with rusty-ide.builtin.. Customize a copy to start from any of them.

Profiles

A profile describes what one agent step may do. This is the built-in Plan profile, trimmed. (In the app its ID is rusty-ide.builtin.plan; your own profiles use the IDs you give them.)

{
  "schema_version": 1,
  "id": "plan",
  "revision": 3,
  "name": "Plan",
  "description": "Read-only investigation. Explores the workspace and produces a concrete plan.",
  "status": "draft",
  "instructions": {
    "mode": "append",
    "text": "Investigate the request and write an actionable implementation plan..."
  },
  "tools": {
    "type": "allow_list",
    "tools": ["read_file", "list_files", "search_codebase", "web_search", "web_extract", "report_progress", "ask_user_question"]
  },
  "rules": [
    {
      "id": "plan-read-only",
      "on": "PreToolUse",
      "when": { "tool": ["write_file", "run_command"] },
      "do": { "deny": { "reason": "The plan step is read-only. Describe the change in the plan instead of making it." } }
    }
  ],
  "completion_gate": {
    "checks": [
      {
        "id": "explored-first",
        "require": { "calls": { "tool": ["read_file", "list_files", "search_codebase"], "gte": 1 } },
        "feedback": "You have not looked at the code yet. Explore the relevant files before proposing a plan."
      }
    ],
    "max_continuations": 2,
    "on_exhausted": "fail"
  }
}

Profile fields

Field What it does
id, name, description, revision, status Identity and bookkeeping. Built-in profiles have IDs starting with rusty-ide.builtin..
instructions Text added to the agent's instructions. mode: "append" adds to the base instructions.
tools Which tools the step may use. { "type": "inherit" } keeps whatever the surrounding session allows. { "type": "allow_list", "tools": [...] } limits it to the named tools. Anything written for write_file (an allow-list entry, a rule, a permission) also applies to edit_file, so a read-only profile stays read-only. Naming edit_file applies to that tool alone. An allow-list that names read_file also admits project_info, but a rule about read_file does not apply to it. Anything written for run_command (an allow-list entry, a rule, a permission, a gate that counts commands) also applies to run_check and install_dependencies, so a profile that forbids running commands forbids running checks and installs. Naming run_check itself matches only that tool, which is how a rule asks for a check in particular.
tool_overrides Adjusts how a tool is described to the model, for example description_append to add a guideline to write_file. A description note applies to the named tool only: add one for edit_file separately if you want it there too.
limits Optional turn and tool-call limits. Unset in the built-in flow.
rules Event-driven rules that steer the agent. See below.
completion_gate Checks the agent must satisfy before it is allowed to finish. See below.
children Settings for subagents this step starts. { "type": "inherit" } is the default.

Rules

A rule reacts to an event and takes an action.

{
  "id": "build-failed-tool",
  "on": "PostToolUseFailure",
  "do": { "inject": { "text": "That tool call failed. Read the error and fix the cause; do not repeat the same call unchanged." } },
  "max_fires": 8
}
Part Values
on (event) RunStart, BeforeModelRequest, PreToolUse, PostToolUse, PostToolUseFailure, ProfileEntered
when (optional filter) For example { "tool": ["write_file"] } to match specific tools, or { "turn": { "gte": 3 } } to match after a number of turns.
do (action) inject, deny, ask, allow, stop_run, switch_profile, rewrite_args, rewrite_result
max_fires Optional cap on how many times the rule can trigger.

Which actions are valid depends on the event:

Action Effect Valid on
inject Adds guidance text to the conversation. Any event
deny Blocks the tool call, with a reason the agent sees. PreToolUse
ask Asks you first. PreToolUse
allow Allows the call to proceed. PreToolUse
rewrite_args Merges values into the call's arguments. PreToolUse
rewrite_result Edits a tool's result before the agent sees it. PostToolUse, PostToolUseFailure
stop_run Ends the run, with a reason. Any event
switch_profile Hands the run to another profile. Any event except ProfileEntered

Completion gates

A completion gate stops an agent from declaring victory too early. Each check has a require condition and a feedback message the agent receives when the check fails. The agent is sent back to keep working up to max_continuations times; if it still fails, on_exhausted: "fail" fails the step.

The built-in Build profile uses this to require that any edit is followed by a check:

{
  "id": "checked-after-editing",
  "require": {
    "any": [
      { "calls": { "tool": "write_file", "eq": 0 } },
      { "since_last_call": { "of": "write_file", "called": "run_check", "gte": 1 } },
      { "all": [
        { "not": { "tool_offered": "run_check" } },
        { "since_last_call": { "of": "write_file", "called": ["run_command", "read_file"], "gte": 1 } }
      ] }
    ]
  },
  "feedback": "You changed files but have not run a check since your last edit. Call run_check (typecheck, lint, test or build) now; reading the changed file back does not count. If a check fails because of your change, fix it and run it again."
}

In words: either no files were written, or since the last write the agent ran run_check. Reading the file back does not count. If the session gave the agent no way to run a check at all (tool_offered is false for run_check), the older rule applies instead, so the gate can always be met. Refactor and Optimize work the same way, and Verify requires a run_check too, since reading files is not verification. install_dependencies is a separate tool from run_check on purpose: installing proves nothing about the code, so it can never stand in for having run a check.

A check that ran and failed still satisfies this gate. It asks that the agent looked, not that the project is green, because a project that was already failing before the agent touched it could otherwise never finish. What happens after a failure is handled by a rule instead: while a check has failed since the last edit and none has passed, the agent is reminded to fix what it broke, or to name failures that were already there, and never to call the work passing.

Build must finish what it was given. Build ends its report with a status line, Status: done or Status: blocked — <what only you can provide>, and its gate has a work-finished check that requires one of them: { "final_status": ["done", "complete", "completed", "blocked*"] }. A report that says Status: not done, or has no status, is sent back with "continue with the next unfinished task" instead of going on to Verify half done. final_status reads the last Status: line (or the line under a ## Status heading, or the status field of a JSON answer), lower-cased and cut at the first dash or punctuation, so **Status:** Not done — tests remain reads as not done. The check is marked "waive_when_exhausted": true: when the gate runs out of max_continuations, it lets the answer through (Verify still judges the work) rather than failing the step, while any other failing check still applies on_exhausted.

Conditions can look at whether a call succeeded or failed. outcome (succeeded or failed) narrows calls, turns_since_call and the called side of since_last_call to calls whose result was or was not an error, and run_check reports a failing check as an error. To require a passing check, use "called": "run_check", "outcome": "succeeded" in your own copy of a profile. That suits a project whose checks are green. A command run through run_command always counts as succeeded, because the harness cannot read a failure out of its output; that is one reason to prefer run_check.

Workflows

A workflow is a graph of steps. For the ideas behind it (what each kind of step does, how work is handed on and sent back), read How workflows work first. This is a minimal plan, build and verify flow with text handoffs:

{
  "schema_version": 1,
  "id": "plan-build-verify",
  "name": "Plan, build, verify",
  "status": "draft",
  "nodes": [
    { "id": "input", "name": "Request", "type": "input" },
    {
      "id": "plan", "name": "Plan", "type": "agent",
      "config": {
        "instructions": "Investigate the request and write an actionable implementation plan...",
        "tools": { "type": "inherit" },
        "context_mode": "isolated_child",
        "structured_output": "text",
        "profile": { "id": "plan" }
      },
      "input_bindings": [
        { "target": "request", "source": { "type": "run_input", "pointer": "/request" } }
      ]
    },
    {
      "id": "build", "name": "Build", "type": "agent",
      "config": { "context_mode": "isolated_child", "structured_output": "text", "profile": { "id": "build" } },
      "input_bindings": [
        { "target": "request", "source": { "type": "run_input", "pointer": "/request" } },
        { "target": "plan", "source": { "type": "node_output", "node_id": "plan", "pointer": "" } }
      ]
    },
    {
      "id": "verify", "name": "Verify", "type": "agent",
      "config": { "context_mode": "isolated_child", "structured_output": "text", "profile": { "id": "verify" } },
      "input_bindings": [
        { "target": "request", "source": { "type": "run_input", "pointer": "/request" } },
        { "target": "plan", "source": { "type": "node_output", "node_id": "plan", "pointer": "" } },
        { "target": "build", "source": { "type": "node_output", "node_id": "build", "pointer": "" } }
      ]
    },
    {
      "id": "output", "name": "Result", "type": "output",
      "config": { "source": { "type": "node_output", "node_id": "verify", "pointer": "" } }
    }
  ],
  "edges": [
    { "id": "input-plan", "source": "input", "target": "plan", "condition": "on_success" },
    { "id": "plan-build", "source": "plan", "target": "build", "condition": "on_success" },
    { "id": "build-verify", "source": "build", "target": "verify", "condition": "on_success" },
    { "id": "verify-output", "source": "verify", "target": "output", "condition": "on_success" }
  ]
}

Steps

Step type Purpose
input Receives the run input (request, context, attachments). Exactly one per workflow.
agent Runs an agent, optionally under a profile, and optionally as a task_queue.
verify Checks earlier results without a model. A failure sends the work back to its retry_target, follows an on_failure edge, or fails the run.
approval Waits for a person to approve, request changes (sent back to revise_target) or reject.
subflow Runs a saved workflow, or one step, inside this one.
output Picks which step's output becomes the workflow's result. At least one, and nothing may follow it.

Every agent step runs in a fresh, isolated session (context_mode: "isolated_child") that inherits your workspace, active model and permission policies. Steps hand work to each other as ordinary text or Markdown unless a step sets a JSON structured_output with an output_schema. A finished workflow means every step finished, not that every check passed, so read the result.

Inputs and edges

  • input_bindings say where each named input to a step comes from: the run input ({"type": "run_input", "pointer": "/request"}) or an earlier step's output ({"type": "node_output", "node_id": "plan", "pointer": ""}). pointer is a JSON pointer: "" is the whole value, /summary one field. The target is the name the agent sees in its workflow_input. A step can read only steps that are certain to have run before it.
  • edges connect steps. condition is on_success for the normal path or on_failure to route a failure somewhere else. Each step has exactly one on_success edge (output steps none) and at most one on_failure edge. Cycles are refused: loops come from retry_target and revise_target.
  • retry on a step sets max_attempts (1 to 10) and retry_on, the failures that may use them: backend_rate_limited, backend_timeout, tool_timeout, invalid_structured_output and verification_failed. A step that a verify step retries must list verification_failed.

Verify steps and checks

{
  "id": "gate", "name": "Acceptance", "type": "verify",
  "config": {
    "checks": [{ "type": "criteria", "pointer": "/check/criteria", "plan_pointer": "/plan" }],
    "retry_target": "build"
  },
  "input_bindings": [
    { "target": "check", "source": { "type": "node_output", "node_id": "verify", "pointer": "" } },
    { "target": "plan", "source": { "type": "node_output", "node_id": "plan", "pointer": "" } }
  ]
}

Pointers in checks read the step's bound inputs, by binding name.

Check Fields Passes when
criteria pointer; optional plan_pointer, block_on (default ["fail"]), defer (default ["manual"]), max_deferred The {id, status, evidence, how_to_test?} list at pointer is not empty and has no block_on status. A defer status moves on and is collected in the step's manual_checks. With plan_pointer, every acceptance criterion of that plan must be reported.
required_status pointer, equals The text at pointer equals equals.
artifact_exists pointer The value at pointer is present and not empty.
artifacts_resolvable pointer Every {kind, reference} entry in the list at pointer resolves in the workspace.
schema none Every bound output matches its producer's output_schema.
requirements_satisfied plan_pointer, results_pointer Every acceptance criterion in the plan has exactly one passing, evidenced result.

retry_target names an earlier agent step to send failed work back to, with the failure as feedback. The steps between run again. Without it, a failure follows the step's on_failure edge or fails the run.

Approval steps

The two approvals in the built-in pipelines:

{
  "id": "approve_plan", "name": "Plan approval", "type": "approval",
  "config": {
    "subject": { "type": "node_output", "node_id": "plan", "pointer": "" },
    "prompt": "Read the plan before anything is built. ...",
    "revise_on_notes": true
  }
},
{
  "id": "confirm_checks", "name": "Manual checks", "type": "approval",
  "config": {
    "subject": { "type": "node_output", "node_id": "gate", "pointer": "/manual_checks" },
    "prompt": "Verification passed, but these checks need a person. ...",
    "revise_target": "build",
    "skip_if_empty": ""
  }
}
Field Default Meaning
subject required What the person reviews: a run-input or step-output binding.
prompt generic question Shown above the subject.
revise_target the subject's step The earlier agent step that requested changes go back to.
max_revisions 5 How often changes may be requested (at most 10). Requested changes do not use the target's attempts.
allow_auto_approve true Whether the run may pass this step by itself. false asks, unless Auto mode is on, which approves it too.
skip_if_empty never skip A pointer into the subject; when nothing is there, the step passes without asking. "" means the subject itself.
revise_on_notes false Approving with notes revises the result first, then the approval stands.

The step's output is {decision, by, notes, subject}, so a later step can read the person's notes, as the built-ins do with {"type": "node_output", "node_id": "approve_plan", "pointer": "/notes"}.

Subflow steps

{
  "id": "investigate", "name": "Investigate", "type": "subflow",
  "config": { "target": { "type": "flow", "id": "rusty-ide.builtin.investigate" } },
  "input_bindings": [
    { "target": "request", "source": { "type": "run_input", "pointer": "/request" } },
    { "target": "context", "source": { "type": "run_input", "pointer": "/context" } }
  ]
}

target is either {"type": "flow", "id": "...", "revision": 2} (revision optional; the latest otherwise) or {"type": "step", "instructions": "...", "profile": {"id": "..."}, "tools": {...}, "model": "..."}, where only instructions is required. The step's bindings are the child run's input, and the child's result is the step's output. Flows can call flows three levels deep. Saved workflows that a run calls are sent with it, and the built-in ones are always available.

Task queues

An agent step with task_queue builds a plan task by task:

"task_queue": {
  "plan_pointer": "/plan",
  "review_profile": { "id": "rusty-ide.builtin.review" },
  "review_instructions": "Review the change made for workflow_input.task against its acceptance criteria. ...",
  "max_repairs": 2,
  "on_task_failure": "ask"
}

plan_pointer points into the step's bound inputs: its first segment names the binding the plan comes from, and that plan must contain requirements with acceptance criteria and tasks (the built-ins give Plan the rusty.task_plan output schema). on_task_failure is ask, skip or stop. An optional flows map, {"research": {"type": "flow", "id": "..."}}, names workflows a task may run instead of a builder by setting its flow. The step's output is an object listing the completed tasks, whatever its response format.

Limits and timeouts

policies holds the workflow's budgets, all optional: max_steps, max_total_attempts, max_elapsed_ms, stall_timeout_ms, max_model_requests, max_tool_calls, max_tokens and max_cost_usd. The built-in workflows set max_total_attempts to 40 and stall_timeout_ms to 600000 (10 minutes without a sign of life cancels and retries a step; waiting for a person does not count). A step can also set timeout_ms, and a profile limits (turns and tool calls); the built-in profiles leave those unset. The editor offers fields for all of them, and workflows written as raw JSON keep working through the advanced settings.

Choosing and switching flows

Two optional fields in a workflow's metadata (which the engine ignores) let Auto and flow switching work with it. The built-in workflows set them; your own can too.

"metadata": {
  "route": { "when": "The user wants to understand how existing functionality works before deciding anything." },
  "switch_to": ["diagnose", "security-audit"]
}
Field Meaning
route.when When this workflow is the right one for a message, in a sentence or two. The decision model reads it. A workflow without it is never picked by Auto.
switch_to Ids of the workflows this one may hand over to when flow switching is on. Use the workflow's id; for a built-in workflow, the id without rusty-ide.builtin.. A workflow without it never hands over.

Whether a workflow can change files is not declared: Rusty reads it from the profiles its steps use. A workflow edits unless every agent step's profile either has an allow-list without write_file, or has a PreToolUse rule that denies write_file. Auto and flow switching ask before starting one that does.

The built-in workflows hand over only to the read-only stages. For example Plan, build, verify may hand over to Research & analyze, Debug & plan a fix or Security audit & fix plan.

Tips

Tip

Start from Customize a copy of the built-in flow rather than writing from scratch. Change a profile's instructions, add a deny rule for a command you never want run, or tighten the tool allow-list, and watch how the next run behaves.

  • Commit .rusty/profiles/ and .rusty/workflows/ so your team shares the same behavior.
  • Keep completion-gate feedback specific. It is the message the agent acts on.
  • Use deny and ask rules for guardrails. See Permissions & safety.
Esc

Type to search the docs.