Run an Agent
Start one bounded Agent turn, inspect its exact state, and continue the same owner-private conversation when another message is needed.
Prerequisites
Section titled “Prerequisites”- Use agents or Full control access.
- An active Agent returned by Crewhelm.
- A bounded prompt with a clear expected outcome.
- Exact Brief revisions if this Run needs owner-provided context.
Authority and custody
Section titled “Authority and custody”Each run operation creates a new Run. Admission freezes the Agent and fleet
revisions, prompt, optional Briefs, output contract, policy, and budget. A conversation handle is a
private coordinate for continuation, not permission to run.
Agent tools come from the admitted Agent revision. A visible tool still requires its current grant, limits, effect classification, and any required owner approval before dispatch.
Start a new conversation
Section titled “Start a new conversation”- Call
crewhelm_inspect_agentswithoperation.kind: "list"and keep the selected Agent object. - Call
crewhelm_change_workwithoperation.kind: "run", that Agent, and themessage. Omitconversationto start a new one. - Attach no more than the exact Brief revisions needed for this task.
- Omit
outputContractfor normal Markdown. Use a bounded object-root JSON contract only when downstream software requires a typed final object. - Retain
run.runIdand the returnedconversationunchanged.
Inspect and continue
Section titled “Inspect and continue”- Call
crewhelm_inspect_workwithoperation.kind: "inspect_run"and the Run ID. Request usage or timeline detail only when needed. - If the Run is waiting for a sensitive tool action, call
crewhelm_inspect_workwithoperation.kind: "list_approvals"for that Run. - Review the exact action and call
crewhelm_change_workwithoperation.kind: "decide_approval"to approve or reject it. - After the Run completes, pass the returned Agent and
conversationobjects unchanged in a newrunoperation for the next message.
Do not continue an old handle after a revision conflict. Inspect the current conversation before deciding whether to retry the message.
Verify the outcome
Section titled “Verify the outcome”- Exact Run inspection reaches a terminal state or clearly reports what it is waiting for.
- The output corresponds to the admitted Agent revision and prompt.
- Typed output is reported successful only when Crewhelm validates it against the frozen schema.
- Any external effect has a known completion state or remains explicitly unresolved.
Recover safely
Section titled “Recover safely”- Use
crewhelm_change_workwithoperation.kind: "cancel_run"only before an external tool effect has been dispatched. Cancellation cannot undo a provider write. - If a conversation handle is lost, list and inspect that Agent’s conversations through
crewhelm_inspect_workto recover a fresh copy-ready object. - On a revision or branch conflict, reread the exact Agent or conversation; do not overwrite newer state.
- If an external effect is unknown, stop equivalent writes and follow diagnosis and recovery.
Next action
Section titled “Next action”Use a Workflow when the outcome already has a small ordered plan that must continue after the MCP conversation disconnects.