Skip to content

Detect hallucinated tool invocation claims - #294

Merged
jgsogo merged 3 commits into
mainfrom
feat/hallucinated-tool-invocation-evaluation
Nov 25, 2026
Merged

jgsogo merged 3 commits into
mainfrom
feat/hallucinated-tool-invocation-evaluation

Conversation

@jgsogo

@jgsogo jgsogo commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Track tool dispatches in the runtime as trusted execution facts, counting authorized dispatches even when the tool returns an error.
  • Add a deterministic response evaluator that detects explicit first-person or passive claims that a configured tool was used when it was not dispatched during the run.
  • Emit a dedicated hallucinated_tool_invocation runtime event and propagate it through service run history, persistence, the run-events API, and server logs.
  • Add evaluator unit tests and a runtime integration test for the reported failure mode.

Evaluation behavior

The first version intentionally uses a conservative lexical heuristic. It checks canonical tool names configured for the agent and nearby usage phrases; it does not make another LLM call. It ignores explicit denials, hypothetical mentions, and claims about someone else using the tool.

A dispatched tool counts as executed even if it fails. A denied tool does not count as executed.

Validation

GitHub Actions CI should run cargo fmt --all -- --check, cargo check --workspace --all-targets, and cargo test --workspace.

@jgsogo
jgsogo force-pushed the feat/hallucinated-tool-invocation-evaluation branch from fe944d3 to 1a59b93 Compare November 25, 2026 09:37
@jgsogo
jgsogo enabled auto-merge November 25, 2026 11:18
@jgsogo
jgsogo merged commit 7ed6496 into main Nov 25, 2026
1 check passed
@jgsogo
jgsogo deleted the feat/hallucinated-tool-invocation-evaluation branch November 25, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant