Set up an evaluator
1
Install the evaluator SDK
Install the SDK and the server used to run it.
2
Define what to score
Create
evaluator.py. This example checks whether a session contains any failed tool calls.3
Run and test it locally
Set a shared token, start the evaluator, and confirm its health endpoint responds.In another terminal:
Connect the evaluator to Failproof AI
- Deploy the evaluator at an HTTPS URL reachable by Failproof AI Cloud.
- Configure
EVALUATOR_ENDPOINTwith that URL and setEVALUATOR_TOKENto the same token used by the evaluator. For managed Cloud, contact support@befailproof.ai to configure the connection. - Run an evaluation and confirm its scores appear in Failproof AI.
- Dashboard
- CLI
Open a completed session under Observe → Sessions and select Run evaluation if it was not evaluated automatically. Review the status, scores, reasoning, and summary in the session’s Evaluation panel.Use Observe → Evaluations to compare scores across agents or environments. Use Observe → Metrics for latency, cost, token, and other numeric measurements.Start with one session to confirm that the evaluator returned the expected score keys and useful reasoning for that specific run.
Once individual results look correct, use the evaluation dashboard to compare those scores over time and across agents or environments.
A healthy chart should use stable score names; changing a key creates a separate series.


EVALUATOR_ENDPOINT is set on the server process. Restart the server after changing evaluator environment variables.
The service exposes GET /health, GET /config, POST /evaluate, and optionally GET /evaluate/{job_id}. Return JobPending for asynchronous work and register @app.job_lookup so Failproof AI can poll it.
When a token is configured, all routes except health require the same bearer token that Failproof AI sends as EVALUATOR_TOKEN.
SDK types
Decorators and routes
The SDK caps evaluation request bodies at 25 MiB. Unknown request fields are ignored so services remain compatible as the event contract grows.
Return asynchronous work
UseJobPending when evaluation cannot finish inside one request. The job ID is opaque to Failproof AI and must remain resolvable by your service until the result is collected or the server timeout expires.
JobPending.next_poll_secs, EvaluatorConfig.default_poll_interval_secs, then the server’s EVALUATOR_POLLING_INTERVAL_SECS. Values are clamped between 1 second and 1 hour. The server’s default wall-clock polling cap is one hour.
Request and response fields
Server operator settings
Automatic evaluation is deployment-wide and remains disabled whenEVALUATOR_ENDPOINT is absent.
The server can also constrain which organizations use the deployment-global evaluator. Treat endpoint, token, retry, and organization-gate changes as operator configuration and restart or roll the server after changing them.
Security and operations
- Put the evaluator behind HTTPS when traffic crosses a trusted network boundary.
- Configure a non-empty bearer token and keep it identical on both services.
- Do not log the token or full sensitive prompts from request payloads.
- Make synchronous handlers idempotent; retries may repeat a request.
- Persist asynchronous job state outside process memory in production.
- Return stable score keys. Renaming a key creates a new chart series rather than changing the old one.
eval received, eval responded, job lookup, config returned, auth rejected, and handler exceptions. It does not configure logging handlers; use the host application’s logging configuration.
