Files
crewAI/lib
Devin AI 660a186375 feat: enforce fail-closed defaults for unsafe tool execution
Fixes #4593

- Add  field to BaseTool with documentation
- Propagate  flag through CrewStructuredTool and @tool decorator
- Enforce fail-closed behavior in all tool execution paths:
  - crew_agent_executor.py (native tool calling path)
  - experimental/agent_executor.py (experimental executor path)
  - tool_utils.py (ReAct text-based path, sync and async)
- Unsafe tools require a before_tool_call hook returning True to execute
- Deterministic error message for denied unsafe tool execution
- Add 15 regression tests covering allow/deny paths

Co-Authored-By: João <joao@crewai.com>
2026-02-25 19:40:15 +00:00
..