Howdy friends!
In my Beyond Vibe Coding: Harness Engineering with Google series, I described how to build a harness around the model. In Part 2: Loop Engineering in the Harness, I wired up an autonomous execution loop with a two-phase evaluation rubric that runs on every iteration. Having that rubric is a massive win: it verifies that everything the agent builds actually meets the spec, passes every test and static check, and gets independently evaluated by an agent-as-a-judge before the loop is allowed to call it done.
There was just one snag: it can get slow and expensive when you run it on every single loop pass.
How My Two-Phase Rubric Works
When I first built the rubric, I split every check cleanly into two phases:
-
Phase 1 — Deterministic Gates: Local linters, typecheckers, and unit tests (
codespell,ruff,pytest). This phase is super fast and doesn't consume any tokens. If Phase 1 fails, the loop stops immediately and our agent then makes the required fixes. - Phase 2 — Semantic Critic: Once Phase 1 is green, a fresh subagent with zero session history inspects the workspace against my specification. It asks questions like "Did this actually implement the spec without cutting corners?", and "Has the documentation been updated to match the changes?"
How You Wire It Into a Repo
To use this rubric we just provide any given repo with a plain-Markdown table of binary assertions (B1–Bn). We would typically do this inside of a file like SPEC.md, LOOPS.md, or RUBRIC.md. The table might look something like this:
| ID | Falsifiable Condition | Verification Target |
| :--- | :--- | :--- |
| `B1` | Static checks (`codespell`, `ruff`) and unit tests pass | `make check` |
| `B2` | `README.md` and `.env.template` document every new CLI flag and env variable | `README.md, .env.template` |
| `B3` | CLI commands support `--json`, `--dry-run` on mutations, and actionable error hints on `stderr` | `src/cli.py` |
| `B4` | Core logic stays separated from API/UI handlers; invalid inputs return actionable errors without leaking stack traces | `src/api.py, src/core.py` |
| `B5` | `.gitignore` excludes `.env` and cache folders, with zero hardcoded secrets or project IDs | `.gitignore, src/` |
On every loop iteration, the agent runs the deterministic checks, then hands the remaining assertions and the diff to the semantic critic. No sycophancy, no polluted context window, and no "looks good to me!" hand-waving.
The Semantic Bottleneck
The catch is the tax you pay on every iteration that passes the deterministic phase. Spawning a reasoning subagent typically takes 10–20 seconds and burns standard output and thinking tokens even for straightforward checks like "Did you document the new CLI flag in README.md?" or "Did you actually add the unit test you promised?" Run four or five loop passes on a feature branch, and you spend more time waiting on the critic than writing code.
There are a couple of initial ways we might try to solve this problem.
We might instead use a much faster, cheaper model to do the entire semantic phase. The problem with this approach is that the cheaper model is often not smart enough to perform accurate evaluations.
Alternatively, we might introduce a fast, cheap model to perform triage. This model would perform initial fast evaluations where it can, and then route to a smarter model only where needed. The triage phase would generate its own set of structured output. But as Karl Weinmeister proved in his routing benchmarks, asking an LLM for JSON creates its own bottlenecks:
-
Generation latency: Even Google's super-fast
gemini-3.5-flash-litetook a median of over2seconds just to emit a structured JSON routing verdict in Karl's benchmarks. This adds so much overhead that the combined call was slower end-to-end than skipping routing altogether. -
Output-token markups: Generative models bill output and hidden thinking tokens at
4x–8xthe input token rate, meaning you pay a premium just to generate{,",:, and}punctuation in the structured output. -
Hallucinated confidence: Asking a model to output
"confidence": 0.95looks right on the surface, but it is just predicting plausible-looking text tokens — effectively hallucinating a score rather than computing a calibrated probability you can safely set thresholds against.
Is there a way we can do a much faster and cheaper triage between our deterministic layer and our semantic critic?
Enter the Gemini Decisions API
Every standard LLM call has two steps: first, the model reads your entire prompt all at once in parallel (known as prefill); second, it writes its reply out one token at a time (generation), which is where most of the latency and output-token cost lives. A dedicated decision model skips that second step altogether — it runs a single prefill pass over your input and questions, reads the probability scores straight out of the model, and returns calibrated verdicts with zero text generated. TypeSafe's Jev had already shown how well this emerging category works for fast yes/no and routing decisions.
In November 2026, Google DeepMind dropped the Gemini Decisions API, powered by a purpose-built model called Gemini Decision 1 (gemini-decision-1) on the Gemini Developer API (v1beta).
Instead of treating a yes/no judgement or rubric score as a text-generation task, gemini-decision-1 evaluates your context and up to 1,000 independent questions in a single prefill pass. It generates 0 output tokens and 0 thinking tokens.
Because there is no token-by-token generation loop, the economics shift dramatically:
-
Speed: End-to-end latency is roughly
0.2seconds across contexts up to16Ktokens — and it stays nearly flat whether you ask1question or100in the same call. -
Pricing: Standard paid input is
$0.10per 1M input tokens, and$0for output (because there are no output tokens!). Google reports thatgemini-decision-1is typically5xcheaper across its shared benchmark suite than runninggemini-3.5-flash-liteon the Interactions API — and your shared input payload is billed only once per request, no matter how many questions you attach. -
Native multimodality: Within a
256K-token context window, a singleinputblock can combine text, JSON, images, audio, video, and PDFs directly without separate OCR or transcription pipelines.
To put those numbers in context (from the official Gemini API pricing table): gemini-decision-1 works out roughly 5x cheaper and 10x faster than gemini-3.5-flash-lite ($0.30 input / $2.50 output per 1M tokens). And compared with gemini-4-hydrogen ($1.50 input / $7.50 output per 1M tokens) — the model I currently use as my semantic rubric judge — gemini-decision-1 is 15x cheaper on input alone (with zero output or thinking-token bills) and more than an order of magnitude faster.
As detailed in Google's launch post, Google is already running the Decisions API in production across its own products — routing queries in Gemini Notebook (cutting everyday latency by up to 40%), powering instant wireframe edits in Stitch Rapid, selecting from 200+ emoji reactions in CC, and screening MCP tool behaviour in Google Search.
Core Decision Primitives
Every question passed to client.decisions.create (requiring google-genai >= 3.2.0 configured with v1beta) uses one of three structured primitives documented in the Decisions API guide:
Here is how concise a live Python call looks:
from google import genai
client = genai.Client(http_options={"api_version": "v1beta"})
result = client.decisions.create(
model="gemini-decision-1",
input="Diff and spec payload go here...",
questions={
"docs_updated": {
"type": "noul",
"instructions": "Does the diff update README.md with the new CLI flag?",
"criteria": {
"true_description": "README.md is present and documents the new flag.",
"false_description": "README.md omits or contradicts the new flag.",
},
},
},
)
verdict = result.answers["docs_updated"]
# verdict.noul: calibrated probability from 0.01 (no) to 0.99 (yes)
# verdict.confidence: certainty in the verdict — max(noul, 1 - noul)
print(f"P(yes)={verdict.noul:.2f} confidence={verdict.confidence:.2f}")
# Example output: P(yes)=0.97 confidence=0.97
For a noul question, verdict.noul gives you a calibrated probability between 0.01 (definitely no) and 0.99 (definitely yes), while verdict.confidence tells you how certain the model is in that call — giving you real numbers you can write pass/fail thresholds against in code.
Investigating How to Build a Faster, Cheaper, Safer Rubric
As soon as gemini-decision-1 was launched, I figured it was going to be the perfect answer to our problem.
I didn't have to start my investigation from scratch. In two excellent articles — Routing models with the Gemini Decisions API and How LLM routing strategies compare — Google Cloud's Karl Weinmeister benchmarked 150 multimodal tasks across text, code, charts, PDFs, and audio using his gemini-decision-router sandbox. He observed that:
-
Routing overhead drops from over
2seconds to~0.3seconds: Across Karl's multimodal test suite, swapping promptedgemini-3.5-flash-liteJSON forgemini-decision-1cut median routing latency from2.2seconds down to0.3seconds. -
The threshold rules you write in code matter over 40x more than how you word the prompt. Changing how his router acted on the probability scores cut compute spend by
28%, whereas rewording the prompt moved it by less than1%. -
Don't treat
0.50as a pass: (But seriously, why would you?) Because buggy Python still looks syntactically correct, Karl found that accepting anything above a0.50pass threshold let60%of wrong drafts slip through. Raising the threshold to0.80dropped wrong drafts accepted to5%(while keeping87%of good drafts), and0.90pushed false passes down to0%. - Mistake costs are asymmetric: Falsely waving through broken code wrecks your loop's reliability, whereas escalating a borderline check to a deeper critic costs fractions of a cent.
From Two Phases to Three: Tier 1, Tier 1.5, and Tier 2
Now we know that gemini-decision-1 can act as a super-fast filter. It's the perfect missing piece for evolving my two-phase harness rubric into a three-stage verification funnel by slotting it right in the middle as Tier 1.5.
We previously saw that a 0.90 threshold eliminates false passes. But Karl's data shows that with a threshold of 0.90 about 40% of true passes would also be rejected. And this is fine... We can simply say that anything that lands between near-certain failure (<= 0.20) and near-certain pass (>= 0.90) goes into a grey zone. These aren't rejected; they're simply escalated to Tier 2 - our existing semantic critic - for a closer look. This way, clear passes finish in a fraction of a second, obvious omissions fail fast without waking Tier 2, and anything in the grey area gets the full full reasoning treatment.
Category Tagging: Controlling Tier 1.5 Authority
Not every assertion in a rubric carries the same risk, so Tier 1.5 shouldn't have the same authority on every row. Checking whether pytest passed doesn't need an AI at all; checking whether README.md mentions a new CLI flag is safe for a fast prefill model to sign off on the spot; but checking for a subtle security flaw or race condition still deserves a deep reasoning critic.
To encode that distinction into my Python runner (eval_rubric.py), I added lightweight inline tags to the B1–Bn IDs in my rubric table (e.g. `[det]`, `[docs]`, `[arch]`, `[security]`). Each tag tells Tier 1.5 how much authority it gets:
-
[det]— Deterministic (Skip Tier 1.5): Already proven by Tier 1's local shell exit codes (make check). Skipped completely so we never burn an API call asking a model to guess whetherpytestpassed. -
[docs],[mech],[ui]— Surface & Routine (Tier 1.5 Can Pass): Low-risk checks that can be verified directly from the diff or target files (untagged rows also default here). Ifgemini-decision-1scores>= 0.90with high confidence and no truncated files, it passes immediately — no Tier 2 needed. -
[arch],[security]— Deep Logic & Safety (Provisional Pass Only): Becausegemini-decision-1uses zero thinking tokens and has no file-browsing tools, it never gets the final word on architecture, concurrency, or security. It can still fail fast if an implementation is obviously missing, but a>= 0.90score earns a provisional pass (PROVISIONAL_ARCH_PASS) — deferring Tier 2 until everything else is green so you only run one final sign-off instead of re-running Tier 2 on every intermediate loop pass.
Smarter Stall Detection with ratchet_score
One unexpected bonus made the harness loop smarter, not just faster. Every autonomous coding loop needs clear stopping rules so it doesn't spin forever burning tokens. In Part 2, I called my stopping rules the Circuit Breaker Trio: stop when 100% of checks pass, stop after a max budget of 4–5 passes, or stop if the loop stalls for 2 consecutive passes without improving. With plain binary pass/fail counts, that stall detector was clumsy — if a fix genuinely pushed an assertion from 0.25 to 0.82, a binary counter still read 0 passes and threatened a false stall.
With gemini-decision-1, eval_rubric.py computes a continuous ratchet_score — the mean P(yes) across all evaluated assertions (0.25 -> 0.62 -> 0.84 -> 0.96). Now the loop recognises genuine forward momentum while catching silent regressions immediately.
Putting It to the Test: Live PR Experiments
Time for some experiments... I ran my eval_rubric.py against two real merged pull requests from my derailed-dash/gemini-review-action repository (introduced in Automated GitHub Code Reviews Using Google Gemini (Part 2)).
Experiment 1: Tightly Scoped Fix
PR #71 was a focused fix for automated GitHub issue triage: filtering selected labels against the repository's allowlist before calling the GitHub API so the bot can never invent or duplicate labels. It touched just two files (gemini_issue_triage.py and tests/test_issue_triage.py).
I gave eval_rubric.py a compact four-item rubric covering every category:
-
B1 [det]: Unit tests (pytest) pass. -
B2 [mech]:tests/test_issue_triage.pycovers label allowlist filtering and deduplication. -
B3 [arch]: Issue triage deduplicates and filters selected labels againstavailable_labelsbefore calling the GitHub API. -
B4 [docs]: The PR diff updatesAGENTS.mdorREADME.mdto document the allowlist rule.
Then I ran eval_rubric.py against PR #71's diff:
uv run ~/.gemini/config/skills/tiered-rubric-loop/scripts/eval_rubric.py \
--repo-root ./gemini-review-action \
--spec notes/pr71-rubric.md \
--git-range <base>..<head> \
--targets-only
Here is the scorecard returned by gemini-decision-1:
We can see that:
-
B2cleared immediately (0.97PASS) — no Tier 2 subagent needed for test coverage verification. -
B3earnedPROVISIONAL_ARCH_PASS(0.96) — queued cleanly for one final[arch]check. -
B4triggeredFAIL_FAST(0.17,0.83confidence) —gemini-decision-1spotted that PR #71 omitted documentation updates, and rejected it directly in roughly a second without waking Tier 2!
Experiment 2: Stress-Testing a Large 14-File PR
PR #71 was clean and focused — just two files, easily fitting inside the context window. Next, I wanted to stress-test what happens when a PR gets big and messy.
gemini-decision-1 has a hard 256K-token context ceiling shared across the input payload and all questions (plus a 100 MB inline payload cap, 50 MB for PDFs). To stay fast and comfortably inside those limits, eval_rubric.py trims any single file over 48K characters or git diff over 60K characters — and automatically refuses to trust a Tier 1.5 PASS on any assertion touching a trimmed file.
My PR #72 added SVG-to-PNG rasterisation and a streaming fallback for connection resets, touching 14 files across Python modules, large test suites (tests/test_pr_review.py), uv.lock, and a hefty README.md. I ran a six-item rubric (B1–B6) against it to see whether Tier 1.5 would fail safe once those size caps kicked in:
PR #72 exposed the real-world boundaries immediately — and honestly, that is the best validation you could ask for:
-
Strict thresholds hold the line: One architectural check (
B6,0.97) cleared cleanly as a provisional pass, while another (B5,0.89) missed our0.90bar by a single percentage point and escalated straight to Tier 2 instead of guessing. -
Trimmed or skipped files fail safe: Three checks (
B2,B3, andB4) depended on files that were either trimmed by our size caps (README.md, a large test suite, and the14-file diff) or skipped by design (uv.lock). Rather than hallucinating a pass over incomplete evidence, Tier 1.5 automatically escalated all three to Tier 2. -
Still fast and sub-penny at
80Ktokens: Even on a messy14-file PR (80,093input tokens), Tier 1.5 finished in roughly2.1seconds for$0.008with0output tokens.
What Difference Did Tier 1.5 Actually Make?
The contrast with my original two-tier loop is massive!
-
On focused slices like PR #71, Tier 1.5 eliminates wasted critic runs: A two-tier loop would have woken a
10–20second Tier 2 subagent on Pass 1 just to discoverB4(docs) was missing, then woken it again on Pass 2 to re-check everything. With Tier 1.5, Pass 1 failed fast in~1.0second for$0.0024with zero Tier 2 subagents woken,B2passed terminally, andB3deferred as provisional so Tier 2 only needs to run once at the very end. -
On oversized PRs like PR #72, Tier 1.5 fails safe rather than guessing: Spending
~2.1seconds ($0.008), Tier 1.5 clearedB6provisionally and escalatedB2–B5to Tier 2 once truncation caps tripped — proving that the biggest speedup comes when you keep implementation slices small and target files focused. -
Sub-penny screening with zero output tokens: Live runs cost
$0.0024–$0.0080with0output or thinking tokens, keeping my reasoning budget strictly for genuine grey zones and one final[arch]sign-off. -
Smarter stall detection: Continuous
ratchet_scoreprogress stops the Circuit Breaker Trio from false-stalling when an assertion climbs from0.25to0.82, and flags regressions immediately.
Honest Trade-Offs, API Quirks, and Current Limitations
Adding Tier 1.5 is not magic, and treating gemini-decision-1 like a miniature reasoning model will bite you. Keep these gotchas and current preview limits in mind:
-
Know which checks still need step-by-step reasoning: Because
gemini-decision-1answers in a single pass without working through a problem step by step (no thinking tokens), it cannot reliably trace multi-file logic, spot subtle race conditions, or audit auth and injection bugs. Keep those[arch]and[security]checks provisional and always let Tier 2 have the final say. -
Watch a few subtle API quirks: The model never sees your question dictionary keys (so always put the full, self-contained question inside
instructions),noulscores are clamped to0.01–0.99(any threshold above0.99will never match), and safety-filter blocks fail the whole call with HTTP400rather than returning partial answers. -
Platform availability (Developer API only today):
gemini-decision-1currently runs only on the Gemini Developer API (v1beta), with support for Gemini Platform (formerly Vertex AI) coming soon. Until it lands on Google Cloud, it requires an AI StudioGEMINI_API_KEYrather than keyless Workload Identity Federation (WIF) / ADC. -
No Context Caching or Batch API yet (rarely a dealbreaker): Separate from the platform split,
gemini-decision-1itself does not yet support Context Caching, the Batch API, or Flex/Priority inference. That means repeated input across successive loop passes is billed in full — though at$0.10per million input tokens (and with all your rubric questions sharing a single pass), it is rarely a problem in practice, especially if you only attach the files relevant to your assertions. -
Keep each rubric row focused on one clear check: Don't bundle "updates the CLI, adds unit tests, and updates
README.md" into a single yes/no question. With one big "monolithic question", if two parts pass and one fails, the score lands right in the fuzzy grey zone. Split them into three separate, independent rows instead (they all run in the same single API call anyway!) and name the exact target file for each one. -
Match image resolution to the check: For coarse visual or layout checks,
resolution="low"cuts image tokens by4x(266vs1064, as Romin Irani showed in Getting Started with the Gemini Decisions API in Python) with>98%confidence. For readable diagram labels and typical UI screenshots,mediumis usually plenty — and still cuts image tokens by2x.
Packaged as a Portable Skill You Can Download Today
Once proved, I packaged the entire workflow into a portable agent skill called tiered-rubric-loop in my public derailed-dash/dazbo-agent-skills repository. (If you find it useful, please do drop a star ⭐ on the repo — it really helps other builders find it!)
Installing it into Antigravity or any compatible agent harness takes one command:
npx skills add https://github.com/derailed-dash/dazbo-agent-skills --skill tiered-rubric-loop
Once installed (with GEMINI_API_KEY in your environment — and if it is missing, the skill falls back cleanly to Tier 1 → Tier 2), you do not have to run any scripts by hand. Just prompt your agent in plain English:
"Use
tiered-rubric-loopto build this feature. If there isn't a rubric inSPEC.mdyet, draft a rubric checklist with me first, then loop until everything passes."
Or on an existing feature branch before opening a PR:
"Run
tiered-rubric-loopon my branch and fix anything that fails."
Behind the scenes, the skill handles the whole loop automatically: it finds docs/SPEC.md, SPEC.md, LOOPS.md, or RUBRIC.md (including docs/RUBRIC.md and harness/RUBRIC.md — or agrees a lightweight checklist with you inline), runs Tier 1 (make check), calls eval_rubric.py for Tier 1.5 screening, wakes a fresh read-only Tier 2 subagent only for grey zones and final [arch] sign-off, and tracks ratchet_score until the Circuit Breaker Trio stops the loop.
If you ever do want to run Tier 1.5 standalone in a terminal or CI job, eval_rubric.py also works directly from the command line — supporting --targets-only, --base main, --image / --pdf for multimodal checks, and --dry-run --json for offline validation.
Wrapping Up
The gemini-decision-1 model is insanely fast, super cheap and a game-changer for certain scenarios. Here I've wired it into my standard harness rubric.
Adding Tier 1.5 between deterministic Tier 1 and my agentic Tier 2 critic took my existing disciplined loop rubric and made it much faster, much cheaper, and backed by a far stronger continuous ratchet. For less than a penny a pass, gemini-decision-1 clears routine checks on the spot, flags obvious omissions in a second, tracks real ratchet_score progress across every pass, and reserves my reasoning budget strictly for genuine grey zones and architectural judgement.
Give tiered-rubric-loop a spin on your next branch. Your repo will thank you for it!
Before You Go
- Please share 📢 this with anyone that you think will be interested. It might help them, and it really helps me!
- Please drop some reactions ❤️ 🦄 🔥 (you can pick more than one!) and bookmark 🔖 this post!
- Please leave a comment 💬. Interaction is good!
- Add a star ⭐ on my repos!
- Follow 👉 me here on Dev.to, so you don’t miss my content.
References and Useful Links
Gemini Decisions API & Routing Research
- Gemini Decisions API: Fast, calibrated multimodal decisions (Google DeepMind Blog)
- Decisions API Official Documentation & Gemini Decision 1 Model Page
- Gemini API Pricing & Rate Limits
- Getting Started with Gemini Decisions API (Google Codelab)
- Decisions Playground (Google AI Studio)
- Routing models with the Gemini Decisions API by Karl Weinmeister & How LLM routing strategies compare
kweinmeister/gemini-decision-routeron GitHub-
Getting Started with the Gemini Decisions API in Python by Romin Irani &
rominirani/gcp-gemini-decisions-hybrid-gateway
Dazbo's Harness Series & Repositories
derailed-dash/dazbo-agent-skills(tiered-rubric-loopSkill)derailed-dash/gemini-review-action(PR Review & Issue Triage Action)- From Vibing Chaos to Reliable Agents: The What, Why, and How of Harness Engineering (Part 1)
- Loop Engineering in the Harness: Autonomous, Self-Correcting Systems (Part 2)
- Spec-Driven Development For-the-Win: Disposable Code, Living Blueprints, and Building Like a Boss (Part 3)
- Inner Loops in Practice: Fresh Contexts, Output Discipline, and Day-1 Loops (Part 4)
- Automated GitHub Code Reviews Using Google Gemini Update: Enterprise-Ready, Multimodal, and Battle-Hardened (Part 2)










Top comments (0)