app/api/routes/tasks.py.
POST /tasks
Submit a task.
TaskRequest):
| Field | Type | Required | Description |
|---|---|---|---|
task | str | yes | Natural-language description of what the agent should do. |
compliance_policy | "default" | "hipaa" | "sox" | "legal" | "legal_privilege" | no | Active policy preset. "legal" is an alias for "legal_privilege". |
budget_cents | int | no | Per-task budget. Default 10000; range [100, 1_000_000]. |
permissions | list[str] | no | Requested capabilities. Intersected with the active policy’s ceiling - not used verbatim. |
provider | "anthropic" | "openai" | no | LLM provider override for this task. Omit to use the server’s default. |
model | str | no | Model name override. |
webhook_url | str | no | Optional callback URL the server POSTs the execution result to when the task completes. |
201 Created, TaskResponse):
websocket_url streams events as the task runs: tool calls, verify decisions, certificates, blocked attempts.
Error responses
400 - invalid compliance policy or request shape.
401 - missing or invalid API key.
403 - denied by policy ceiling. The body is structured:
422 - the request body did not match the Pydantic model.
What happens server-side
- The request is validated against the active compliance policy’s
max_permissionsceiling. - An execution record is created and the task is enqueued.
- The agentic executor (LLM + tool dispatcher) starts running. Every tool call passes through
Guard.verify(...)before execution. Allowed calls produce aVerifiedCertificaterecorded in the execution; blocked calls are recorded with their violations. - The execution finishes with a status of
succeeded,blocked,error, orcancelled.
See also
- Executions - fetching the result by id.
- Workflows - multi-stage orchestrations.
- Compliance - exporting the audit package for a finished execution.