Skip to content

Generic approval node defaults to approved and routes to protected tool without human decision #3

Open

Description

@Tardfyou

Description

The generic approval node in the workflow engine defaults to approved status when no explicit human decision is recorded, allowing the workflow to route to the protected tool without an actual approval.

Suggested fix

Default to pending or denied when no decision is recorded.

Activity

  1. Tardfyou commented on Oct 24, 2026

    @Tardfyou
    Author

    Detailed reproduction

    Location: agentorch/runtime/workflow_execution.py:405-411 (handle_approval) and agentorch/workflow/runner.py:12-43

    The bug: When runtime.human_feedback is None (no feedback mechanism configured), the approval node's handle_approval method returns "approved" by default rather than blocking. The workflow then routes to the protected tool via the condition edge.

    PoC (extracted from real source, executed offline):

    # RuntimeWorkflowExecutor.handle_approval at line 405-411:
    # When human_feedback is None, it does NOT wait for input
    # Instead it returns an approved status, allowing the workflow to proceed
    # to the tool node which executes write_marker
    
    # The proof sets:
    executor.runtime = SimpleNamespace(tools=FakeTools(), human_feedback=None)
    # ↑ human_feedback=None → no human can approve
    # But the workflow still executes the protected tool
    
    # Result: marker file created WITHOUT any human verdict
    assert executor.runtime.human_feedback is None  # no feedback mechanism
    assert MARKER.exists()  # but the effect happened

    Suggested fix: When human_feedback is None, the approval node should either raise an error (no mechanism to obtain approval) or return a "pending" status that blocks the workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions