Skip to main content
Headless YAML runs execute an agent team from agents.yaml with no prompts, then report usage, write files, and exit with a code your CI can trust.

Quick Start

1

Create agents.yaml

2

Run it

You get out/risk_report.md and a per-agent usage table.

Flags

Three flags make a YAML run suitable for scripts. Equivalent approval switches for other entry points: praisonai run --approval bypass, --autonomy full_auto, or PRAISONAI_AUTO_APPROVE=true. There is no --no-approve flag; use --trust.

Per-Agent Metrics

--metrics prints one row per agent, a TOTAL row, and the model name.
--metrics-json prints JSON to stdout only. It takes no path; redirect to save a file.

Task output_file

framework: praisonai writes a task’s result to output_file and creates missing parent folders.
A bare filename such as flat.md writes to the working directory. See Save Output for every output option.

Exit Codes

Failed runs exit non-zero so CI can detect them. Stale files from a previous run do not count as written. Tasks that never ran (skipped workflow branches) are not counted as missing files.
With --output stream-json, a failed run emits run.error instead of a successful run.result.

Sandbox Environment Variables

Set these to run inside a locked-down container with one OpenAI-compatible endpoint and no outbound access.

Full Example


Common Pitfalls


Best Practices

Without it, tool approvals wait for a human and the run hangs. --trust also turns on the output_file write check.
A failed task prints its status, but only the exit code is reliable for scripts.
Parse total.total_tokens from the JSON to fail builds that exceed a token budget.
Pin OPENAI_BASE_URL and OPENAI_MODEL_NAME so runs stay on your sandbox endpoint.

Metrics CLI

Token and cost reporting

Save Output

Write results to files

Tool Approval

Control tool execution

YAML Configuration Reference

All YAML fields