Promptfoo
Keep your evaluator. Route compatible test traffic through Ingate and attach external verdicts separately.
Promptfoo evaluates prompts and application outputs. Ingate supplies gateway identity, routing and captured evidence; routing a request does not submit a Promptfoo verdict.
Before running
openai with upstream credentials and a compatible Chat Completions endpoint. Replace the example host for your installation. Your own model calls can incur charges. Local qualification uses Promptfoo 0.124.1 (Node 22.22.0 or newer), Ingate source 29ec117f9f46806f9776bcca7835333e92fcef02, an owned PostgreSQL database and a synthetic provider; it does not establish public deployment or live-provider availability.Separate gateway identity from provider authentication
X-Ingate-Key identifies your Ingate app. Promptfoo's apiKey or apiKeyEnvar supplies an OpenAI-style provider credential, not this identity header. In configured-provider mode below, unused is an SDK placeholder; Ingate injects the selected provider's upstream authentication.
Supply INGATE_KEY through your secret manager or CI environment, not a committed file. Set a fresh INGATE_SESSION_ID for each deliberate inference run. This Bash example creates a non-secret correlation marker:
export INGATE_SESSION_ID="promptfoo-$(date +%s)-$RANDOM"prompts:
- Reply with OK
providers:
- id: openai:chat:gpt-4o-mini
config:
apiBaseUrl: https://api.ingateai.com/v1
apiKey: unused
omitDefaults: true
maxRetries: 0
headers:
X-Ingate-Key: "{{ env.INGATE_KEY }}"
X-Ingate-Provider: openai
X-Ingate-Session-Id: "{{ env.INGATE_SESSION_ID }}"
tests:
- assert:
- type: equals
value: OKThe explicit openai:chat: prefix selects Chat Completions. Promptfoo appends /chat/completions to the /v1 base, producing /v1/chat/completions. Do not append the endpoint twice. A provider name selects connection/authentication configuration; it does not translate request bodies. Azure deployments and native non-OpenAI APIs can need different paths or explicit translation.
Removing X-Ingate-Provider does not switch authentication modes. Path auto-detection can still select the saved openai provider, which injects its configured key even when Promptfoo supplies a different upstream credential. Client credential passthrough needs separate server-side configuration with no saved key or conflicting authorization override. See Provider Configuration for saved-provider precedence and static forwarding-only limits; changing the client header or apiKeyEnvar alone is insufficient.
promptfoo eval --config promptfooconfig.yaml --no-cache --max-concurrency 1 --output results.jsonCheck transport, evidence and verdict independently
First inspect provider errors in results.json. A missing gateway key returns HTTP 401 before upstream inference; a routing, policy or provider refusal is not a failed quality assertion. A successful response can still fail equals. An evaluator exception is an error, not a completed negative verdict. Inspect result details: aggregate failure counts alone do not distinguish these outcomes.
Capture depends on gateway configuration and persistence is asynchronous. After a successful response, find the fresh session marker and verify the request's org/app, provider and status in Sessions or the Logs API. An HTTP response or a local evaluator result alone is not a stored-evidence receipt. Use a read-only retry if evidence is delayed or a read is refused; do not rerun inference merely to refresh a dashboard. After uncertain transport, inspect existing evidence before deciding whether to make another chargeable call.
Ingate evaluations require configured evaluators and applicable entitlements. Promptfoo model-graded assertions need their own grader configuration: provider routing above does not automatically route the grader. The sample uses a deterministic assertion and does not call a model grader.
Optionally gate a skill from CI
Keep Promptfoo's completed verdict as the evaluator authority. Submitting an external result is a separate write, not an automatic effect of proxying traffic. The following examples require an existing same-org skill, its current version and rubric, suitable permissions and INGATE_SKILL_ID/INGATE_RUBRIC_ID set to real IDs. Map the actual completed result; never turn a provider or evaluator error into passed: true.
curl --fail-with-body --silent --show-error -X POST "$INGATE_URL/api/v1/eval-results" \
-H "X-Ingate-Key: $INGATE_KEY" -H "Content-Type: application/json" \
-d "{"subject_type":"skill","subject_id":"$INGATE_SKILL_ID","source":"promptfoo","score":0.92,"passed":true,"external_ref":"$INGATE_SESSION_ID"}"The illustrated score/pass values are placeholders for a completed verdict. Allow the source in the skill's rubric separately:
curl --fail-with-body --silent --show-error -X PUT "$INGATE_URL/api/v1/skills/rubric/$INGATE_RUBRIC_ID" \
-H "X-Ingate-Key: $INGATE_KEY" -H "Content-Type: application/json" \
-d '{"allowed_verdict_sources":["internal","promptfoo"]}'Skill publication still applies its current-version, rubric and authorization checks. Inspect write responses before retrying: reading existing evidence is different from resubmitting a verdict or rerunning inference. The local gateway qualification above does not qualify your skill's publish workflow.
Reference
- Promptfoo connection settings and telemetry controls
- Eval Results API: subject/source validation and external verdicts
- Skills API: current-version publish gates and rubric configuration
- Trace Exports: evidence delivery to other tools