# Request paths

> A task, a step and an approval, step by step.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://agent.docs.sypnia.com/architecture/request-paths/

For agents: Task: POST /tasks → reserve budget from credits (hold) → context load → loop { model proposes step → policy check (tier) → if do: execute in sandbox / call MCP → record step + cost; if ask: create approval, pause } → finish: push branch, open PR, release unused hold. Step execution: orchestrator → supervisor (gRPC over a local socket) → sandbox; egress via proxy. Approval: decision → policy re-check (the world may have changed) → execute → audit.

## A task

1. `POST /v1/tasks`. The budget is **held** from your credits, so a task can never spend credits you do not have.
2. The orchestrator loads your profile, memory, the map, the design guide and the plan.
3. **The loop:** the model proposes a step; the orchestrator checks its tier:
   - **does freely** → it runs (in the sandbox, or as an MCP call) and is recorded with its cost;
   - **ask** → an approval is created and the task waits, spending nothing;
   - **never** → it is refused, and the model is told why.
4. **At the end:** the branch is pushed, the pull request is opened with `Case:` trailers, and the unused part of the hold goes back to your credits.

## A step in the sandbox

The orchestrator sends the command to the supervisor over a local channel; the supervisor runs it inside the sandbox with the file and network policy; outbound traffic goes through the proxy, which only lets allowed addresses through; output and exit code come back and are logged.

## An approval

When you approve, the orchestrator **checks again** before acting (the branch, the data or the target may have changed since it asked), runs the action, and records who approved and when.
