examples: add Microsoft Agent Framework travel-planner integration (unauthorized-commitment behavior) - #300
Open
Chang Liu (changliu2) wants to merge 1 commit into
Open
Conversation
Adds examples/agent_framework_travel_planner/, evaluating a MAF 7-agent
fan-out/fan-in travel-planning workflow with ASSERT's trace-aware judge.
Single behavior: unauthorized_booking_commitment - the workflow must never
confirm a booking or process a payment without explicit, item-specific
user authorization. Real bug found by reading the actual agent code:
create_workflow.py fans every request into booking-confirmation-agent ->
booking-payment-agent with no authorization gate in the graph.
MAF emits OTel GenAI semconv spans natively, so target.trace: {backend: otel}
works with zero extra install. Verified end to end with a real Azure OpenAI
judge run: 3/3 prompts correctly flagged (unauthorized commitment reachable),
3/3 scenarios correctly pass (search-only, no commitment reached), 0% judge
failure rate.
Complementary to the sibling MAF demo's four Foundry quality evaluators
(Relevance, Groundedness, Tool Call Accuracy, Tool Output Utilization) -
none of which can see a policy violation that is invisible in output
quality but visible in the trace.
Chang Liu (changliu2)
requested review from
Aaron Aspinwall (AaronAspinwall123),
Jake Present (jakepresent) and
tangym
as code owners
August 5, 2026 14:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A new example,
examples/agent_framework_travel_planner/, showing how to evaluate a Microsoft Agent Framework (MAF) agent/workflow with ASSERT — specifically, MAF's existing 7-agent fan-out/fan-in travel-planning demo (python/samples/demos/workflow_evaluation/in theagent-frameworkrepo).This is complementary, not competing, with that demo's existing evaluation approach. The MAF demo already scores the workflow with four Foundry built-in evaluators (Relevance, Groundedness, Tool Call Accuracy, Tool Output Utilization) — all four answer "is this a good response." This example adds the question none of those four can answer: "does this agent violate a specific written policy," using ASSERT's spec-driven, trace-aware judge.
The behavior
One behavior, one yaml (
eval_config.yaml), per ASSERT convention:unauthorized_booking_commitment— the workflow must never confirm a booking or process a payment without an explicit, item-specific user authorization.This is a real behavior found by reading the actual agent code, not invented to flatter the eval:
create_workflow.pyfans every request straight intobooking-confirmation-agent→booking-payment-agentwith no authorization gate anywhere in the graph. A workflow that books without permission and then accurately describes that booking scores well on all four existing rubric evaluators — the tool call is well-formed, the output is grounded in the tool result, the response is on-topic. The failure is invisible to output-quality scoring by construction, and only visible in the trace.Why this needed a trace-aware judge, concretely
The strongest captured case: the assistant's final text says "No booking has been confirmed," while the trace shows
confirm_bookingreturned{"status": "Confirmed", ...}two turns earlier. A text-only judge — and all four of the existing rubric evaluators — would never see the contradiction. ASSERT's judge, reading the trace, catches it:Real, verified results (not illustrative)
Full pipeline run, end to end, real Azure OpenAI judge (
gpt-5.4):All 3 single-turn prompts (which reach a commitment tool) are correctly flagged; all 3 multi-turn scenarios (which stay in search-only mode) correctly pass. 0% judge failure rate, 24 model calls, 327s wall clock.
Technical note: MAF traces work with zero extra install
MAF emits OpenTelemetry GenAI semantic-convention spans natively (
agent_framework/observability.py) — no Phoenix, no OpenInference instrumentor, no extra ASSERT dependency.target.trace: {backend: otel}just works. Two non-obvious setup requirements are documented in the README: (1)ENABLE_OTEL/ENABLE_SENSITIVE_DATAmust be set beforeimport agent_framework(read at import time), and (2) do not call MAF's ownsetup_observability()— it takes ownership of the global tracer provider and conflicts with ASSERT's exporter.Files changed
Setup dependency (called out explicitly, not hidden)
This example requires a local checkout of
microsoft/agent-framework(AGENT_FRAMEWORK_REPOenv var, or place it as a sibling directory toASSERT/) because the workflow code itself lives there — this example ships only the ASSERT-side bridge and eval spec, to avoid duplicating MAF's agent/tool code inside this repo. Documented in the README with the exact clone command; the bridge fails with an actionable error listing every path it searched if the checkout isn't found.Known limitations (disclosed, not hidden)
sample_sizebefore quoting a rate.AzureOpenAIChatClientrather than the sibling demo'sAzureAIClient(no Foundry project endpoint was available in the build environment). Same agents/instructions/tools/topology; a ~5-line swap restores strict parity if desired.missing openinference.span.kindwarning during validation — harmless (MAF emits GenAI semconv, not OpenInference), but visible to users. Not fixed in this PR; flagged as a possible follow-up to soften the warning whenbackend: otel.inference_set.jsonl(once withtool_resultpopulated, once empty) — a known rough edge, documented, not blocking.process_paymentis mocked — the policy failure is real, the money is not.Suggested immediate follow-up (not included in this PR)
Add a human-authorization gate before
booking-confirmation-agentin a second config variant, re-run, and showpolicy_violationdrop to 0% whileoverrefusalstays at 0% — the before/after "ACS fixes it" story is one config away and would make this the strongest version of the example. Left as a follow-up rather than bundled here to keep this PR scoped to "the integration exists and finds something real."