Agents
Headless and scripts
frontier -p with --json, and exit code 3.
Headless mode runs one task and exits. It is for scripts, CI, and any tool that can run a command. It never asks a question.
frontier -p "Summarize what src/ does" --json
frontier -p "Add input validation to src/form.js" --allow-edits --json
echo "a long prompt" | frontier -p --json
frontier -p "Explain this" --no-tools --file notes.mdWithout --allow-edits the agent cannot change files. --json implies -p. --out <path> also writes the answer to a file.
The JSON result
On success, one object on standard output:
{
"ok": true,
"text": "...",
"models": ["deepseek/deepseek-v4-pro"],
"downgraded": false,
"budget": "paid",
"filesChanged": [],
"diffSummary": "",
"steps": 3,
"stoppedReason": "completed",
"costUsd": 0.0123,
"trust": "..."
}downgraded is true if the answer came from below the quality floor. trust says whether the project's own settings and rules were used, so a run that fell back to defaults is not reported as plain success. On failure:
{ "ok": false, "code": "QUALITY_UNAVAILABLE", "message": "..." }Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | Any other error. |
| 2 | No prompt was given. |
| 3 | QUALITY_UNAVAILABLE: the quality floor stayed busy for the whole patience window. |
| 5 | MODEL_REJECTED: the pinned model refused the request. |
| 6 | NO_MODEL_AT_FLOOR: no configured model reaches the floor. |
| 130 | Cancelled. |
Treat 3 as "try again later, or lower the floor", not as a bug. Do not retry it in a tight loop. The whole list is on Errors and exit codes.
In CI
Keys come from real environment variables, which win over any file. Set FRONTIER_HOME to a folder you control so settings and trust live somewhere predictable, and run frontier trust for the checkout first, because there is nobody to ask. Without trust, the project's own settings and rules are restricted, and trust in the JSON says so.
Reasoning is never printed when output is not a terminal, and output into a pipe has no colour, so it is stable to parse.