AttestaHumanInput, a callable that replaces (or augments) CrewAI’s built-in human_input mechanism. When a task completes, Attesta evaluates the output through the approval pipeline before the workflow continues.
Installation
API Reference
AttestaHumanInput
Callable signature:
When
default_risk is set, it is passed to the risk scorer as hints["risk_override"]. This is useful for tasks where the automated scorer cannot infer the true risk from the task output string alone.Full Example
deploy_task completes:
- The task output is stringified and sent to
AttestaHumanInput - An
ActionContextis built withfunction_name="crewai_task" - The output text (truncated to 200 characters) is used as the
function_doc - Attesta evaluates the risk and presents the appropriate challenge
- Returns
"approved"or"denied"to CrewAI
How the ActionContext Is Built
For every task evaluation,AttestaHumanInput constructs the following context:
- Function name —
"crewai_task"scores as a generic mutating verb - Arguments — the full task output is scanned for sensitive patterns (credentials, SQL, shell commands, URLs)
- Docstring — the first 200 characters provide additional risk signals
- Hints — the
default_riskoverride, if provided, forces a specific level
Per-Task Risk Levels
You can create multipleAttestaHumanInput instances with different default risk levels for different task types:
Sequential Crew with Gating
In a sequential crew, you can gate specific handoff points between agents:Handling Denials
When a task output is denied,AttestaHumanInput returns the string "denied". CrewAI’s behavior on receiving this response depends on how you configure the task and crew:
MCP Integration
Gate any MCP server with zero code changes
LangChain
Wrap LangChain tools and LangGraph nodes