Skip to main content
Attesta integrates with CrewAI through 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

When deploy_task completes:
  1. The task output is stringified and sent to AttestaHumanInput
  2. An ActionContext is built with function_name="crewai_task"
  3. The output text (truncated to 200 characters) is used as the function_doc
  4. Attesta evaluates the risk and presents the appropriate challenge
  5. Returns "approved" or "denied" to CrewAI

How the ActionContext Is Built

For every task evaluation, AttestaHumanInput constructs the following context:
The risk scorer analyzes:
  • 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_risk override, if provided, forces a specific level
For tasks where the output is a deployment plan, database migration, or infrastructure change, set default_risk="high" or default_risk="critical" to ensure the appropriate challenge is presented regardless of the scorer’s heuristic.

Per-Task Risk Levels

You can create multiple AttestaHumanInput 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:
Only the final execution step requires human approval. The analysis and review tasks run without interruption.

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:
The callback mechanism in CrewAI passes the return value back to the agent as feedback. Make sure your agent’s backstory or instructions explain how to handle a "denied" response, otherwise the agent may not know how to proceed.

MCP Integration

Gate any MCP server with zero code changes

LangChain

Wrap LangChain tools and LangGraph nodes