crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

[FEATURE] Integrate an OpenAI Decisions predicate with callable task guardrails

Open lorenzejay opened this issue 1 month ago • 3 comments

Python PR scope

Use the typed Decisions adapter under #8007 to implement an opt-in callable guardrail that evaluates a task output with a predicate question and caller-configured probability threshold.

Difficulty: hard. Allocation index: #8118. Project: #8007.

Cohort allocation

This ticket is reserved for maintainer-coordinated allocation to the Stanford semester collaboration. Please wait for @lorenzejay to confirm an assignee before implementing. A comment expresses interest; it does not establish ownership. Public good first issue / help wanted discovery labels will be considered after cohort allocation.

GitHub usernames have not yet been supplied, so no individual assignment is implied.

Acceptance criteria

  • [ ] Compose with the existing callable guardrail return shape and keep original output on success.
  • [ ] Validate the threshold and preserve the API's typed predicate probability.
  • [ ] Missing/malformed answers and adapter errors cannot silently approve the output.
  • [ ] Test accept/reject, equality boundaries, missing answers, and retry interaction with fake adapter responses.
  • [ ] Keep API calls opt-in and reuse the adapter's SDK compatibility choice; do not upgrade SDK dependencies in this guardrail PR.

Dependencies and coordination

  • The first #8007 adapter milestone is claimed by iveteamorim. Coordinate its interface; guardrail fixtures can be developed independently.

Starting points

Submission

The contributor implements this scope and submits one focused PR linked to this open issue. Include full Python annotations, behavioral tests, and relevant quality checks. No paid API calls are required for the tests. Preserve existing APIs outside the scoped feature. For newly found defects, reproduce them and check active issues/PRs before fixing them. Docs edits, when needed, belong under docs/edge/ and must sync ar, ko, pt-BR per DOCS_TRANSLATIONS.md. Follow .github/CONTRIBUTING.md. Issue prepared with AI assistance.

lorenzejay avatar Oct 13 '26 22:10 lorenzejay

I can take this one - thank you Lorenze!

namupta-max avatar Oct 14 '26 01:10 namupta-max

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 13 '26 12:11 github-actions[bot]

Still active: the implementation is in #8167, which is up to date with main and ready for review. Happy to make any changes needed.

namupta-max avatar Nov 16 '26 17:11 namupta-max