Skip to main content
Catch configuration mistakes before they cause runtime failures — praisonai validate checks your YAML files against the full schema and reports every error at once.

Quick Start

1

Validate a single file (success path)

Output:
2

Validate a file with errors (failure path)

Output when the config has problems:
Exit code: 1
3

CI usage — strict mode + JSON output

Output:
With --strict, warnings are also treated as errors, so exit code is 1 even when only warnings are present.
4

Emit machine-readable schema

Point your editor’s YAML language server at the file for autocomplete and inline validation — see Editor Support.

Subcommands


Flags

praisonai validate <file>

praisonai validate check [directory]

praisonai validate schema

With no flags, prints all main config sections with field names, types, and required markers. Two flags emit the machine-readable JSON Schema instead:
Point your editor’s YAML language server at that schema for autocomplete and inline validation — see Editor Autocomplete.

What Gets Validated

1. Schema Validation

Enforces the Pydantic schema. Every agent must have role, goal, and backstory — these are required. Every task must have description and agent (matching ^[a-zA-Z0-9_-]+$). When process: workflow, the config must also include steps or workflow.

2. Cross-Reference Validation

  • Every tasks[i].agent must name an agent defined under roles / agents
  • Workflow step agent fields are validated recursively (through nested steps and routes)
  • Every handoff.to target must resolve to a known role

3. Tool Validation

Tool names are resolved through ToolResolver:
  • Unknown toolerror: “Unknown tool ‘X’. Ensure it’s properly installed or defined in your configuration.”
  • Known optional tool (e.g. PostgreSQLTool, SlackTool, AWSTool, BrowserTool, PandasTool, KubernetesTool) → warning: “Tool ‘X’ requires additional dependencies. Install with: pip install ‘praisonai[tools]’ …“

4. Unknown Fields

Top-level unknown keys and unknown agent/role fields produce warnings, not errors: “Unknown agent field ‘X’. This field will be ignored.”
Unknown-field warnings are non-blocking — your workflow still runs. Only errors (missing required fields, bad cross-references, unknown tools) cause a hard failure.

Output Formats

Default output uses Rich formatting for easy reading in the terminal:

CI Integration

Add validation to your GitHub Actions workflow to block merges on broken configs:
Exit code 1 on any validation failure causes the step to fail.

Strict Mode

Strict mode promotes warnings to errors — useful in CI to keep configs clean. Enable per-command:
Enable globally via environment variable:
With PRAISONAI_VALIDATE_STRICT=true, all validation runs (including the automatic pre-run check in agents_generator.py) use strict mode.

Runtime YAML normalisation (_normalize_yaml_config)

Even without running praisonai validate explicitly, every praisonai start agents.yaml normalises the YAML — and now catches three silent bugs that used to cause agents to disappear. Three rules run during normalisation, all gated by PRAISONAI_VALIDATE_STRICT: Toggle strict mode to abort instead of warn:
The __dup_i suffix marks a preserved duplicate. Given a list-form config with two researcher agents:
Non-strict output keeps both agents so nothing silently vanishes:
The second agent is stored under researcher__dup_1. If you see researcher__dup_1 in traces or logs, it means a duplicate name was collapsed — rename one entry to silence the warning.

Exit Codes


Backward-Compatible Aliases

The validator automatically normalises these field aliases — you can use either form:

Fail-Fast Runtime Validation

When you run praisonai start agents.yaml, validation now runs automatically before execution. If any errors are found, the run aborts with an aggregated ValueError:
This replaces the old behaviour where invalid configs emitted non-blocking warnings and continued running.

Best Practices

Add praisonai validate agents.yaml to your pre-commit checks or CI pipeline to catch errors early.
JSON output is easy to parse in scripts or CI steps that need to inspect specific error messages programmatically.
Strict mode treats warnings as errors, preventing unknown or misspelled fields from silently being ignored in production environments.
Run praisonai validate schema to see all fields, their types, and which are required — before writing a new config from scratch.
Emit the JSON Schema with praisonai validate schema --agents (or pin it with -o agents.schema.json) and point your editor’s YAML language server at it for autocomplete and inline validation. See Editor Autocomplete.

YAML Configuration Reference

Complete field reference for agents.yaml and workflow.yaml

CLI Reference

All available CLI commands

Doctor

Diagnose environment and dependency issues

Workflow CLI

Run and manage YAML workflows from the terminal

Editor Autocomplete

Wire agents.yaml to your editor for autocomplete and inline validation