Automated agents are powerful, but they cannot safely approve every action. Some tasks require a human to review costs, security, or business logic before proceeding. The Coasty Runs API solves this with a built-in pause and resume flow. When your agent hits a sensitive step, it transitions to awaiting_human. You receive an event, approve the action, and call resume to continue exactly where it stopped. This pattern keeps your workflows reliable without brittle workarounds.
How awaiting_human and resume work
When you POST /v1/runs with on_awaiting_human set to 'pause', the server runs your computer use agent. If the agent encounters a situation that requires human approval, defined by your task or system prompt, it transitions the run to the awaiting_human state. You then receive a Server-Sent Event stream (GET /v1/runs/{id}/events) with a human_approval event type. After you review and approve, you POST /v1/runs/{id}/resume to continue execution. The server restores the agent's trajectory and resumes from the step that triggered the pause. This flow is integrated into the runs API, not an external tooling.
# Create a run that pauses on human approval
export COASTY_API_KEY=$COASTY_API_KEY
curl https://coasty.ai/v1/runs \
-H "Authorization: Bearer $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "m-8k9q2",
"task": "Install Python 3.12, create a project folder, and verify pip is available.",
"cua_version": "v3",
"on_awaiting_human": "pause",
"max_steps": 50,
"deadline_seconds": 600
}'
# Stream events to see when the run pauses
curl https://coasty.ai/v1/runs/{RUN_ID}/events \
-H "Authorization: Bearer $COASTY_API_KEY" \
--no-bufferKey fields and states
- on_awaiting_human: set to 'pause' to trigger human approval and wait for resume.
- States: queued, running, awaiting_human, succeeded, failed, cancelled, timed_out.
- GET /v1/runs returns the current state and last activity.
- POST /v1/runs/{id}/resume continues execution after approval.
- Task steps cost $0.05 each. Runs are billed per agent step, not per pause.
Set on_awaiting_human to 'pause' in your run payload, then poll events and resume when you receive a human_approval event.
Where awaiting_human beats brittle automation
Traditional automation often relies on fragile selectors, hardcoded delays, or external approval scripts that break when UI changes. The Coasty computer use API sees the screen and acts like a human, so it can naturally detect when a task needs human judgment. By letting the server drive the agent and using awaiting_human to pause only when necessary, you avoid fragile state management and external approval gates. This approach integrates directly into your runs workflow with minimal code, and you keep full control over when to resume.
Add pause and resume to your computer use agent to handle sensitive actions safely. Get started with a key at https://coasty.ai/developers .
Want to see this in action?
View Case Studies