Example proposal: deterministic physics/bounds guardrail (no-LLM, recomputable verdicts) alongside existing guardrails

Open Beginner friendly
#9,238 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
ai, documentation

Research direction

Read the existing examples layout and inspect crewai/utilities/guardrail.py and tasks/llm_guardrail.py to see how task guardrails are used. Add an example that applies the proposed deterministic physics checker to a task and shows both a caught violation and a clean pass. Done means the example follows the repository's conventions and demonstrates both outcomes.

Written by the indexing model from the issue text.

Description

Hi team — crewAI's per-task guardrails (crewai/utilities/guardrail.py, tasks/llm_guardrail.py) are a clean hook for output checking. Proposal: an example guardrail that validates outputs against deterministic physics/bounds rules — no LLM in the loop, verdicts recomputable from the public, versioned rule table (phm-lite-check).

What it catches: probability 1.8, negative mass, speed above c, below-absolute-zero temperatures, NaN/Inf in numeric fields. Content-safety guardrails catch semantics; this catches physics-invalid values — complementary, and it composes with your existing guardrail API (guardrail: str | Callable).

Several rules were corrected following review comments in microsoft/PyRIT#3507 (negative binding energies are legal; growth percentages are not shares; signed velocities are legal; malformed input must not crash the gate) - the full thread is public. The checker also ships as a Dify Marketplace plugin and an MCP-registry-listed package, and is smoke-tested on nemo-relay==0.11.1 (3-case pipeline test, public repo).

Ask: would a PR adding an examples entry (physics guardrail on a task, showing a caught violation and a clean pass) be welcome? Happy to follow your example layout.

— PHM-Audit

Dominant language
Python
Stars
60.4k
Forks
9k
Avg merge
1d 4h
Merged PRs (30d)
210

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from crewAIInc/crewAI

All issues in crewAIInc/crewAI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.