verify_provenance
Verify that LLM-generated code is grounded in provided context. Measures identifier provenance to detect hallucinated APIs or invented functions, returning an IPD score from 0 (fully grounded) to 1 (fully invented).
Instructions
Verify that LLM-generated code is grounded in the provided context.
Uses BIPT (Byte-level Information Provenance Tracer) to measure how much of each identifier in the generated code originates from the context. Returns an Identifier Provenance Deficit (IPD) score:
IPD = 0.0 → fully grounded (all identifiers come from context) IPD = 1.0 → fully invented (no identifiers match context)
Use this after an LLM generates code to check for hallucinated APIs, invented function names, or fabricated imports before accepting output.
Args: code: The LLM-generated code to verify context: The repository context that was provided to the LLM
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| context | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |