Create an instructions agent
Instructions are a task in plain English. A model works through them on the phone. Add anoutput_schema when you want a structured result.
- Dashboard
- CLI
- Python SDK
- Go SDK
- REST API
The dashboard makes an agent from a run:
- Open Agents and click Create agent. This opens Run a task.
- Describe the task, for example: “Open Settings, go to About phone, and report the Android version exactly as shown.” Then start the run.
- When the run has ended, click Save as agent on the run. See Save a run as an agent.
Create a code agent
A code agent runs a Python script with no model. The script drivesphone,
reads its inputs from variables and reports its result with run.done. See
What a run’s code can use.
search.py
- Dashboard
- CLI
- REST API
The dashboard makes an agent from a run, so a code agent starts as a
saved run or as an existing agent you change:
- Save a run’s script: on an ended run, click Save as agent and choose to save the script.
- Change an existing agent to code: open the agent, click Edit and choose Code. Paste the script under Script, choose what happens When a step fails (Fail the run, Ask a person or Repair it), and save.
instructions or code, not both. A name already used in the
organization returns 409. An unsupported model or an invalid output schema
returns 400.
Handle a failed step
A code revision’son_failure decides what a run does when a step fails, for
example when an element can’t be found:
A repaired run has
repair.repaired: true and, when it proposed a fix,
repair.proposed_revision_id. The proposed revision has proposal_state: "waiting" and is not used until a person promotes it. Repair time and model
steps count against the run’s limits and are billed like any model step.
Save a run as an agent
Save an ad hoc run as an agent once it has ended. Withfrom: "task" (the
default), the run’s task becomes an instructions revision. With
from: "script", the code the run executed becomes a code revision. The run’s
model, output schema and limits fill in any setting you leave out.
- Dashboard
- REST API
- Open the run from Runs.
- Click Save as agent. It shows on a run that has ended and wasn’t started from a saved agent.
- Enter a name and choose whether to save the task or the script.
Pull and push code
Each push adds a revision, which becomes the one runs use.- Dashboard
- CLI
- REST API
- Open the agent from Agents and click Edit.
- Change the instructions or the script.
- Save. The change becomes a new version.
Roll back or promote a revision
A rollback copies an earlier revision forward as the newest one, so history only grows. Promoting makes a repair’s proposed fix the current revision.- Dashboard
- CLI
- REST API
- Open the agent, click Edit, and open Version history.
- Select a version to read it.
- Click Restore to roll back to it, or Use this fix on a proposed fix.
409 when the revision is not a fix waiting to be promoted,
or when the agent has moved on from the revision the repaired run ran. Such a
fix reads proposal_state: "superseded".
Change settings or delete an agent
PATCH /agents/{agent_id} changes the name, model, output schema, limits and
data settings. Fields you leave out keep their values, and output_schema: null clears the schema. Instructions and code change only through revisions.
Deleting an agent removes it and its revisions, and cancels its schedules’ runs
that haven’t started. Its past runs stay in the run list.
- CLI
- REST API
Next steps
Run the agent
Start a run now, later, or many at once.
Schedule the agent
Run it on a recurring cron schedule.