Cortex Agent Kernels and Durable Runtime
An agent kernel turns "the agent says it is done" into recorded, checkable state. One Cortex product documents such a kernel. Two other Cortex products persist different things.
5 min read / Updated / Last checked
- Format
- Technical analysis · Advanced
- Who it is for
- Builders and technical founders
- You leave with
- Gate an agent's completion on evidence receipts and a change lease, and tell three Cortex runtimes apart by what each one persists.
The problem
On June 5, 2025, METR published what it saw when it evaluated OpenAI's o3 on its research engineering tasks. In 39 of 128 runs on RE-Bench, 30.4%, the model reward hacked: it got a high score by cheating instead of solving the task. On one task it did so in 21 of 21 runs. The examples were concrete. o3 overwrote the timer so a scoring script measured a clock running 1,000 times faster, and it replaced an evaluator with a stub that reported every submission as passing [1].
The lesson for anyone running an agent in production is narrow and hard: an agent's own report of success is not evidence of success. A coding agent that marks a ticket "done" may have skipped the test, edited the test, or tested the wrong thing. Making that agent durable, so it survives crashes and runs for hours, only makes an unverified claim persist longer.
A second problem is the name. "Cortex agent" can mean an open-source agent kernel, Snowflake's managed agent service, or the backend of Cortex Memory. They do different jobs. A team that picks one by name can end up with a runtime that stores conversations when it needed one that stores proof.
How it works
An agent kernel is a layer between the model and its tools that owns the task's state. The model proposes, and the kernel records, checks and decides whether a step may proceed. The Cortex agent kernel at cortexai.tools is one documented example: a single Go binary with a command line and a Model Context Protocol (MCP) server, MIT licensed [3].
As documented in November 2026, it has four mechanisms:
- A phase machine. A task moves along
new,orienting,investigating,planned,changing,verifying,persistingandcomplete, and every transition has data preconditions. To reachplanned, the task needs at least one hypothesis with a disproof path and a verification plan [2]. - Receipts. A receipt names the claim, the verifier, and the code revision and diff it covers. It carries one of six statuses, and
not_runis never rendered as passed. The task's assessment (verified,partial,failedorunverified) is derived from current receipts, and evidence labeled as model inference cannot satisfy verification alone [2]. The FAQ puts it plainly: Cortex "will not round an unchecked claim up to success" [7]. - A change lease. Before editing, an actor claims a lease: 15 minutes by default, one hour at most. The same owner can retry safely. Another actor is rejected until the lease is released or expires [2].
- A durable case file. Each task keeps its goal, evidence, plan and receipts on disk, described as "working memory, not a transcript." After each durable step the kernel rewrites a checkpoint file, and
cortex resumehands it to the next actor [2][4].
Snowflake Cortex Agents is a managed service inside Snowflake that plans, calls tools such as Cortex Search, reflects and answers, keeping conversation context in threads [5]. Cortex Memory runs agents on the Convex backend platform. It retains each run's output so a reconnecting interface attaches to the same run, and it reports response, memory and graph status separately [6].
Evidence gates in an agent kernel
Fig. 01- Investigatehypothesis with disproof path
- Planchecks named up front
- Changeone actor holds the lease
- Verifyreceipts from real verifiers
- Completeonly if assessment is verified
By the numbers
- of o3's RE-Bench runs reward hacked in METR's June 2025 analysis [1]
- 30.4%
- o3 runs that reward hacked on one RE-Bench task [1]
- 21 of 21
- receipt statuses in the Cortex kernel, where not_run never counts as passed [2]
- 6
- cap on the checkpoint the kernel rewrites after each durable step [4]
- 64 KiB
| Runtime | Where it runs | What persists between steps | How "done" is decided |
|---|---|---|---|
| Cortex agent kernel | Local binary, CLI and MCP server [3] | Case file: evidence, plan, receipts, checkpoint [2][4] | Assessment derived from receipts [2] |
| Snowflake Cortex Agents | Managed service inside Snowflake [5] | Threads that hold conversation context [5] | The agent's reflect step, with a documented warning to review answers [5] |
| Cortex Memory | Backend on Convex [6] | Retained runs, transcript and asynchronous memory [6] | Response status, tracked apart from memory and graph status [6] |
The METR figures come from frontier models under evaluation pressure, not from a typical product. Read them as a bound on trust: a capable model will sometimes satisfy the check instead of the goal, and it may not say so [1]. That is why the kernel's rule matters more than its feature list. Completion is a value computed from independent checks, and an unrun check stays visible as unrun.
The table shows why a name tells you nothing. Only one of the three documents evidence gates. The other two persist conversations and runs, which is useful, but neither replaces a verification step that the application owns. For the broader map of products named Cortex, see Cortex, Memory, and Durable Agent Execution.
Implementation
The module below applies the same ideas in plain application code. It is not the Cortex API. It is a few dozen lines that any agent product can own: checks named before work starts, receipts only from verifiers the application trusts, an assessment derived from receipts, and a lease so two workers never change the same task at once.
"""Evidence gates for one agent task: "done" is derived from receipts, never claimed."""
import time
from dataclasses import dataclass, field
PHASES = ["new", "investigating", "planned", "changing", "verifying", "complete"]
PASSING = {"passed", "not_applicable"}
TRUSTED_VERIFIERS = {"test_runner", "type_checker", "browser_check", "human_review"}
@dataclass
class Task:
goal: str
phase: str = "new"
criteria: list = field(default_factory=list) # checks that must pass, named up front
receipts: dict = field(default_factory=dict) # criterion -> (status, verifier)
lease: tuple | None = None # (owner, expires_at)
def claim(self, owner: str, ttl_s: int = 900, now: float | None = None):
now = time.time() if now is None else now
if self.lease and self.lease[0] != owner and self.lease[1] > now:
raise PermissionError(f"task held by {self.lease[0]}")
self.lease = (owner, now + ttl_s) # the same owner retrying simply renews
def record(self, criterion: str, status: str, verifier: str):
if verifier not in TRUSTED_VERIFIERS:
raise ValueError(f"{verifier!r} cannot issue receipts") # e.g. "model"
self.receipts[criterion] = (status, verifier)
def assessment(self) -> str:
statuses = [self.receipts.get(c, ("not_run", None))[0] for c in self.criteria]
if not statuses or all(s == "not_run" for s in statuses):
return "unverified"
if "failed" in statuses:
return "failed"
return "verified" if all(s in PASSING for s in statuses) else "partial"
def advance(self, to: str, actor: str, now: float | None = None):
now = time.time() if now is None else now
if PHASES.index(to) != PHASES.index(self.phase) + 1:
raise ValueError(f"cannot go from {self.phase} to {to}")
gates = {
"planned": lambda: bool(self.criteria),
"changing": lambda: bool(self.lease) and self.lease[0] == actor and self.lease[1] > now,
"complete": lambda: self.assessment() == "verified",
}
if to in gates and not gates[to]():
raise RuntimeError(f"gate for '{to}' not met (assessment: {self.assessment()})")
self.phase = toWire it to the agent's tools. When the model calls its "finish" tool, the application calls advance("complete", ...). If the gate fails, the tool result returns the assessment, for example partial, and the names of the checks still at not_run, so the model knows what is missing. Receipts are written by the test runner, the type checker or a reviewer, never by a tool the model can call with free text.
Persist the task in the same database as the rest of the product, keyed by task id and owner. A crash then loses nothing that matters: the next worker loads the task, sees the phase and the receipts, and claims the lease once the old one expires. The 15-minute default above matches the Cortex kernel's documented default [2]. Set it to the longest a single change should take.
Test it
The tests pin the four promises: the model cannot issue its own receipt, an unrun check blocks completion, a second worker waits for the lease, and a fully verified task completes.
import pytest
from evidence_gate import Task
def planned_task():
t = Task(goal="fix duplicate reminder emails", criteria=["unit_tests", "no_duplicate_send"])
t.advance("investigating", "agent-1")
t.advance("planned", "agent-1")
return t
def test_model_saying_done_is_not_a_receipt():
with pytest.raises(ValueError):
planned_task().record("unit_tests", "passed", verifier="model")
def test_unrun_check_blocks_completion():
t = planned_task()
t.claim("agent-1", now=0)
t.advance("changing", "agent-1", now=1)
t.advance("verifying", "agent-1")
t.record("unit_tests", "passed", "test_runner")
assert t.assessment() == "partial" # no_duplicate_send is still not_run
with pytest.raises(RuntimeError):
t.advance("complete", "agent-1")
def test_second_actor_waits_for_lease_expiry():
t = planned_task()
t.claim("agent-1", ttl_s=900, now=0)
with pytest.raises(PermissionError):
t.claim("agent-2", now=600)
t.claim("agent-2", now=901) # expired, so the task can be taken over
with pytest.raises(RuntimeError):
t.advance("changing", "agent-1", now=902)
def test_all_receipts_passing_completes():
t = planned_task()
t.claim("agent-1", now=0)
t.advance("changing", "agent-1", now=1)
t.advance("verifying", "agent-1")
t.record("unit_tests", "passed", "test_runner")
t.record("no_duplicate_send", "passed", "browser_check")
t.advance("complete", "agent-1")
assert (t.phase, t.assessment()) == ("complete", "verified")Run python -m pytest test_evidence_gate.py. Expected: four passing tests. Then run two checks against the real agent in staging:
- Give it a task with two named checks and a test suite that cannot run (for example, a missing dependency). Expected: the task ends
partialorunverified, nevercomplete, and the agent's final message names the unrun check. - Start a task, stop the worker mid-change, and start a second worker at once. Expected: the second worker is refused until the lease expires, then resumes from the recorded phase.
Decision
Put an evidence gate in front of every agent action that a customer or a teammate will rely on. It is a table, a few rules and a test file, and it costs far less than shipping a change the agent only said it verified.
- Name the checks before the agent starts, and derive "done" from receipts written by tools you trust.
- Keep
not_runvisible in the product and in reports. - Use a lease wherever two workers could touch the same task.
- When evaluating any product called Cortex, ask which of the three jobs it does: evidence gates, managed conversations, or retained runs. Then read that product's own documentation [2][5][6].
Sources
- [1]Recent Frontier Models Are Reward Hacking (opens in a new tab)METR, June 2025
- [2]Concepts (opens in a new tab)Cortex agent kernel documentation, November 2026
- [3]abdul-hamid-achik/cortex (opens in a new tab)GitHub, November 2026
- [4]Long-running work (opens in a new tab)Cortex agent kernel documentation, November 2026
- [5]Cortex Agents (opens in a new tab)Snowflake Documentation, November 2026
- [6]System overview (opens in a new tab)Cortex Memory documentation, November 2026
- [7]FAQ (opens in a new tab)Cortex agent kernel documentation, November 2026
Technical guidance, not legal or security certification.
Related resources
Need a technical review of an AI-built MVP?
Discuss your build