Skip to content
View sauravbhattacharya001's full-sized avatar
🏠
Working from home
🏠
Working from home
  • Microsoft
  • Seattle WA
  • 19:07 (UTC -07:00)
  • X @zalenix

Block or report sauravbhattacharya001

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
Typing SVG

Software Engineer @ Microsoft Β· Agent Reliability

Measuring whether agents are right β€” and stopping them before they're wrong.

LinkedIn Email gate-agent agent-eval


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


🎯 The focus: can you trust what the agent just did?

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.


πŸš€ Core work

πŸ›‘οΈ 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, 2 on identical input β€” 17% of merge decisions would flip at random, so an exact expectedChunkIds check 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.


🧰 Also building (adjacent, not the focus)

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.


πŸ› οΈ Tech

Rust TypeScript Python C# .NET Azure OpenAI PyO3 OpenTelemetry


πŸ”¬ Research

  • 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

πŸ“Š GitHub Stats


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.

Pinned Loading

  1. maf-evals maf-evals Public

    Three-tier evaluation for LLM agents on Microsoft Agent Framework (.NET): runtime guardrails, a PR gate, and calibrated judges. The framework evaluates itself.

    C# 2

  2. agent-eval agent-eval Public

    Zero-dependency TypeScript toolkit for evaluating AI agent outputs. Post-hoc, report-only trace triage that finds the runs that failed the process (timeout, runaway, stall, self-contradiction), ran…

    TypeScript 2

  3. agentic-recipes agentic-recipes Public

    Canonical agentic pipeline examples built on prompt-lib β€” linear chains, fan-out/fan-in, middleware pipelines

    C# 2

  4. gate-agent gate-agent Public

    Deterministic runtime invariant & hot-path shielding engine for AI agents (Rust/PyO3, LangGraph/CrewAI/AutoGen/LlamaIndex adapters)

    Python 3