Software Engineer @ Microsoft Β· Agent Reliability
Measuring whether agents are right β and stopping them before they're wrong.
I build the measurement and enforcement layer for AI agents β the part that tells you whether an agent's answer is actually correct, and the part that blocks a dangerous action before it happens.
Most "agent safety" today is an LLM grading another LLM after the fact. That's a wobbly sensor bolted on after the money already moved. My work is the opposite: deterministic checks that gate, calibrated judges that only report, and evidence ranked by how hard it is to forge.
π’ Microsoft Β· Redmond, WA
Two questions, two pillars. Everything below serves one of them.
| Pillar | Question | Repo |
|---|---|---|
| Measure it | Was the answer right β retrieval, grounding, reasoning? And is my judge even calibrated? | agent-eval Β· maf-evals |
| Enforce it | Can I stop a bad action before it runs, deterministically, on the hot path? | gate-agent |
One principle ties them together: rank evidence by independence, not cost. A document-ID match or a tool-argument check means the same thing every run β so it gates. An LLM judge wobbles between runs β so it only reports. Never let a number that flips a coin block a merge or a payout.
π‘οΈ gate-agent β a circuit breaker on the live wire
A safety gate that says "no" before an agent does something dangerous, not after. Rust core (PyO3), checked before every tool step in tens of nanoseconds, with an identical verdict every time. Drop-in adapters for LangGraph, CrewAI, AutoGen, LlamaIndex.
Enforces structural facts a judge can't reliably see: prerequisites (ExecuteRefund requires prior VerifyIdentity), runaway-loop detection, depth/token budgets, tool-argument schemas.
gate-agent vs LLM-as-a-judge β same unsafe refund trace
------------------------------------------------------------------
Blocks unsafe refund 100% every run 62% of runs
Unverified refunds leaked 0.0% 37.5%
When it decides BEFORE the refund AFTER the refund
Verdict deterministic wobbles (SD~0.20)
Latency / step ~9 Β΅s ~700 ms
------------------------------------------------------------------
Why it matters: no evaluation run afterward can un-refund $5,000. Safety has to be a pre-execution decision.
π agent-eval β evaluation ranked by independence, not by cost
A zero-dependency TypeScript toolkit for evaluating agent output β in tests, on production transcripts, and as a CI gate. Built on an independence-first tier pyramid:
| Tier | What it is | Why it's trusted |
|---|---|---|
| 1 β Externally Observable | JSON parses, tool ran, diff exists | The agent cannot forge it |
| 2 β Statistically Observable | Embeddings, drift, staleness | The agent didn't produce the baseline |
| 3 β Shared-Substrate Judgment | Model-as-judge | Last resort β most forgeable |
Most agent failures (crashes, stale runs, format breaks, hallucinated paths) are caught by Tier 1+2 alone. Gate vs. grade: a check either gates (binary) or grades (0β1). A low grade is information, not a failure β never coerce one into the other.
π¬ maf-evals β the same discipline, on Microsoft Agent Framework + calibrated
A .NET 8 reference implementation of three-tier evaluation, and the repo where I make the case that calibration is non-negotiable β with numbers from actually running it:
- Split the RAG judge into Retrieval / Groundedness / Relevance. Never average them. One blended "quality score" hides the exact failure you need to fix.
- Calibration caught the Groundedness judge scoring outright fabrication at exactly 3.0 every time while also penalizing good answers β two errors that cancel into a healthy-looking β0.17 bias. Moving the floor 3.0 β 3.5 lifted band agreement 50% β 75%.
- The Retrieval judge returned
5, 2, 4, 5, 2on identical input β 17% of merge decisions would flip at random, so an exactexpectedChunkIdscheck does the gating and the judge only advises. - The judge costs ~250Γ the agent β measuring quality is the entire bill, so caching and counting judge calls is the real engineering.
The thesis: a threshold picked without calibration is just taste.
Where the reliability work gets battle-tested β real agents and prompt tooling to point the evals and gates at.
| Project | What it is |
|---|---|
| WinSentinel β | Always-on Windows security agent (.NET, 70k+ LOC, 4k+ tests) β a real autonomous agent to stress the reliability layer against |
| prompt / promptlib | .NET Azure OpenAI prompt-engineering toolkit β templates, chains, injection guards (published NuGet) |
| agentic-recipes | Canonical agentic pipeline patterns built on promptlib |
Full portfolio β languages, distributed systems, viz β in PROJECTS.md.
- Agent evaluation & judge calibration β why a single quality score lies, and how to measure the measurer
- Deterministic pre-execution safety β enforcing invariants on the hot path instead of grading traces after the fact
- AI agent identity, accountability & self-replication safety β governing autonomous agents
- Published in IEEE and Springer Β· Chair, ICGIS 2026 Β· π Papers
If your agent can move money, delete data, or ship code β you need to measure whether it's right, and gate it before it's wrong.
That's what I build.




