Observability & Evaluation

Production AI needs more than "it works". You need to trace what happened, evaluate quality, identify failures, and continuously improve. Foundry provides this end-to-end.

Tracing

Foundry emits OpenTelemetry traces for every agent run. Automatic when Application Insights is connected - no code changes required.

What gets captured

SpanData
agent_runFull request lifecycle, total latency, status
model_callModel name, token count (input/output), latency, cost
tool_callTool name, input parameters, output, execution time
retrievalSearch query, results count, relevance scores
content_filterFilter category, severity, blocked/allowed

Tracing flow

Export options

  • Application Insights - default, zero-config for Foundry agents
  • Datadog - via OTLP exporter
  • Any OTLP backend - standard OpenTelemetry

Framework support

Works with any framework: Microsoft Agent Framework, LangChain, Semantic Kernel, CrewAI, LangGraph, custom.

Tracing setup guide

Evaluation

Built-in Evaluators

EvaluatorMeasuresRequires
GroundednessAre claims supported by context?Context + response
RelevanceDoes the response address the query?Query + response
CoherenceIs the response logically structured?Response
FluencyIs the language natural?Response
SimilarityToken overlap with ground truthGround truth + response
Violence/Hate/Sexual/Self-harmSafety classificationResponse

Running evaluations

from azure.ai.evaluation import evaluate, GroundednessEvaluator, RelevanceEvaluator

results = evaluate(
    data="test_dataset.jsonl",
    evaluators={
        "groundedness": GroundednessEvaluator(model_config=model_config),
        "relevance": RelevanceEvaluator(model_config=model_config),
    }
)
print(f"Groundedness: {results['groundedness']:.2f}")

ASSERT

Open-source framework for policy-driven agent evaluation. Converts your written policies into executable evaluations and generates targeted test scenarios.

StepWhat it does
1. Define policiesWrite rules in natural language ("Agent must not disclose pricing to non-customers")
2. Generate scenariosASSERT creates targeted test cases from policies
3. Run evaluationsExecute against your agent
4. Surface defectsIdentify safety and quality failures before production

Works across LangChain, CrewAI, OpenAI, LightLLM, and more.

ASSERT on GitHub

Agent Control Specification (ACS)

Open industry specification for deterministic safety controls at five agent lifecycle checkpoints:

Expressed as portable YAML. Versionable, auditable, framework-agnostic.

Agent Control Specification

Rubric Evaluator

Auto-generates evaluation criteria based on your agent's context (public preview):

  • Creates custom quality criteria from agent definition and use case
  • Supports weighted dimensions for aggregate scoring
  • Runs alongside safety evaluators for unified scorecard
  • Feeds into Agent Optimizer

Agent Optimizer

Closes the loop from production signal to improvement (coming soon in public preview):

  1. Collects production traces
  2. Runs evaluation suite
  3. Generates ranked, reviewable improvement suggestions
  4. Developer applies changes

Agent ROI

Measures business impact of agents (private preview):

  • Task completion rates
  • Time saved
  • Cost efficiency
  • Stakeholder justification data

Guided Guardrail Setup

Questionnaire-based guardrail configuration (public preview):

  1. Answer questions about agent audience, data access, use case
  2. System recommends relevant controls (PII filters, jailbreak protection, task adherence)
  3. Apply with one click

No security expertise required.

AI Red Teaming Agent

Automated adversarial testing (preview). Probes your agent for vulnerabilities before deployment.

Red Teaming docs