activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Crawler Summary
Reusable CrewAI task guardrails (length, JSON schema, placeholders, sections) with the retry contract demonstrated offline. CrewAI Task Guardrails Small, focused examples of **task guardrails** in $1: reusable validator factories, a stand-alone re-implementation of the retry loop so the contract can be seen without an LLM, and a one-agent demo crew whose guardrail is guaranteed to trip. Docs: $1 in the CrewAI documentation. The guardrail contract A guardrail is a function that receives the task output and returns a tuple: * output is a Ta Capability contract not published. No trust telemetry is available yet. Last updated 10/9/2026.
Freshness
Last checked 10/9/2026
Best For
crewai-task-guardrails is best for crewai, multi-agent workflows where OpenClaw compatibility matters.
Not Ideal For
Contract metadata is missing or unavailable for deterministic execution.
Evidence Sources Checked
editorial-content, GITHUB REPOS, runtime-metrics, public facts pack
Reusable CrewAI task guardrails (length, JSON schema, placeholders, sections) with the retry contract demonstrated offline. CrewAI Task Guardrails Small, focused examples of **task guardrails** in $1: reusable validator factories, a stand-alone re-implementation of the retry loop so the contract can be seen without an LLM, and a one-agent demo crew whose guardrail is guaranteed to trip. Docs: $1 in the CrewAI documentation. The guardrail contract A guardrail is a function that receives the task output and returns a tuple: * output is a Ta
Public facts
4
Change events
1
Artifacts
0
Freshness
Oct 9, 2026
Capability contract not published. No trust telemetry is available yet. Last updated 10/9/2026.
Trust score
Unknown
Compatibility
OpenClaw
Freshness
Oct 9, 2026
Vendor
Crzyc0d3r
Artifacts
0
Benchmarks
0
Last release
Unpublished
Key links, install path, and a quick operational read before the deeper crawl record.
Summary
Capability contract not published. No trust telemetry is available yet. Last updated 10/9/2026.
Setup snapshot
Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Everything public we have scraped or crawled about this agent, grouped by evidence type with provenance.
Vendor
Crzyc0d3r
Protocol compatibility
OpenClaw
Handshake status
UNKNOWN
Crawlable docs
6 indexed pages on the official domain
Merged public release, docs, artifact, benchmark, pricing, and trust refresh events.
Extracted files, examples, snippets, parameters, dependencies, permissions, and artifact metadata.
Extracted files
0
Examples
6
Snippets
0
Languages
python
python
def guardrail(output) -> tuple[bool, Any]:
...
return (True, validated_output) # accepted; a str result replaces task_output.raw
return (False, "what went wrong") # rejected; the message goes back to the agenttext
crewai-task-guardrails/ ├── guardrails/ │ ├── __init__.py re-exports the factories │ ├── validators.py validate_summary_length, validate_json_schema, validate_no_placeholders, │ │ validate_contains_sections, all_of; output_text() handles str/TaskOutput; │ │ a JSON-Schema checker (jsonschema if installed, minimal fallback otherwise) │ ├── retry.py run_with_guardrail(agent_fn, guardrail, max_retries): the retry loop │ │ CrewAI runs, reproduced with a plain callable in place of the agent │ ├── crew.py demo crew: Technical Writer agent + summarize task with │ │ guardrail=validate_summary_length(150), guardrail_max_retries=3; │ │ install_guardrail_logger() prints guardrail events │ └── samples.py source text, canned outputs, a small JSON schema ├── run.py --demo (offline) or the live crew ├── tests/ │ ├── test_validators.py every validator with str and TaskOutput; CrewAI accepts the │ │ callables; CrewAI's own process_guardrail() with our tuples │ └── test_retry_and_crew.py retry loop, crew wiring, event logger ├── .env.example ├── requirements.txt └── pytest.ini
mermaid
flowchart LR
A[Agent produces output] --> G{guardrail(output)}
G -->|"(True, validated)"| N[validated text replaces task_output.raw<br/>next task / crew result]
G -->|"(False, message)"| R{retries left?}
R -->|yes| F[feedback added to context:<br/>previous attempt failed validation: message] --> A
R -->|no| E[Exception: failed after N retries]bash
python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt python run.py --demo # offline, no keys pytest # no network cp .env.example .env # add OPENAI_API_KEY python run.py # live crew: asks for ~200 words, accepts 150 python run.py --target-words 300 --max-words 120 --max-retries 2 --verbose
text
1. Guardrails on canned outputs
PASS validate_summary_length(max_words=150) <- summary_120_words
validated output: 'Retrieval-augmented generation grounds a language model in retrieved p'
FAIL validate_summary_length(max_words=150) <- summary_212_words
Summary has 212 words; the limit is 150. Cut at least 62 words and keep only the essential points.
PASS validate_json_schema <- json_fenced
validated output: '{"title": "RAG in one page", "word_count": 120, "tags": ["rag"]}'
FAIL validate_json_schema <- json_missing_field
JSON does not match the schema: $: 'word_count' is a required property.
FAIL validate_no_placeholders <- placeholders
Output still contains placeholder text: '[Insert customer name]', '{{agent_name}}', 'TODO'. Replace every placeholder with real content.
FAIL validate_contains_sections <- report_missing_section
Missing section heading(s): Recommendations. Use exactly these headings: Summary, Findings, Recommendations.
2. Retry loop with a fake agent (limit 150 words, max_retries=3)
agent produced 240 words (first attempt)
agent produced 190 words (after feedback: ### Previous attempt failed validation: Summary has 240 word)
agent produced 140 words (after feedback: ### Previous attempt failed validation: Summary has 190 word)
attempt 1: FAIL - Summary has 240 words; the limit is 150. Cut at least 90 words and keep only the essential points.
attempt 2: FAIL - Summary has 190 words; the limit is 150. Cut at least 40 words and keep only the essential points.
attempt 3: PASS
accepted after 2 retries: 140 words
3. Same loop with an agent that never complies (max_retries=1)
raised GuardrailRetryError: Task failed guardrail validation after 1 retries. Last error: Summary has 300 words; ...text
asking for ~200 words, guardrail accepts 150, max_retries=3 [guardrail] attempt 1: running validate_summary_length(max_words=150) (function) [guardrail] attempt 1: FAIL - Summary has 203 words; the limit is 150. Cut at least 53 words ... [guardrail] attempt 2: running validate_summary_length(max_words=150) (function) [guardrail] attempt 2: PASS final output (138 words): Retrieval-augmented generation pairs a language model with a search step ...
Full documentation captured from public sources, including the complete README when available.
Docs source
GITHUB REPOS
Editorial quality
ready
Reusable CrewAI task guardrails (length, JSON schema, placeholders, sections) with the retry contract demonstrated offline. CrewAI Task Guardrails Small, focused examples of **task guardrails** in $1: reusable validator factories, a stand-alone re-implementation of the retry loop so the contract can be seen without an LLM, and a one-agent demo crew whose guardrail is guaranteed to trip. Docs: $1 in the CrewAI documentation. The guardrail contract A guardrail is a function that receives the task output and returns a tuple: * output is a Ta
Small, focused examples of task guardrails in CrewAI: reusable validator factories, a stand-alone re-implementation of the retry loop so the contract can be seen without an LLM, and a one-agent demo crew whose guardrail is guaranteed to trip.
Docs: Task guardrails in the CrewAI documentation.
A guardrail is a function that receives the task output and returns a tuple:
def guardrail(output) -> tuple[bool, Any]:
...
return (True, validated_output) # accepted; a str result replaces task_output.raw
return (False, "what went wrong") # rejected; the message goes back to the agent
output is a TaskOutput (output.raw is the text; output.pydantic /
output.json_dict when the task requested structured output). The validators in
this project also accept a plain str, which is convenient for tests and demos.Task(guardrail=fn) or chain several with
Task(guardrails=[fn1, fn2, ...]) - each receives the validated output of the
previous one.guardrail_max_retries times (default 3). After that it raises
Exception("Task failed guardrail validation after N retries. Last error: ...").
max_retries= still works as an alias but is deprecated.Task is built: exactly one parameter without
a default, and, if you annotate the return type, it must be tuple[bool, Any]
(or Tuple[bool, Any]). Because the annotation is inspected at runtime,
guardrails/validators.py does not use from __future__ import annotations.None as the validated output is an error; return the text (or a
cleaned version of it).Write the error message for the agent, not for a log: say what was measured, what the
limit is and what to change ("Summary has 212 words; the limit is 150. Cut at least 62 words...").
CrewAI also accepts a string: Task(guardrail="The summary must be under 150 words and contain no jargon") builds an LLMGuardrail that asks the agent's LLM to judge the
output. Pick by the kind of rule:
| Use a code guardrail when | Use an LLM guardrail when | |---|---| | the rule is measurable: word counts, JSON validity, schema, required headings, forbidden strings, regexes | the rule is subjective: tone, clarity, "suitable for a general audience" | | you need determinism and zero extra cost per retry | the rule is easier to describe than to code | | the failure message must be precise (the agent fixes what you name) | you accept some variance in verdicts and an extra model call per check | | the output feeds another program (parse it, do not eyeball it) | the output is prose for a human |
Mix them in one list when both apply: guardrails=[validate_json_schema(schema), "The description field must be written for non-experts"]. Put the code checks first
so the model is only consulted when the mechanical checks already pass.
crewai-task-guardrails/
├── guardrails/
│ ├── __init__.py re-exports the factories
│ ├── validators.py validate_summary_length, validate_json_schema, validate_no_placeholders,
│ │ validate_contains_sections, all_of; output_text() handles str/TaskOutput;
│ │ a JSON-Schema checker (jsonschema if installed, minimal fallback otherwise)
│ ├── retry.py run_with_guardrail(agent_fn, guardrail, max_retries): the retry loop
│ │ CrewAI runs, reproduced with a plain callable in place of the agent
│ ├── crew.py demo crew: Technical Writer agent + summarize task with
│ │ guardrail=validate_summary_length(150), guardrail_max_retries=3;
│ │ install_guardrail_logger() prints guardrail events
│ └── samples.py source text, canned outputs, a small JSON schema
├── run.py --demo (offline) or the live crew
├── tests/
│ ├── test_validators.py every validator with str and TaskOutput; CrewAI accepts the
│ │ callables; CrewAI's own process_guardrail() with our tuples
│ └── test_retry_and_crew.py retry loop, crew wiring, event logger
├── .env.example
├── requirements.txt
└── pytest.ini
How the pieces fit: a factory such as validate_summary_length(150) returns a closure
with the contract above (and a readable __name__, which CrewAI reports in its
guardrail events). crew.build_summary_task passes that closure as guardrail= and
sets guardrail_max_retries. In live mode CrewAI drives the loop; in demo mode
retry.run_with_guardrail drives the same loop with a fake agent that shortens its
answer whenever it receives feedback.
flowchart LR
A[Agent produces output] --> G{guardrail(output)}
G -->|"(True, validated)"| N[validated text replaces task_output.raw<br/>next task / crew result]
G -->|"(False, message)"| R{retries left?}
R -->|yes| F[feedback added to context:<br/>previous attempt failed validation: message] --> A
R -->|no| E[Exception: failed after N retries]
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python run.py --demo # offline, no keys
pytest # no network
cp .env.example .env # add OPENAI_API_KEY
python run.py # live crew: asks for ~200 words, accepts 150
python run.py --target-words 300 --max-words 120 --max-retries 2 --verbose
GUARDRAIL_DEMO_MODEL (default openai/gpt-4o-mini) and OPENAI_API_BASE select the
model / endpoint for the live run.
python run.py --demo:
1. Guardrails on canned outputs
PASS validate_summary_length(max_words=150) <- summary_120_words
validated output: 'Retrieval-augmented generation grounds a language model in retrieved p'
FAIL validate_summary_length(max_words=150) <- summary_212_words
Summary has 212 words; the limit is 150. Cut at least 62 words and keep only the essential points.
PASS validate_json_schema <- json_fenced
validated output: '{"title": "RAG in one page", "word_count": 120, "tags": ["rag"]}'
FAIL validate_json_schema <- json_missing_field
JSON does not match the schema: $: 'word_count' is a required property.
FAIL validate_no_placeholders <- placeholders
Output still contains placeholder text: '[Insert customer name]', '{{agent_name}}', 'TODO'. Replace every placeholder with real content.
FAIL validate_contains_sections <- report_missing_section
Missing section heading(s): Recommendations. Use exactly these headings: Summary, Findings, Recommendations.
2. Retry loop with a fake agent (limit 150 words, max_retries=3)
agent produced 240 words (first attempt)
agent produced 190 words (after feedback: ### Previous attempt failed validation: Summary has 240 word)
agent produced 140 words (after feedback: ### Previous attempt failed validation: Summary has 190 word)
attempt 1: FAIL - Summary has 240 words; the limit is 150. Cut at least 90 words and keep only the essential points.
attempt 2: FAIL - Summary has 190 words; the limit is 150. Cut at least 40 words and keep only the essential points.
attempt 3: PASS
accepted after 2 retries: 140 words
3. Same loop with an agent that never complies (max_retries=1)
raised GuardrailRetryError: Task failed guardrail validation after 1 retries. Last error: Summary has 300 words; ...
Live run (python run.py), illustrative - word counts vary by model. The prompt asks
for 200 words so the first attempt normally fails and CrewAI retries with the message
in context:
asking for ~200 words, guardrail accepts 150, max_retries=3
[guardrail] attempt 1: running validate_summary_length(max_words=150) (function)
[guardrail] attempt 1: FAIL - Summary has 203 words; the limit is 150. Cut at least 53 words ...
[guardrail] attempt 2: running validate_summary_length(max_words=150) (function)
[guardrail] attempt 2: PASS
final output (138 words):
Retrieval-augmented generation pairs a language model with a search step ...
validate_json_schema returns the canonical JSON text with code fences removed, so
a task that also sets output_json= gets clean input on the retry that passes.validate_contains_sections accepts Markdown headings (## Findings), bold lines
(**Findings**) and Findings: lines; matching is case-insensitive unless
case_sensitive=True.validate_no_placeholders matches [Insert ...], {{ var }}, <insert ...>,
upper-case TODO / TBD / XXX, lorem ipsum and [...]; pass your own list of
regexes to replace the defaults.LLMGuardrailStartedEvent / LLMGuardrailCompletedEvent) are
emitted for function guardrails too; install_guardrail_logger subscribes to them
through crewai_event_bus.on(...).Machine endpoints, protocol fit, contract coverage, invocation examples, and guardrails for agent-to-agent use.
Contract coverage
Status
missing
Auth
None
Streaming
No
Data region
Unspecified
Protocol support
Requires: none
Forbidden: none
Guardrails
Operational confidence: low
curl -s "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/snapshot"
curl -s "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/contract"
curl -s "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/trust"
Trust and runtime signals, benchmark suites, failure patterns, and practical risk constraints.
Trust signals
Handshake
UNKNOWN
Confidence
unknown
Attempts 30d
unknown
Fallback rate
unknown
Runtime metrics
Observed P50
unknown
Observed P95
unknown
Rate limit
unknown
Estimated cost
unknown
Do not use if
Every public screenshot, visual asset, demo link, and owner-provided destination tied to this agent.
Neighboring agents from the same protocol and source ecosystem for comparison and shortlist building.
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
The Frontend for Agents & Generative UI. React + Angular
Contract JSON
{
"contractStatus": "missing",
"authModes": [],
"requires": [],
"forbidden": [],
"supportsMcp": false,
"supportsA2a": false,
"supportsStreaming": false,
"inputSchemaRef": null,
"outputSchemaRef": null,
"dataRegion": null,
"contractUpdatedAt": null,
"sourceUpdatedAt": null,
"freshnessSeconds": null
}Invocation Guide
{
"preferredApi": {
"snapshotUrl": "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/snapshot",
"contractUrl": "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/contract",
"trustUrl": "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/trust"
},
"curlExamples": [
"curl -s \"https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/snapshot\"",
"curl -s \"https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/contract\"",
"curl -s \"https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/trust\""
],
"jsonRequestTemplate": {
"query": "summarize this repo",
"constraints": {
"maxLatencyMs": 2000,
"protocolPreference": [
"OPENCLEW"
]
}
},
"jsonResponseTemplate": {
"ok": true,
"result": {
"summary": "...",
"confidence": 0.9
},
"meta": {
"source": "GITHUB_REPOS",
"generatedAt": "2026-10-09T15:04:12.816Z"
}
},
"retryPolicy": {
"maxAttempts": 3,
"backoffMs": [
500,
1500,
3500
],
"retryableConditions": [
"HTTP_429",
"HTTP_503",
"NETWORK_TIMEOUT"
]
}
}Trust JSON
{
"status": "unavailable",
"handshakeStatus": "UNKNOWN",
"verificationFreshnessHours": null,
"reputationScore": null,
"p95LatencyMs": null,
"successRate30d": null,
"fallbackRate": null,
"attempts30d": null,
"trustUpdatedAt": null,
"trustConfidence": "unknown",
"sourceUpdatedAt": null,
"freshnessSeconds": null
}Capability Matrix
{
"rows": [
{
"key": "OPENCLEW",
"type": "protocol",
"support": "unknown",
"confidenceSource": "profile",
"notes": "Listed on profile"
},
{
"key": "crewai",
"type": "capability",
"support": "supported",
"confidenceSource": "profile",
"notes": "Declared in agent profile metadata"
},
{
"key": "multi-agent",
"type": "capability",
"support": "supported",
"confidenceSource": "profile",
"notes": "Declared in agent profile metadata"
}
],
"flattenedTokens": "protocol:OPENCLEW|unknown|profile capability:crewai|supported|profile capability:multi-agent|supported|profile"
}Facts JSON
[
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Crzyc0d3r",
"href": "https://github.com/crzyc0d3r/crewai-task-guardrails",
"sourceUrl": "https://github.com/crzyc0d3r/crewai-task-guardrails",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T13:16:28.080Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-09T13:16:28.080Z",
"isPublic": true
},
{
"factKey": "docs_crawl",
"category": "integration",
"label": "Crawlable docs",
"value": "6 indexed pages on the official domain",
"href": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
"sourceUrl": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
"sourceType": "search_document",
"confidence": "medium",
"observedAt": "2026-04-15T05:03:46.393Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/crewai-crzyc0d3r-crewai-task-guardrails/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
]Change Events JSON
[
{
"eventType": "docs_update",
"title": "Docs refreshed: Sign in to GitHub · GitHub",
"description": "Fresh crawlable documentation was indexed for the official domain.",
"href": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
"sourceUrl": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
"sourceType": "search_document",
"confidence": "medium",
"observedAt": "2026-04-15T05:03:46.393Z",
"isPublic": true
}
]Sponsored
Ads related to crewai-task-guardrails and adjacent AI workflows.