verify_provenance
Verify LLM-generated code by tracing identifier provenance from context, detecting hallucinated APIs and invented names, and returning an IPD grounding score.
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 |