cookbooks

HITL Approval Workflow

An email drafting agent that writes emails automatically but pauses for human review before sending.

agentfile.yaml

agentfile.yaml
governance:
  human_approval:
    enabled: true
    actions:
      - send_email           # pause before any email is sent
      - gmail__send_email    # also catches the MCP tool name

agents:
  email-assistant:
    metadata:
      role: Email assistant
      goal: Draft and send emails on behalf of the user
      instructions: |
        Draft professional emails based on user instructions.
        Before sending, show the user what you plan to send and wait for approval.
    runtime:
      provider: anthropic
      model: claude-sonnet-4-6
    tools:
      - name: gmail
        source: mcp://gmail

The workflow

  1. User: "Email the team about tomorrow's sprint review"
  2. Agent drafts the email and calls send_email
  3. Execution pauses — dashboard shows pending approval with the draft
  4. You review and click Approve (or Reject with feedback)
  5. Agent sends the email and confirms

Run it

Bash
ninetrix build
ninetrix run

# Open the dashboard to approve/reject
open http://localhost:8000/dashboard
On this page