Framework Safety Enforcement

approval and guardrails YAML fields fail closed on frameworks that cannot enforce them

PraisonAI refuses to start a run that would silently drop a safety gate.

Diagram

praisonai

crewai / autogen

yes

no: false / null / auto

📋 YAML with approval / guardrails

🧠 framework:

✅ Gate enforced

Gate active?

⛔ ValueError at startup

⚠️ Warn, run

Quick Start

  1. Gate on the native framework

    framework: praisonai honours approval: and guardrails: natively.

    agents.yaml
    framework: praisonai
    topic: Compliance review
    roles:
      compliance_agent:
        role: compliance-checker
        goal: Review the contract for policy issues
        backstory: You are a careful compliance reviewer.
        approval:
          backend: console
        guardrails: strict
        tasks:
          review:
            description: Review the contract and list policy issues.
            expected_output: A bullet list of issues.
    bash
    praisonai agents.yaml
  2. Same YAML on CrewAI refuses to start

    Change only framework: crewai. The CrewAI and AutoGen adapters cannot pass these fields through, so the run stops before any tool executes:

    ValueError: framework='crewai' cannot enforce safety field(s) ['approval', 'guardrails']
    for agent 'compliance-checker'. Use framework: praisonai, or remove the field(s) to run ungated.
  3. Pick a fix

    Either switch back to framework: praisonai to keep the gate, or delete the approval: / guardrails: keys (or set approval: false) to run ungated on purpose.


When does the error fire?

Diagram

no, e.g. memory

yes

yes or unparseable

no

Field on non-native adapter

approval or guardrails?

⚠️ Warn only

Real gate?

⛔ ValueError

YAML valueResult on crewai / autogen
approval: false or approval: nullWarns, runs (gate disabled)
approval: {enabled: true, backend: auto, approve_all_tools: false} (the --trust shape)Warns, runs (auto gates nothing)
approval: {enabled: false, ...}Warns, runs (gate disabled)
approval: {backend: none}Warns, runs (none gates nothing)
approval: trueValueError (defaults to the console backend)
approval: {backend: console} (or slack, webhook, …)ValueError
approval: {typo: 1} (unparseable)ValueError — invalid config fails closed
guardrails: null or guardrails: ""Warns, runs (no gate)
guardrails: strict or any non-empty valueValueError

Non-safety fields an adapter does not read (for example memory on CrewAI) still only log a warning.

Who is affected

framework:Honours approval / guardrailsOn an active gate
praisonai✅ YesGate enforced
crewai❌ NoValueError
autogen, autogen_v2, autogen_v4, ag2❌ No (only llm is supported)ValueError

YAML files that never set approval: or guardrails: are unaffected.


How to migrate

Original YAMLKeep the gateRemove the gateDisable the gate
framework: crewai + approval: {backend: console}Change to framework: praisonaiDelete the approval: keySet approval: false
framework: autogen + guardrails: strictChange to framework: praisonaiDelete the guardrails: keySet guardrails: null

Best Practices

Use framework: praisonai for gated tools

Approval and guardrails are only enforced on the native framework. If a role touches shell, file, or network tools, run it on praisonai.

Disable explicitly, not by accident

When you really want CrewAI or AutoGen to run ungated, write approval: false or remove the key so the intent is visible in review.

Treat the error as a config check

The error fires at startup, before any agent runs. Add praisonai agents.yaml to CI to catch dropped gates early.


Related