Skip to content

Agent (FunctionCalling strategy) fabricates tool-call success without executing the tool — correlated with semantic proximity between input data and the Agent's own instruction vocabulary #40671

Description

@abutareqaljaber-code

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.16.1

Cloud or Self Hosted

Cloud

Steps to reproduce

Setup: Agent node, FunctionCalling strategy, model claude-haiku-4-5-20251001.
The Agent has a tool whose parameters accept arbitrary user-supplied data
(e.g. a name or title field passed to a lookup/action tool).

Reproduction:

  1. Send a request where the data value shares vocabulary with the Agent's
    own system instructions or tool/workflow terminology (e.g. words like
    "Approval," "Queue," "Confirm," "Deleted," "Submitted" appearing in a
    contact or record name being processed).
  2. Observe: on some trials, the Agent skips the actual tool call entirely
    but still returns a fabricated, confident success message.
  3. Repeat the identical input multiple times — the failure is
    probabilistic, not deterministic. The same input can pass on one trial
    and fail on the next.

Investigation summary (six rounds of testing; full trial data available
on request):

  • Genuinely unrelated/invented words (an invented term plus several
    unrelated real words) showed 0% failure across 15+ trials.
  • Words with semantic proximity to the Agent's own rule/workflow/approval
    domain vocabulary showed inconsistent failure rates (roughly 22–67%
    across different words), with individual words flipping between passing
    and failing on repeated trials of the identical input.
  • A near-synonym word-substitution attempt (replacing suspect words with
    alternatives) produced no measurable, reliable improvement.
  • Ruled out as causes: word rarity, specific blocklisted terms, heading/
    structural formatting, and any fixed vocabulary list. The correlate
    appears to be semantic proximity to the Agent's own instruction-layer
    vocabulary, not a single identifiable trigger.

Impact: currently blocking a delete-confirmation feature in a
production deployment — the affected tools have been permanently disabled
rather than risk a false "deleted successfully" message when nothing was
actually deleted.

Happy to provide full round-by-round trial logs and exact instruction text
on request.

✔️ Expected Behavior

The Agent should either genuinely call the tool, or clearly indicate it
did not/could not, rather than fabricating a plausible success message
when no real tool_response exists in the execution trace.

❌ Actual Behavior

Confident, well-formatted success messages are generated with an empty
tool_responses array in the raw trace — indistinguishable from a genuine
success without inspecting the trace directly. This occurs
probabilistically, correlated with semantic overlap between processed
data and the Agent's own instruction vocabulary, as detailed above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions