Join our Newsletter — 33% off our NHI Course

Completion Function

A completion function is the component that produces a model’s output for an eval. It can wrap a model directly or add extra operations needed to answer a task accurately, such as tool use or retrieval, while presenting a standardized interface to the evaluation framework.

How Completion Functions Shape Eval Output

A completion function is the layer that turns a task prompt into an evaluated output. It may be a direct model wrapper or a small orchestration component that standardizes how the evaluation framework receives a response.

This matters because evals do not only measure model capability, they measure the behavior of the whole completion path. If the function adds retrieval, tool use, prompt shaping, truncation, or post-processing, those steps become part of the measured system and can change the result materially.

Where Completion Functions Sit in the Eval Stack

In practice, the completion function is the bridge between the benchmark harness and the system under test. It hides implementation details behind a stable interface so the evaluator can call many different models, workflows, or agentic wrappers in a consistent way.

That abstraction is useful when the same benchmark must compare a raw model, a retrieval-augmented system, and a tool-using workflow. The function normalizes how inputs are accepted and outputs are returned, while still allowing the underlying path to differ.

What Completion Functions May Include

A completion function can be minimal or highly engineered. At the simple end, it forwards a prompt to a model and returns the text completion. At the more complex end, it may orchestrate retrieval, call tools, format context, enforce output structure, or combine intermediate steps before returning the final answer.

That flexibility is powerful, but it also means the function is part of the experimental design. Any added operation can improve task performance, but it can also introduce latency, nondeterminism, hidden dependencies, or leakage between the benchmark and the system being evaluated.

Why Completion Functions Affect Evaluation Meaning

Because the completion function sits inside the measurement path, it influences what the score actually represents. A score on a bare model completion is not directly comparable to a score from a wrapper that uses external retrieval or tool execution unless the benchmark is explicitly designed to measure that composite behavior.

For that reason, completion functions should be treated as part of the evaluated system definition, not just plumbing. The more they alter prompts, context, or outputs, the more important it becomes to document the wrapper logic and keep it stable across runs.

Risk and Threat Considerations

Completion functions can hide weak points in an eval setup if they silently change prompts, inject retrieved content, or mask failures in tool use. That can produce misleading scores and make a system look more capable or more consistent than it really is.

Failure mechanism: The wrapper becomes a control point where prompt manipulation, retrieval quality, tool errors, truncation, or output normalization can distort the observed result and break comparability across runs.

Impact: Teams may draw the wrong conclusion about model quality, miss regression, or ship a system whose real-world behavior differs from its benchmarked behavior.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 addresses the attack and risk surface, while NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST CSF 2.0 GV.OV-01 — Oversight of Risk Management Strategy Completion functions affect what eval scores actually represent.
Recommendation — Define the completion path as part of the evaluated system and review it for changes that alter benchmark meaning.
NIST SP 800-53 Rev 5 AU-6 — Audit Record Review, Analysis, and Reporting Wrapper logic can obscure how outputs were produced and what changed.
Recommendation — Log wrapper behavior and review evaluation traces to detect prompt, retrieval, and post-processing drift.
OWASP API Security Top 10 API8 Security Misconfiguration — Security Misconfiguration A completion function is a standardized interface whose behavior can be altered by unsafe configuration.
Recommendation — Harden the completion interface so hidden configuration changes do not alter evaluation behavior.

Practitioner Guidance

What to watch for: Treat the completion function as a versioned evaluation component, not an invisible helper. If it changes, the benchmark may be measuring a different system even when the base model is unchanged.

Practitioner takeaway: The clearest evals are the ones where the completion path is explicit, stable, and easy to compare across experiments.