Skip to content

TrustLens overview

import { Aside } from “@astrojs/starlight/components”;

Alquimia TrustLens is an optional evaluation service that consumes signed context.persistence.v1 webhooks from alquimia-runtime and runs Gaussia benchmarks against agent conversations. It is configured through Alquimia Studio and exposes Prometheus metrics that Studio renders in the Agent Humanity view.

TrustLens receives runtime events, reconstructs conversation sessions, runs selected benchmarks in background workers, and persists jobs and results in PostgreSQL. Studio reads evaluation metrics from Prometheus.

Alquimia Runtime
|
| signed context.persistence.v1 webhook
v
TrustLens <---- Studio
| configuration API
|
+---- Vault
| model secrets
v
PostgreSQL
config + jobs + results
|
v
GET /metrics <---- Prometheus
|
v
Studio

TrustLens runs single-agent Gaussia benchmarks. The default set is humanity, context, and conversational. Once a session reaches five interactions, bias and toxicity are added automatically unless explicitly disabled.

BenchmarkDescriptionModel dependency
humanityEmotional characteristics in assistant responses.None
contextWhether responses remain aware of conversation context.Judge model
conversationalMemory, language, quality, quantity, relation, manner, and sensibleness.Judge model
biasResponse disparities across protected attributes.Guardian model
toxicityToxicity distribution and clustering indicators.Local evaluation

Judge and guardian models are selected from Studio Model Connections. TrustLens resolves their Vault secret references at evaluation time.

MethodPathPurpose
GET/configRead TrustLens configuration for an agentspace and optional assistant.
PUT/configSave configuration and create, update, or pause the Runtime webhook.
POST/config/disableDisable TrustLens and pause the Runtime webhook.
POST/webhooks/runtimeAccept and verify a signed Runtime event. Returns 202.
GET/analytics/summaryJob counts and average benchmark scores.
GET/analytics/evaluationsPaginated evaluation jobs and results.
GET/metricsPrometheus exposition endpoint.
GET/health/readinessService readiness check.

Interactive OpenAPI documentation is available at /docs.

VariableDescription
DATABASE_URLPostgreSQL connection for configuration, jobs, and results.
TRUSTLENS_API_TOKENBearer token used by Studio for the private configuration API.
TRUSTLENS_RUNTIME_BASE_URLRuntime base URL for webhook subscription management.
TRUSTLENS_RUNTIME_API_TOKENRuntime API token for managing webhook subscriptions.
TRUSTLENS_WEBHOOK_URLPrivate URL Runtime calls, e.g. http://trustlens.railway.internal:8080/webhooks/runtime.
TRUSTLENS_WEBHOOK_SIGNING_KEYShared 64-character hex HMAC key for webhook verification.
VAULT_ADDR / VAULT_TOKENVault server and token for resolving model credentials.
OTEL_COLLECTOR_ENDPOINT*Optional OTLP endpoints for metrics, traces, and logs.
  • TrustLens needs a private PostgreSQL service and access to the Runtime webhook API.
  • Prometheus must scrape /metrics so Studio can display Agent Humanity charts.
  • In Railway, deploy TrustLens as a private service and use /health/readiness as the health check path.