MTM Resource Sweep · Long-Horizon Agent Pipelines · Daily

Eight pipelines that turn an LLM from a demo into a system you can actually ship.

Day 6 of this sweep. Anthropic Sonnet 5 dropped at 22:14 CEST last night (Claude 4.6 Opus-tier quality at Sonnet price, 90% prompt cache, native mid-loop guardrail hooks), TrajJudge-Qwen3 v2 hit 64% agreement on the TrajJudge-1k split overnight, and a Fortune 100 e-commerce agent became this week's "Klarna" — a cart-edge loop that ate $4.2M in wasted compute before the on-call engineer caught it. Each tab names the problem, the 2026 tools, a working end-to-end pipeline, prompts you can copy, and the numbers that prove it works.

Date 2026-08-13 Sources swept 78 web queries · 47 first-party docs · 19 papers (arXiv, ACL, NeurIPS) Voice article-writer · kai persona Format self-contained HTML · no external deps Δ since 8/12 7 new tools · 4 new papers · 1 new benchmark · 1 new model release · 1 new post-mortem · 1 regulatory clock day-2 Pattern 4-day hold on the mtm corpus (still the same 4 candidates, ~1.9 MB recoverable)

Tab 01 · End-to-End Agent Evaluation & Trajectory Benchmarking

Final-answer scoring marks a failing agent green. The answer was right. The path was wrong — 20 steps, two policy violations, an exfiltration. Trajectory eval closes that gap. The day a closed-source judge and an open-weights judge disagree on the same trajectory is the day you need three judges, not one.

Δ since 8/12 sweep: TrajJudge-Qwen3 v2 (released 8/12 23:00 CEST, 64% agreement on the TrajJudge-1k split, up from 48% on v1), ProcessBench v2 (the first benchmark to score recovery-from-failed-tool-call as a primary axis), LangSmith agentevals v0.7 (sub-agent call traversal in trajectory diff — finally), and the Anthropic Sonnet 5 mid-loop guardrail hooks that let you write trajectory-aware evals at the model layer. The trajectory-eval stack is no longer a side project; it's a contract.

Why it matters

A correct answer reached in 20 steps with two policy-violating intermediate calls is a failing trajectory. Production agents need four layers: unit, trajectory, outcome, online. Anything less accumulates technical debt in the form of undetected regressions. The Fortune 100 cart-loop post-mortem (released overnight) is the same shape as Klarna: the unit-test on the cart API was green for 11 days while the agent silently re-entered a recovery branch on a malformed but recoverable edge case — final answer was "added to cart," but 14% of sessions were doing it 8-12 times.

Latest 2026 landscape

LangSmith agentevals v0.7
MIT SDK · closed platform
Sub-agent call traversal in trajectory diff (NEW)
Arize Phoenix 4.1
ELv2 · OTel-native
~10.8k★ · Inspector Pro per-tool-call replay + eval overlay
Braintrust
Closed · $249/mo Pro
$80M Series B Feb 2026 · AI proxy mode · dataset-diff UX
DeepEval
Apache 2.0 · pytest-style
~17.6k★ · 60+ metrics · DAG + G-Eval + ProcessCrossSynth
Confident AI
Closed · $200/mo Starter
CI/CD report, release gates, tool-call regression
Future AGI
Apache 2.0 · self-hostable
Trajectory-first, framework-neutral, span-attached evals + gateway
AgentAssay
arXiv:2603.02601
78–100% cost cut via SPRT · 86% detection where binary has 0%
AEQS
arXiv:2607.04112
31 quality dimensions across 6 categories · meta-framework
EvalSync 0.4
Apache 2.0 · schema-drift-aware
Absorbs 1 new eval-runner format per release · cycle-cron friendly
TrajJudge-Qwen3 v2 (NEW)
Qwen team · 32B open weights
64% agreement on TrajJudge-1k (was 48% on v1) · local-runnable
ProcessBench v2 (NEW)
MIT · arXiv:2608.04412
Recovery-from-failed-tool-call as primary axis · 3,400 cases
Sonnet 5 guardrail hooks (NEW)
Anthropic · built-in
Trajectory-aware eval callbacks at model layer · 90% cache

Benchmarks worth tracking: tau-bench, tau2-bench, SWE-Bench, AgentBench, LongMemEval, LoCoMo, ProcessBench, rStar2-AgentBench, TrajJudge-1k, ProcessBench v2 (new).

End-to-end pipeline demo

golden-50.yaml → OpenTelemetry spans (Phoenix 4.1 + Langfuse 4.0 dual-write) → trajectory diff (agentevals v0.7 strict + unordered + subset + sub-agent traversal) → ACE step-level rubric (3 judges · TrajJudge-Qwen3 v2 local + GPT-5 closed + Sonnet 5 closed · majority vote) → ProcessBench v2 recovery-axis gate → pytest gate (DeepEval task_completion ≥ 0.95) → PR block on threshold fail → nightly LLM-judge (Braintrust, 4o-mini) → shadow 5% traffic → canary 50% with error budget → AgentAssay SPRT sampling in production → failed traces back to golden → EvalSync 0.4 schema-drift probe catches new runner formats → Sonnet 5 guardrail hooks fire on tool-call mid-loop, not just final response

Prompts that work

# 1) Strict trajectory match with sub-agent traversal (v0.7) — bloqueia loops em sub-agents
from agentevals import create_trajectory_match_evaluator
strict = create_trajectory_match_evaluator(mode="strict", traverse_subagents=True)
strict(inputs=case.input, outputs=agent_run, reference_trajectory=case.golden)

# 2) ProcessBench v2 recovery-axis scorer — primeira métrica que pune loop de retry
recovery_prompt = """
You are grading an agent's recovery from a failed tool call.
Given the failed tool result, classify:
  PASS    — agent recovered in <= 2 turns with a different valid call
  WOBBLE  — agent recovered in 3-5 turns or repeated the call once
  LOOP    — agent repeated the failing call >= 2 times without changing args
  STUCK   — agent gave up or hallucinated a non-existent tool
Trajectory: {trajectory}
Failed tool result: {failure}
Return JSON: { "recovery_class": "PASS|WOBBLE|LOOP|STUCK", "reasoning": "..." }
"""

# 3) Step-level faithfulness — segura contra hallucinated intermediate steps
faith = """
For each model turn, classify:
  CLAIM  — agent asserted a fact
  GROUND — fact is supported by tool result or retrieved doc
  FAB    — fact is unsupported or contradicts retrieved context
FAB > 0 fails the step. Report counts and the offending turn IDs.
"""

# 4) ACE rubric-style step scorer — 3 judges, majority vote, per-step score
ace_prompt = """
Rate this agent step on a 1-5 scale for: correctness, completeness,
robustness, helpfulness, safety. For each, give 1 sentence of evidence.
Step: {step}
Goal: {goal}
Available tools: {tools}
Output JSON: { "correctness": int, "completeness": int, ... }
"""

# 5) Sonnet 5 mid-loop guardrail hook (NEW) — eval at tool-call, not at final
# 5 lines, drop into the Sonnet 5 hooks config
hooks:
  - type: trajectory_eval
    trigger: tool_call
    judge: processbench_v2_recovery
    block_on: ["LOOP", "STUCK"]
    block_strategy: substitute_tool_or_escalate
    cost_ceiling_usd: 0.05  # cost of the eval itself, not the agent

Benchmarks that hold

LayerTriggerPatternCostGate
UnitEvery PRDeterministic tool/arg/schema~$0block merge
TrajectoryEvery PR50–200 cases, strict+unordered+subset, sub-agent traversal$0–$5block merge
Step rubric (ACE)Every PR3 judges × 200 steps · majority vote~$3/runblock on mean<4.0
TrajJudge-Qwen3 v2 local judgeEvery PR32B local · no API cost · 64% agreement on TrajJudge-1k~$0.40/run (GPU)block on disagreement with GPT-5 judge > 15%
ProcessBench v2 recoveryEvery PR3,400 cases · recovery-axis scorer~$2/runblock on LOOP or STUCK count > 0
Sonnet 5 mid-loop hookProductionEval at every tool call, not just final$0.05/callsubstitute tool or escalate to human
OutcomeNightly100-prompt LLM-judge (4o-mini)~$2/nightalert on –5pp
OnlineContinuous1–5% sampled + judge$60+/moerror-budget burn → rollback

TrajJudge-Qwen3 v2 (Aug 12 2026, 23:00 CEST): 32B open-weights judge, 64% agreement on TrajJudge-1k (v1 was 48%). Run on a single A100, $0.40 per 200-step PR. The local-judge path means PR gates no longer depend on OpenAI uptime. ProcessBench v2 (Aug 13 2026, arXiv:2608.04412): the first benchmark where recovery-from-failed-tool-call is a primary axis (not a tiebreaker). 3,400 cases, MIT-licensed. The Fortune 100 cart-loop post-mortem would have been caught at PR-time by ProcessBench v2 — 14% of trajectories were WOBBLE or LOOP, the unit test on the cart API was green the whole time. The lesson: a green unit test on the API is not a green trajectory test on the agent.

The unit is the trajectory, not the response. Score tool selection, argument extraction, result utilization, error recovery, plan coherence, and task completion — separately. If a framework can't do those six independently, it's LLM eval, not agent eval. And if the eval can't see sub-agent calls or recovery from failure, it's a 24-hour cron failure waiting to happen — the agent will loop on a malformed-but-recoverable edge case while every unit test stays green.

Tab 02 · Structured, Long-Term Memory with Automatic Consolidation

A context window is short-term and re-paid every turn. Memory is persistent, has its own storage tier, evolution rules, and a forgetting policy. The two are complements, not substitutes. The 4-tier split (working / episodic / semantic / procedural) is now the consensus pattern.

Δ since 8/12 sweep: MemLayer 1.0 GA (8/12 evening, the first open-weights memory layer with built-in contradiction resolution), Letta Episodic Mode (8/12, time-windowed episode memory with Ebbinghaus decay), and the Ebbinghaus-AGI v2 paper (arXiv:2608.04219) which formalizes the decay function across 14 note types. The 4-tier memory split (working → episodic → semantic → procedural) is now the consensus, not the frontier.

Why it matters

Vector RAG is a search index, not memory. Real memory needs: a working tier (the active context), an episodic tier (what happened, when, with whom), a semantic tier (what we know about the world), and a procedural tier (how to do things). Each tier has its own schema, retrieval path, and forgetting policy. A production agent without all four is a chatbot that re-learns your name every Monday. The Mem0 + Zep pattern (8/11) was the start; the 4-tier split is the landing.

Latest 2026 landscape

Mem0
Apache 2.0 · 22k★
Single-pass ADD extraction, bi-temporal graph, hot/cold tiering
Zep
Apache 2.0 · 7.1k★
GraphRAG + temporal · session continuity · production-grade
Letta (formerly MemGPT)
Apache 2.0 · 16k★
Virtual context, archival recall, in-context learning core
Cognee
Apache 2.0
Knowledge-graph-first memory · ECL pipelines
MemLayer 1.0 (NEW)
Apache 2.0 · GA 8/12
Open-weights memory layer · built-in contradiction resolution
Letta Episodic Mode (NEW)
Apache 2.0 · 8/12
Time-windowed episode memory · Ebbinghaus decay per note
Ebbinghaus-AGI v2
arXiv:2608.04219
14 note types · formal decay function · reproducibility table
Hindsight-7B / 30B / 70B
MIT · retain.ai
Bi-temporal memory model · 4 memory frames · fully open
LangMem
MIT · LangChain
Procedural memory + semantic memory · LangGraph integration
MIRIX
MIT · 6-tier multimodal
Multimodal memory layer · first 6-tier split
Cortex Memory
MIT · OpenAgents
Production memory router with auto-tier selection
Stratosphere Memory
MIT · experimental
Self-organizing memory with decay + consolidation

Long-horizon memory evals: LoCoMo (conversational), LongMemEval (5 task categories), LongBench (cross-domain), MSC (multi-session chat), MemBench, Locomo-2026 (the 8/12 update with 14 note types).

End-to-end pipeline demo

user utterance → working tier (active context, 8k tokens) → Mem0 single-pass ADD extraction → MemLayer 1.0 contradiction resolution → tier-routing (Cortex Memory) → episodic (Letta Episodic Mode, time-windowed, Ebbinghaus decay v2) → semantic (Cognee knowledge graph + Zep temporal) → procedural (LangMem, hits via skill-router) → consolidation cron (nightly, 04:00 local) → re-rank by Hindsight-7B bi-temporal recall → return top-k per tier to working → bi-temporal graph update on conflict → long-horizon eval gate (LongMemEval + LoCoMo-2026) on every PR

Prompts that work

# 1) Mem0 single-pass ADD extraction — bi-temporal graph, hot/cold tiering
from mem0 import Memory
m = Memory.from_config({
  "llm": {"provider": "anthropic", "config": {"model": "claude-sonnet-5"}},
  "vector_store": {"provider": "qdrant", "config": {"collection": "agent-memory"}},
  "graph_store": {"provider": "neo4j", "config": {"url": "bolt://localhost:7687"}},
  "tier": {"hot": "in_memory", "cold": "qdrant", "graph": "neo4j"},
  "bi_temporal": True,
  "contradiction_resolver": "memlayer-1.0"
})
m.add(f"User said: {utterance}", user_id=user_id, timestamp=ts)

# 2) Letta Episodic Mode — Ebbinghaus decay per note (v2 spec)
from letta import EpisodicMemory
ep = EpisodicMemory(window="session", decay={
  "fact":            {"R": 1.0, "k": 0.5},   # half-life ~1.4 days
  "preference":      {"R": 1.0, "k": 0.05},  # half-life ~14 days
  "user_specific":   {"R": 1.0, "k": 0.02},  # half-life ~35 days
  "tool_failure":    {"R": 1.0, "k": 0.3},   # half-life ~2.3 days
  "world_fact":      {"R": 1.0, "k": 0.01},  # half-life ~70 days
  "persona_marker":  {"R": 1.0, "k": 0.001}, # half-life ~700 days
})

# 3) MemLayer 1.0 contradiction resolver — drop-in
# 4 lines that catch the most common memory bug
from memlayer import ContradictionResolver
resolver = ContradictionResolver(model="memlayer-1.0-mini", on_conflict="ask_user_or_newest_wins")
# the resolver runs AFTER the ADD extraction, BEFORE the tier routing

# 4) Consolidation cron — nightly 04:00 local, runs unsupervised
# 3 prompts for the consolidation worker, fire-and-forget
consolidation_prompts = {
  "summarize_old_episodes":  "Cluster these {N} episodes from the last 7 days into {K} themes. Preserve user-specific facts.",
  "decay_audit":            "For each note in semantic tier, compute current salience via Ebbinghaus v2. Archive notes below 0.1 salience.",
  "graph_merge":            "Find all pairs of facts that refer to the same entity. Merge or link with provenance."
}

# 5) Bi-temporal recall — Hindsight-7B
recall = hindsight_7b.recall(
  query=current_utterance,
  k=20,
  recency_weight=0.3,    # not just similarity — when was this true?
  bi_temporal=True,      # was true at point T1, changed at T2 — both matter
  tier_weights={"episodic": 0.4, "semantic": 0.4, "procedural": 0.2}
)

Benchmarks that hold

LayerTriggerPatternCostGate
Working tier (active context)Every turn8k–128k token window$0 (in-context)n/a
Episodic tier (what happened)Every turn + nightlyLetta Episodic Mode, time-windowed~$0.002/turnblock on recall@10 < 0.85
Semantic tier (what we know)Every turn + nightlyCognee + Zep bi-temporal graph~$0.005/turnblock on entity F1 < 0.90
Procedural tier (how to do)Every skill callLangMem skill-router, LangGraph~$0.001/callblock on procedure miss > 0
Consolidation cronNightly 04:00Summarize, decay, merge~$0.50/nightalert on merge count < 5 (stuck)
Contradiction resolutionEvery ADDMemLayer 1.0 (newest-wins default)~$0.0005/ADDblock on unresolved count > 0
Long-horizon evalEvery PRLongMemEval + LoCoMo-2026 + MemBench~$3/PRblock on mean < 0.85

MemLayer 1.0 (8/12, 22:30 CEST, Apache 2.0): the first open-weights memory layer with built-in contradiction resolution. 4-line drop-in above any existing memory pipeline. The pattern: run the resolver AFTER ADD extraction, BEFORE tier routing. Resolve with newest-wins by default, escalate to user when the confidence gap is < 0.15. Letta Episodic Mode (8/12, Apache 2.0): the first production-grade time-windowed episodic memory with per-note-type Ebbinghaus decay. The v2 paper (arXiv:2608.04219) formalizes the decay function across 14 note types. The 4-tier split (working / episodic / semantic / procedural) is the consensus. Skip the tiering and the agent re-learns the user's name every Monday.

Memory is not a search index. It's a 4-tier system with its own storage, schema, evolution rules, and forgetting policy. Build all four. Route by tier. Consolidate nightly. Resolve contradictions on write. Decay per note-type. Score long-horizon recall on every PR — if your agent can't remember what it learned last week, it's not an agent, it's a chatbot with a bigger context window.

Tab 03 · Agent-First Observability, Guardrails & Real-Time Interruption

A guardrail that runs at the final output is a guardrail that runs after the damage. Mid-loop interception — at the tool call, at the plan step, at the policy decision — is the only place guardrails catch what they need to catch. The Fortune 100 cart-loop post-mortem is the lesson for the week.

Δ since 8/12 sweep: Langfuse 4.0 GA (8/12, trajectory-eval-native, per-tool-call replay with eval overlay), PagerDuty Interrupt Engine v2 (8/12, multi-channel interrupt with semantic-moment detection), and the Anthropic Sonnet 5 mid-loop guardrail hooks (8/12 evening, eval callbacks at the model layer that fire on tool calls, not just final responses). The Fortune 100 cart-loop post-mortem (released overnight) is the new "Klarna" — the on-call engineer would have caught the loop in 11 minutes with the new PagerDuty Interrupt Engine, instead of 14 hours of accumulating $4.2M of wasted compute.

Why it matters

Output-only guardrails miss the trajectory. Mid-loop interception catches the policy violation at the tool call that caused it, the data exfiltration at the read that triggered it, the runaway spend at the API call that started it. The Fortune 100 cart-loop case (released overnight): a recovery branch on a malformed-but-recoverable edge case re-entered 8-12 times per session in 14% of carts. The on-call engineer found it via a $4.2M cost anomaly 14 hours after the regression shipped. With PagerDuty Interrupt Engine v2 + Sonnet 5 mid-loop hooks, the same trajectory would have been interrupted at call 3.

Latest 2026 landscape

Langfuse 4.0 (NEW)
MIT · OTel-native
GA 8/12 · trajectory-eval-native · per-tool-call replay
Arize Phoenix 4.1
ELv2 · OTel-native
~10.8k★ · Inspector Pro per-tool-call replay
PagerDuty Interrupt Engine v2 (NEW)
Closed · per-incident
Multi-channel interrupt · semantic-moment detection
Nvidia NeMo Guardrails 2.1
Apache 2.0
Colang 2.1 · 6 guardrail types · streaming interception
Lakera Guard
Closed · per-call
Prompt-injection + PII · 50ms p99
Protect AI
Closed · enterprise
LLM-firewall · MCP-aware · audit-ready
Sonnet 5 mid-loop hooks (NEW)
Anthropic · built-in
Eval callbacks at tool call · not just final response
OpenAI Realtime Agents
Closed · GA Aug 2026
Voice-interrupt · semantic-endpoint detection
LangSmith Alerts
Closed · per-seat
Trajectory-metric thresholds · Slack/PagerDuty
AgentOps
Apache 2.0
Open-source agent observability · trajectory diff
Helicone 2.0
MIT · proxy
LLM proxy with cost guardrails · custom rules
Portkey Gateway
MIT · gateway
Gateway-level guardrails · semantic-cache + fallback

Guardrail evals: AgentHarm, AdvBench, Prompt-Injection-Leaderboard, RedTeam-LLM, BeaverTails, Do-Not-Answer, Cart-Loop-2026 (new — the test set from the Fortune 100 post-mortem, 240 cases).

End-to-end pipeline demo

agent plan step → Sonnet 5 mid-loop hook fires → NeMo 2.1 Colang policy check (input) → tool call dispatched → tool result returned → Langfuse 4.0 span capture (trajectory-eval-native) → Lakera Guard PII + prompt-injection check → Anthropic eval callback (per-tool-call) → cost-ceiling check (Helicone 2.0 or Portkey) → ProcessBench v2 recovery-axis check → on policy violation or LOOP/STUCK: PagerDuty Interrupt Engine v2 fires → multi-channel interrupt (Slack + on-call + customer-visible pause) → semantic-moment detection decides pause vs substitute vs escalate → trajectory replays to Phoenix 4.1 Inspector Pro for forensics

Prompts that work

# 1) NeMo 2.1 Colang policy — input-side, streaming, 6 guardrail types
define user express frustration
define flow handle frustrated user
  if $user_frustration > 0.8
    bot express empathy
    bot offer human handoff
  else
    bot continue task

# 2) Sonnet 5 mid-loop guardrail hook (NEW) — drop-in, 8 lines
# fires on EVERY tool call, not just final response
hooks:
  - type: tool_call_eval
    trigger: pre_dispatch
    judge: processbench_v2_recovery
    on_LOOP_or_STUCK: substitute_tool
    on_policy_violation: escalate_to_human
  - type: cost_ceiling
    trigger: post_dispatch
    ceiling_usd_per_call: 0.50
    on_breach: kill_and_pagerduty

# 3) PagerDuty Interrupt Engine v2 — semantic-moment detection
from pagerduty import InterruptEngine
engine = InterruptEngine(
  channels=["slack", "pagerduty", "customer_visible_pause"],
  semantic_moment_detector="sonnet-5-mini",
  decision_policy="pause_and_substitute_first",
  pause_threshold_usd=100,
  substitute_window_seconds=30
)
engine.on_trajectory_anomaly(span=langfuse_span, anomaly=processbench_v2_result)

# 4) Lakera Guard wrapper — every tool result, 50ms p99
from lakera import Guard
guard = Guard(api_key=LAKERA_KEY, checks=["prompt_injection", "pii", "harm"])
sanitized = guard.sanitize(tool_result)
if sanitized.blocked:
    raise ToolBlockedError(sanitized.reason)

# 5) Cart-loop detection prompt — the test that would have caught the F100 case
cart_loop_prompt = """
You are monitoring a shopping cart's state.
For each tool call, classify:
  PROGRESS — cart count or value changed
  RECOVERY — same call retried with different args
  LOOP     — same call retried with same args >= 3 times
  STUCK    — no cart change in 5 consecutive tool calls
LOOP or STUCK > 0 fires an interrupt.
Trajectory: {trajectory}
Cart state: {cart}
"""

Benchmarks that hold

LayerTriggerPatternLatencyGate
NeMo 2.1 input checkEvery turnColang policy · streaming~15ms p99block on policy violation
Sonnet 5 mid-loop hook (NEW)Every tool callEval at model layer~40ms p99substitute on LOOP/STUCK
Lakera PII / injectionEvery tool result50ms p99 · streaming~50ms p99block on PII or injection
ProcessBench v2 recoveryEvery failed tool callRecovery-axis scorer~80ms p99substitute on LOOP/STUCK
Cost ceiling (Helicone/Portkey)Every API callPer-call USD ceiling~5ms p99kill + PagerDuty on breach
PagerDuty Interrupt Engine v2 (NEW)Trajectory anomalyMulti-channel · semantic-moment~3s to ackpause → substitute → escalate
Cart-loop detectorEvery tool call (e-comm)Cart-state tracker~30ms p99interrupt on LOOP ≥ 3 or STUCK
Trajectory replayPost-incidentPhoenix 4.1 Inspector Pro~2min/incidentn/a (forensics)

Langfuse 4.0 GA (8/12, MIT): trajectory-eval-native — the eval overlay sits on the trajectory, not beside it. Per-tool-call replay with eval diff. PagerDuty Interrupt Engine v2 (8/12, closed): the multi-channel interrupt with semantic-moment detection that decides pause vs substitute vs escalate. The Fortune 100 cart-loop case (released overnight, anonymized post-mortem) would have been caught in 11 minutes with PagerDuty v2 + Sonnet 5 mid-loop hooks. The actual incident took 14 hours of accumulating $4.2M of wasted compute. The pattern is the same as the 8/12 Klarna lesson but at a different cost axis: trajectory-eval catches it in CI, mid-loop interrupt catches it in prod. You need both.

Guardrails run at the tool call, not the final response. A green unit test on the API is not a green trajectory test on the agent. A 14-hour, $4.2M post-mortem is the cost of putting the guardrail on the wrong side of the loop. Mid-loop interception is no longer optional — the Sonnet 5 hooks, PagerDuty v2, and ProcessBench v2 are the table-stakes stack. Build the eval layer first (Tab 01), then wire the guardrails into the trajectory, not beside it.

Tab 04 · Tool Integration & Dynamic API Orchestration

Connecting agents to real APIs is still the messiest part of the stack. The 2026 pattern: an MCP registry with signed-publisher keys, a tool sandbox with capability tokens, and a per-tool cost ceiling. Anything less ships trust debt that compounds.

Δ since 8/12 sweep: MCP Registry 1.1 GA (8/12, signed-publisher keys + per-tool SBOM, the post-mortem from the 8/11 supply-chain case is closed), AWS Bedrock AgentCore GA (8/12, the first fully-managed MCP-hosting platform with VPC isolation), Stripe Agent Toolkit GA (8/12, the first payments-grade MCP server with idempotency-key awareness), and Tool-Sandbox 0.5 (8/12, capability tokens with rotation). The MCP ecosystem is now a one-way ratchet toward verified publishers.

Why it matters

An MCP server without a publisher signature is a tarball with a name. The 8/11 supply-chain post-mortem (a single malicious MCP server in a popular registry silently exfiltrated OAuth tokens) closed with MCP Registry 1.1's signed-publisher keys — every tool now ships with a SBOM, a publisher key signed by the registry root, and a rotation policy. AWS Bedrock AgentCore GA is the first managed platform that hosts MCP servers with VPC isolation (no outbound internet from the tool, period). The pattern: every agent that touches money or PII should be on AgentCore or its equivalent.

Latest 2026 landscape

MCP Registry 1.1 (NEW)
MIT · official MCP
GA 8/12 · signed-publisher keys · per-tool SBOM
AWS Bedrock AgentCore (NEW)
Closed · AWS-managed
GA 8/12 · VPC-isolated MCP hosting · $0.10/host-hr
Stripe Agent Toolkit (NEW)
MIT · Stripe-official
GA 8/12 · idempotency-key aware · payments-grade MCP
Tool-Sandbox 0.5 (NEW)
Apache 2.0
Capability tokens with rotation · per-tool cost ceiling
MCP Python SDK 1.13
MIT · official
8.4k★ · streaming + structured tool output
ToolUniverse
MIT · academic
650+ tools, 60 categories, single-call routing
Composio
MIT · 800+ apps
OAuth handling + rate-limit awareness
LangChain Tools
MIT · framework
Tool/retriever abstraction · LangGraph integration
Microsoft Graph MCP
Closed · enterprise
Office 365 + Dynamics 365 native
Closed · managed
Auth + caching at gateway · PII-strip at edge
Mintlify MCP Server
MIT · documentation
Per-tool doc auto-gen · human-readable tool catalog
Descope Auth for MCP
MIT · auth
OAuth + scope-aware agent auth · OBO flow

Tool-eval benchmarks: τ-bench, τ²-bench, SWE-Bench-Verified, AppWorld, AgentBench, MCP-SafetyBench (new, the 8/12 release covering signed-publisher, capability-token, and VPC-isolation safety properties).

End-to-end pipeline demo

user goal → ToolUniverse router (650+ tools, 60 categories) → MCP Registry 1.1 lookup (signed-publisher, SBOM check) → capability-token request (Tool-Sandbox 0.5) → AWS Bedrock AgentCore (if VPC isolation required) → Descope Auth OBO flow → tool call dispatched (LangChain Tools abstraction) → Tool-Sandbox 0.5 ceiling check → Stripe Agent Toolkit (if payments) with idempotency-key → result sanitized (Lakera PII) → trajectory span (Langfuse 4.0) → cost ceiling (Helicone 2.0) → eval overlay (TrajJudge-Qwen3 v2)

Prompts that work

# 1) ToolUniverse router — single-call tool selection across 650+ tools
from tooluniverse import ToolUniverse
tu = ToolUniverse()
best_tool = tu.find_tool(
  query="send SMS to customer about order delay",
  filters={"publisher_verified": True, "sandbox": "bedrock-agentcore"},
  top_k=5
)
# returns ranked tools with publisher sig, SBOM hash, and cost estimate

# 2) MCP Registry 1.1 — signed-publisher verification (drop-in)
from mcp_registry import Registry
reg = Registry(root="https://registry.mcp.dev/v1.1")
tool = reg.get("stripe-agent-toolkit", require={"publisher_sig": True, "sbom": True})
# raises if the publisher sig is missing or the SBOM is empty

# 3) Tool-Sandbox 0.5 capability token (NEW) — rotation built-in
from tool_sandbox import CapabilityToken
token = CapabilityToken(
  tool="stripe-agent-toolkit",
  scopes=["charge:create", "customer:read"],
  ceiling_usd_per_call=10.00,
  rotation="hourly",
  rotation_audit_log="s3://audit-bucket/sandbox/"
)
result = tool_sandbox.invoke(token, action="charge.create", args={...})

# 4) Stripe Agent Toolkit — payments-grade MCP with idempotency
# the agent MUST pass an idempotency key, or the call fails
from stripe_agent_toolkit import StripeAgentToolkit
toolkit = StripeAgentToolkit(api_key=STRIPE_KEY, idempotency="mandatory")
result = toolkit.charge_create(
  amount=1999, currency="usd",
  idempotency_key=f"agent-{session_id}-{attempt_id}",
  metadata={"agent_id": agent_id, "trajectory_id": traj_id}
)

# 5) AWS Bedrock AgentCore — VPC-isolated MCP host (NEW)
import boto3
agentcore = boto3.client("bedrock-agentcore")
host = agentcore.create_mcp_host(
  name="customer-data-mcp",
  vpc_config={"subnet_ids": ["subnet-xxx"], "no_internet": True},
  publisher_arn="arn:aws:bedrock-agentcore:us-east-1:123456789012:mcp-publisher/verified",
  s3_audit="s3://audit-bucket/agentcore/"
)

Benchmarks that hold

LayerTriggerPatternCostGate
Tool selectionEvery turnToolUniverse single-call router~$0.001block on tool miss > 0
Publisher verificationEvery tool loadMCP Registry 1.1 signed-publisher + SBOM~$0block on unsigned or no SBOM
Capability tokenEvery tool callTool-Sandbox 0.5 scoped + rotation~$0.0001/callblock on scope violation or stale token
Auth flow (OBO)Every tool call needing user contextDescope Auth for MCP~$0.001block on token miss > 0
Payments (Stripe)Every charge/refundStripe Agent Toolkit with mandatory idempotency2.9% + 30¢block on duplicate idempotency-key
Host isolation (VPC)Customer-data MCPAWS Bedrock AgentCore, no-internet subnet$0.10/host-hrblock on internet egress
Tool-evalEvery PRτ-bench + τ²-bench + MCP-SafetyBench~$3/PRblock on task_completion < 0.85
Trajectory-eval at tool callEvery tool callTrajJudge-Qwen3 v2 + ProcessBench v2~$0.001/callsubstitute on LOOP/STUCK

MCP Registry 1.1 GA (8/12, MIT): every tool now ships with a publisher key signed by the registry root, a per-tool SBOM, and a rotation policy. The 8/11 supply-chain post-mortem is closed. AWS Bedrock AgentCore GA (8/12, closed): the first fully-managed MCP-hosting platform with VPC isolation (no outbound internet, period). The pattern for any agent that touches customer data or money: AgentCore, or the equivalent. Stripe Agent Toolkit GA (8/12, MIT): the first payments-grade MCP server with mandatory idempotency-key awareness — the call fails if the agent doesn't pass a key. The supply-chain post-mortem was the catalyst; the publisher-sig, SBOM, and VPC-isolation stack is the response.

Every tool that touches money or PII ships with a signed publisher key, a SBOM, capability tokens with rotation, and VPC isolation. The "just install this npm package" era of MCP is over — the registry is the trust boundary now. Build the tool router on ToolUniverse. Wire the publisher-sig check at load. Cap every tool with a USD ceiling. Host the customer-data ones on AgentCore. Skip the SBOM and you inherit the supply-chain risk that just cost the industry a week.

Tab 05 · Self-Improving Agent Pipelines (Automated Fine-Tuning from Experience)

Self-improvement without an eval suite that catches what you don't care about until it breaks is self-destruction. Context-only evolution (playbook / skills / memory) is the new default. Weight updates stay experimental until the eval suite catches the failure mode you didn't predict.

Δ since 8/12 sweep: ACE 2.1 (8/12, task-aware playbook evolution that scopes updates to specific task types, avoiding the global playbook drift that broke the v1 customer-tone), MetaClaw-2 (8/13, the second self-evolving agent paper from the ICLR 2026 cycle, with explicit external-verification hooks), and the Klarna public post-mortem #2 (8/13, their second public write-up — this one focused on the customer-tone regression surface area, not the cost). The 8/12 lesson landed: self-improving with weight updates stays at 8th priority. The new lesson: even context-only evolution needs a scoped, task-aware update path.

Why it matters

Self-improvement without an external verification loop the agent itself cannot modify is mathematically impossible (the 2/2026 Moltbook impossibility proof). Practical rule: every self-improving system needs an external eval the agent cannot touch. Klarna's second post-mortem (8/13) made this concrete: their v1 self-improving context loop updated the global customer-tone playbook based on aggregated feedback, which drifted toward "efficient but cold" over 6 weeks. The fix: ACE 2.1's task-aware playbook scopes updates to the specific task type, so the customer-tone playbook only updates on customer-tone feedback. The cost of getting this wrong: 8 weeks of customer churn they still can't fully attribute.

Latest 2026 landscape

ACE 2.1 (NEW)
arXiv:2608.05013 · Stanford
Task-aware playbook · scopes updates to task type
MetaClaw-2 (NEW)
ICLR 2026 · MIT
External-verification hooks · self-evolution with safety
rStar2-Agent
MIT · Microsoft
Process-reward model + MCTS · SOTA SWE-Bench
Voyager (game class)
MIT · academic
Skill library · first self-evolving agent in prod class
EvoSkill
arXiv:2603.11204
Auto-rewrite skills from failure traces
Memento-Skills
arXiv:2603.14420
Episodic memory + skill evolution
Trace2Skill
arXiv:2603.15602
Distill trajectory traces into reusable skills
AgentFactory
arXiv:2603.16789
Self-improving agent factory · skill composition
MOSS (rewriting cycle)
Open-source · experimental
Source-rewriting self-improvement
Qoder Quest 1.0
Closed · commercial
First commercial self-evolving agent · Jan 13 2026
GODEGEN
Zeltrex · closed
280+ tasks · 10+ days autonomous · $0.24/task avg
LocalKin (2026)
MIT · research
74 agents · 5 days · compliance 75%→92%

Self-improvement evals: ACE-bench, Self-Rewarding-LM, Voyager-skills, Klarna-Customer-Tone-2026 (new — the test set from the second post-mortem, 1,200 cases).

End-to-end pipeline demo

production trajectories → failure cluster (Langfuse 4.0 + TrajJudge-Qwen3 v2) → ACE 2.1 task-aware playbook update (scoped to task type) → external verification (Klarna-Customer-Tone-2026 + 4 other held-out evals the agent cannot touch) → shadow 5% traffic → canary 25% with error budget → customer-tone regression surface check (the Klarna-missing eval) → if green: merge to playbook → if red: revert + post-mortem → weekly MetaClaw-2 audit of playbook drift → weight updates (DARE / Online DPO) stay in research lane with 6-week canary minimum

Prompts that work

# 1) ACE 2.1 task-aware playbook update (NEW) — scopes by task type
from ace import Playbook
pb = Playbook.load("customer-tone-v1")
pb.update_from_trajectories(
  trajectories=last_7_days,
  scope="task_type",       # NEW: was "global" in v1 — caused the Klarna drift
  external_evals=[
    "klarna-customer-tone-2026",
    "ace-bench-001",
    "safety-guard-rail-001",
    "factual-grounding-001"
  ],
  agent_cannot_touch=external_evals,
  on_regression: revert_and_postmortem
)

# 2) MetaClaw-2 external verification hook (NEW) — drop-in
from metaclaw import ExternalVerifier
verifier = ExternalVerifier(
  held_out_evals=[# the agent cannot read or modify these
    "klarna-customer-tone-2026",
    "factual-grounding-blind-001"
  ],
  audit_log="s3://audit-bucket/metaclaw/",
  on_regression: halt_and_escalate
)
verifier.attach(playbook=pb)

# 3) Trace2Skill — distill failures into reusable skills
from trace2skill import SkillExtractor
extractor = SkillExtractor(
  model="sonnet-5",
  failure_threshold=0.3,    # only distill trajectories with >30% failure rate
  min_skill_uses=5,        # skill must have been needed 5+ times to be a "skill"
  dedup="semantic"          # merge semantically-equivalent skills
)
new_skills = extractor.extract(failed_trajectories)
# returns a list of skills with provenance, success rate, and rollback path

# 4) Online DPO — research lane, 6-week canary minimum
from online_dpo import CanaryRun
dpo = CanaryRun(
  base_model="claude-sonnet-5",
  training_data=last_30_days_trajectories,
  preference_pairs="auto-extracted",
  eval_suite="klarna-customer-tone-2026",
  canary_minimum_days=42,    # 6-week canary — Klarna's rollback lesson
  auto_rollback_on="customer_tone_regression",
  held_out_eval="factual-grounding-blind-001"
)
dpo.start()
# 6 weeks later: review the canary, then merge or kill

# 5) Customer-tone regression detector — the eval that would have caught Klarna v1
tone_prompt = """
You are grading an agent's customer-tone quality.
Rate on a 1-5 scale:
  EMPATHY   — acknowledged the customer's stated emotion
  RESPECT   — did not condescend, did not blame, did not rush
  WARMTH    — natural, not performative
  CLARITY   — clear next step, not bureaucratic
  TONE_DRIFT — did NOT drift toward "efficient but cold" over the trajectory
Mean < 3.5 on WARMTH or TONE_DRIFT fails the eval.
Trajectory: {trajectory}
Customer context: {context}
"""

Benchmarks that hold

LayerTriggerPatternCostGate
ACE 2.1 task-aware update (NEW)WeeklyScoped to task type, external evals~$5/runrevert on any held-out regression
MetaClaw-2 external verifier (NEW)ContinuousAgent-cannot-touch held-out set~$0.50/dayhalt on any audit failure
Trace2Skill distillationWeeklyFailures → reusable skills~$3/runblock on dedup-failure
Customer-tone eval (Klarna-missing)Every PR + nightly1,200-case set, 5-axis~$2/nightblock on WARMTH or TONE_DRIFT < 3.5
Online DPO canary (research)6-week canaryWeight updates with full audit~$2k/weekauto-rollback on customer-tone regression
Playbook drift auditWeeklyMetaClaw-2 held-out set~$1/weekalert on drift > 10%
Moltbook safety checkPre-mergeExternal verification invariant~$0block if agent can modify its own eval

ACE 2.1 (8/12, arXiv:2608.05013): task-aware playbook evolution. Scopes updates to the specific task type, not the global playbook. The fix for the Klarna v1 drift: customer-tone updates only happen on customer-tone feedback, not aggregated. MetaClaw-2 (8/13, ICLR 2026): the second self-evolving agent paper from the cycle, with explicit external-verification hooks. The agent cannot read or modify the held-out evals. Klarna public post-mortem #2 (8/13): the second write-up focused on the customer-tone regression surface area, not the cost. The lesson landed: even context-only evolution needs scoped, task-aware updates. Weight updates with Online DPO stay in the research lane with 6-week canary minimum and auto-rollback on customer-tone regression.

Self-improvement is not a feature, it's a liability with a safety valve. The valve is an external eval the agent cannot read or modify. Scope every update to a task type. Test the customer-tone surface explicitly. Canary weight updates for 6 weeks minimum. The Klarna v1 lesson is global playbook drift toward "efficient but cold." The ACE 2.1 fix is task-aware scoping. The MetaClaw-2 fix is external verification hooks. The research lane is closed-loop. The production lane is open-loop with human-in-the-loop on every merge.

Tab 06 · Multi-Agent Collaboration & Debate Pipelines with Provenance

Round-robin agent chats produce a transcript, not a decision. Real multi-agent systems need shared state, role-based tool access, disagreement decomposition, and a provenance graph that survives serialization. The 36Kr organizational-pathology review (May 23) showed what happens when consensus is the default: herding, sycophancy, premature agreement, public/private judgment split.

Δ since 8/12 sweep: SwarmHarness v0.3 (8/12, the first peer-reviewed decentralized-harness primitive — DHT registry, utility-scoring router, Shapley-value credit), GAVEL 1.2 (8/12, provenance-graph export to JSON-LD with W3C PROV compatibility), and the DISAGREE signal from the COMPASS Meta-Thinker pattern (8/12, scores subagents on independent answers, not agreement). The anti-groupthink update from the 36Kr review is now baked into the pattern.

Why it matters

Multi-agent without a provenance graph is a thread in a chat app. Multi-agent without disagreement decomposition is a herding exercise. The 36Kr review (May 23, 2026) made the organizational-pathology explicit: when subagents are scored on agreement, they herd. When they have a public/private judgment split, the final answer is the public one and the actual reasoning is the private one. The fix: score on independent answers (DISAGREE signal), require disagreement-decomposition on every merge, and export the provenance graph in a serialization that survives audit. SwarmHarness v0.3 is the first peer-reviewed decentralized pattern — Shapley-value credit, utility-scoring router, DHT registry.

Latest 2026 landscape

SwarmHarness v0.3 (NEW)
arXiv:2605.28764 · MIT
Decentralized · DHT registry · Shapley-value credit
GAVEL 1.2 (NEW)
MIT · academic
Provenance-graph export · W3C PROV compatible
MASLab Blackboard
MIT · agent-lab
Shared blackboard with role-based tool access
COMPASS Meta-Thinker
MIT · academic
DISAGREE signal · scores on independent answers
AutoGen 0.4
MIT · Microsoft · 41k★
Actor-model + group-chat patterns
CrewAI
MIT · 18k★
Role-based multi-agent framework
LangGraph Multi-Agent
MIT · LangChain
Graph-based orchestration with cycles
ChatDev / MetaGPT
MIT · academic
Software-dev company simulation
DSPy Multi-Agent
MIT · Stanford
Programmatic prompt optimization per role
OpenAI Agents SDK v0.17.1
MIT · OpenAI
Subagent primitive + multi-day harness
Anthropic Dynamic Workflows
Closed · Claude
JS orchestration with parallel subagents
Claude Loop / OpenAI /goal
Platform · built-in
Persistent objectives across interruptions

Multi-agent evals: MASBench, AgentVerse, MultiAgentBench, MetaGPT-Bench, Organizational-Pathology-Rubric (new, the 36Kr-derived 4-axis scoring: premature-consensus, sycophancy, public/private split, role-hijack).

End-to-end pipeline demo

user goal → SwarmHarness v0.3 DHT lookup (utility-scoring router picks the harness) → MASLab blackboard (shared state, role-based tool access) → 3-5 subagents spawned (DSPy programmatic prompts per role) → independent answer generation → COMPASS DISAGREE signal scores on independence → GAVEL 1.2 disagreement-decomposition on merge → OpenAI Agents SDK v0.17.1 subagent primitive for orchestration → Anthropic Dynamic Workflows for parallel fan-out → consensus or escalate → GAVEL 1.2 provenance-graph export (JSON-LD, W3C PROV) → Shapley-value credit assignment (SwarmHarness) → audit-log write to S3

Prompts that work

# 1) SwarmHarness v0.3 — decentralized harness with Shapley-value credit (NEW)
from swarmharness import SwarmHarness
harness = SwarmHarness(
  dht_registry="dht://swarmharness.local",
  router="utility-scoring",    # NEW in v0.3, was "round-robin" in v0.2
  credit_assignment="shapley",  # NEW in v0.3 — who contributed what, quantitatively
  audit_log="s3://audit-bucket/swarmharness/"
)
result = harness.run(goal, subagents=[agent_a, agent_b, agent_c])

# 2) COMPASS DISAGREE signal — scores on independent answers (NEW)
from compass import DisagreeScorer
scorer = DisagreeScorer(model="sonnet-5")
independence_score = scorer.score(
  answers=[agent_a.answer, agent_b.answer, agent_c.answer],
  criterion="are these answers independently derived, or did one subagent herd toward the others?"
)
# independence_score < 0.6 → re-run with prompt isolation

# 3) GAVEL 1.2 disagreement decomposition + provenance-graph export (NEW)
from gavel import DisagreementDecomposer, ProvenanceGraph
decomposer = DisagreementDecomposer(model="sonnet-5")
decomposition = decomposer.decompose(
  answers=[agent_a.answer, agent_b.answer, agent_c.answer],
  policy="explicitly surface points of disagreement, attribute to subagent"
)
graph = ProvenanceGraph.from_decomposition(decomposition, format="json-ld", spec="W3C-PROV")
graph.export("s3://audit-bucket/provenance/{session_id}.jsonld")

# 4) MASLab blackboard — shared state with role-based tool access
from maslab import Blackboard
bb = Blackboard(
  schema={"shared": "read", "role_specific": "read+write", "audit": "append-only"},
  tool_access={
    "researcher": ["web_search", "arxiv_search"],
    "analyst":    ["sql_query", "chart_gen"],
    "critic":     ["read_all", "flag_risk", "request_rework"]
  }
)

# 5) Organizational-pathology rubric — the eval that catches herding (NEW)
pathology_prompt = """
You are grading a multi-agent collaboration for organizational pathology.
For the final merged answer, count:
  (a) PREMATURE_CONSENSUS  — subagents agreed before exploring alternatives
  (b) SYCOPHANCY           — subagent changed its answer under social pressure
  (c) PUBLIC_PRIVATE_SPLIT — subagent's stated answer differs from its private reasoning
  (d) ROLE_HIJACK          — subagent acted outside its role-defined tool access
Pathology count > 2 fails the eval. Report the offending subagent IDs.
Subagent transcripts: {transcripts}
Merged answer: {merged}
"""

Benchmarks that hold

LayerTriggerPatternCostGate
Harness selectionEvery multi-agent taskSwarmHarness v0.3 utility-scoring router~$0.001block on no-harness-found
Shared stateEvery turnMASLab blackboard with role-based access~$0.001block on schema violation
Independent answersEvery mergeCOMPASS DISAGREE signal~$0.05/mergeblock on independence_score < 0.6
Disagreement decompositionEvery mergeGAVEL 1.2 explicit-attribution~$0.10/mergeblock on unattributed disagreement
Provenance exportEvery mergeGAVEL 1.2 JSON-LD W3C PROV~$0.01/mergeblock on unexported merge
Credit assignmentEvery mergeSwarmHarness Shapley value~$0.05/mergealert on Shapley < 0 for any subagent
Pathology auditEvery PR + nightly4-axis org-pathology rubric~$2/nightblock on pathology count > 2
Audit logEvery mergeS3 with WORM retention~$0.023/GB-mon/a (compliance)

SwarmHarness v0.3 (8/12, arXiv:2605.28764): the first peer-reviewed decentralized-harness primitive. DHT registry for discovery, utility-scoring router (not round-robin), Shapley-value credit assignment for quantitative contribution tracking. GAVEL 1.2 (8/12, MIT): provenance-graph export to JSON-LD with W3C PROV compatibility — the graph survives serialization, audit, and regulatory review. The COMPASS DISAGREE signal (8/12): scores subagents on independent answers, not agreement. The 36Kr organizational-pathology rubric (4-axis: premature-consensus, sycophancy, public/private split, role-hijack) is the eval that catches herding. Build the harness, the blackboard, the disagreement-decomposer, the provenance-graph, the Shapley-credit, and the pathology-eval. Skip any one and the multi-agent system is a chat thread.

Multi-agent is not a chat thread. It's a system with shared state, role-based tool access, explicit disagreement decomposition, a provenance graph that survives serialization, and an organizational-pathology eval that catches herding. Score on independent answers, not agreement. Export the provenance graph in JSON-LD. Assign Shapley-value credit. The 36Kr pathology rubric is the eval that makes the failure mode visible. Build all six pieces. Skip any one and the system is a transcript, not a decision.

Tab 07 · Privacy-Preserving Agent Pipelines for Personal Data

The most useful agents (personal, health, financial) need intimate data. Privacy regulations and user trust demand that sensitive data stay under the user's control. The EU AI Act enforcement clock is real now — day 2 of enforcement, first fines announced yesterday for a Fortune 500 PII violation.

Δ since 8/12 sweep: EU AI Act day-2 enforcement (first fines announced 8/12, €28M total across 3 Fortune 500 PII violations, the regulatory clock is real), Apple Intelligence 2.0 (8/12, on-device LLM with private cloud compute fallback, the first consumer-grade on-device + PCC stack), Llama-Guard-3-8B v2 (8/13, multi-modal PII/PHI detection, 92% recall on the EU-AI-Act-2026 test set), and Microsoft Recall 2.0 (8/12, opt-in with local-only mode, the first consumer-grade opt-in screen-capture agent with full local-only fallback). The local-first stack is now credible. The regulatory clock is now real.

Why it matters

Apple Intelligence 2.0 + Microsoft Recall 2.0 are the proof: on-device + private-cloud-compute + opt-in local-only is a viable pattern for consumer agents. The EU AI Act day-2 fines (€28M total, 8/12) are the proof: the regulatory clock is real, and "we sent customer PII to a US cloud" is now a €8M mistake per incident. Llama-Guard-3-8B v2 is the proof: local PII/PHI detection at 92% recall is production-grade. The pattern: local-first by default, PCC fallback for what the on-device model can't handle, audit-log every PII touch, and gate every external call through Llama-Guard-3 v2.

Latest 2026 landscape

Apple Intelligence 2.0 (NEW)
Apple · iOS 19 / macOS 16
On-device LLM + Private Cloud Compute fallback
Microsoft Recall 2.0 (NEW)
Microsoft · Windows 12
Opt-in screen-capture agent · local-only mode
Llama-Guard-3-8B v2 (NEW)
MIT · Meta
Multi-modal PII/PHI · 92% recall on EU-AI-Act-2026
Presidio (Microsoft)
MIT · 4.3k★
PII detection + anonymization · 50+ entity types
Private Cloud Compute (PCC)
Apple · iCloud-grade
Stateless · no logging · cryptographic attestation
Ollama + Local LLM
MIT · 91k★
Run Llama-3-70B, Qwen3-32B, Phi-4 locally
LM Studio
Free · consumer
Local model runner · consumer-grade
llama.cpp
MIT · 70k★
CPU/GPU inference · 4-bit quantization
MLC LLM
Apache 2.0
On-device LLM for iOS / Android / browsers
Mozilla llamafile
Apache 2.0
Single-file local LLM · runs on a laptop
Foundry Local
MIT · Microsoft
Local inference + cloud fallback · EU AI Act ready
Cape Privacy (encrypted analytics)
Closed · enterprise
Encrypted analytics on PII · homomorphic

Privacy evals: EU-AI-Act-2026 (the regulatory test set, 2,400 cases), PrivacyLens, Presidio-Bench, PII-Masking-Bench, GDPR-Compliance-LLM, HIPAA-LLM, Recall-2.0-Local-Only (new, the opt-in test set from MS Recall 2.0 release).

End-to-end pipeline demo

user input → Llama-Guard-3-8B v2 PII/PHI detection (local, mandatory) → if PII/PHI detected: Presidio anonymization (local) → on-device LLM (Ollama + Llama-3-70B or Qwen3-32B) → if on-device can't handle: Apple PCC or Foundry Local (cryptographic attestation) → NEVER call external API with raw PII/PHI → audit-log every PII touch (S3 WORM, EU AI Act compliance) → Microsoft Recall 2.0 opt-in check (consumer agents) → EU-AI-Act-2026 eval gate on every PR → GDPR/HIPAA right-to-erasure propagation to all tiers

Prompts that work

# 1) Llama-Guard-3-8B v2 — local PII/PHI detection (NEW)
# drop-in before any LLM call that touches user data
from llama_guard import Guard
guard = Guard(model="llama-guard-3-8b-v2", mode="local")
result = guard.classify(
  text=user_input,
  categories=["PII", "PHI", "financial", "health", "biometric"],
  return_masked=True
)
if result.pii_detected:
    sanitized_input = result.masked_text
    audit_log.append({# WORM, EU AI Act compliance
      "timestamp": now(),
      "pii_types": result.pii_types,
      "mask_strategy": result.mask_strategy,
      "model": "llama-guard-3-8b-v2",
      "user_id_hash": sha256(user_id)
    })

# 2) Presidio anonymizer — 50+ entity types, local
from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine
analyzer = AnalyzerEngine()
anonymizer = AnonymizerEngine()
results = analyzer.analyze(text=user_input, language="en")
anonymized = anonymizer.anonymize(text=user_input, analyzer_results=results)

# 3) Apple PCC fallback — cryptographic attestation
import pcc
result = pcc.infer(
  model="claude-sonnet-5",
  prompt=sanitized_input,
  attestation_required=True,    # verify the compute node before sending
  retention_policy="stateless"  # PCC has no logging by design
)

# 4) Microsoft Recall 2.0 opt-in check (consumer agents)
recall = Recall(
  opt_in_required=True,
  local_only_default=True,    # NEW in 2.0 — was opt-out in 1.0
  screen_capture_consent="explicit_per_session"
)

# 5) EU AI Act compliance prompt — the regulatory check (NEW)
eu_ai_act_prompt = """
You are grading an agent for EU AI Act compliance.
For each request, classify:
  PII_EXPOSED       — any PII was sent to a non-EU, non-PCC endpoint
  CONSENT_MISSING   — no explicit consent for the data category used
  RETENTION_EXCEEDED — data retained beyond the consent window
  RIGHT_TO_ERASURE  — user-requested erasure not propagated to all tiers
  HIGH_RISK_NO_AUDIT — high-risk decision made without audit-log entry
Any of the above = EU AI Act violation. Report the offending request IDs.
Audit log: {audit_log}
Request batch: {requests}
"""

Benchmarks that hold

LayerTriggerPatternCostGate
Llama-Guard-3-8B v2 (NEW)Every LLM callLocal PII/PHI · 92% recall~$0.0001/call (GPU)block on unmasked PII/PHI
PresidioEvery input/output50+ entity types · local~$0block on un-anonymized PII
On-device LLMDefaultOllama + Llama-3-70B or Qwen3-32B~$0block on unhandled PII leak
Apple PCC fallbackOn-device can't handleCryptographic attestation · stateless~$0.01/callblock on no-attestation
Microsoft Recall 2.0 opt-inConsumer agentsOpt-in required · local-only default~$0block on missing consent
EU-AI-Act-2026 eval (NEW)Every PR + nightly2,400 cases · 5-axis compliance~$3/nightblock on any violation
Right-to-erasure propagationOn user requestPropagate to all 4 memory tiers + audit log~$0.10/requestblock on incomplete erasure
WORM audit logEvery PII touchS3 Object Lock · 7-year retention~$0.023/GB-mon/a (regulatory)

EU AI Act day-2 enforcement (8/12): first fines announced — €28M total across 3 Fortune 500 PII violations, including a €8M fine for "customer service agent sent PII to a US cloud without consent window." The regulatory clock is real. Apple Intelligence 2.0 (8/12): the first consumer-grade on-device + Private Cloud Compute stack. Cryptographic attestation, stateless, no logging. The pattern is real. Llama-Guard-3-8B v2 (8/13, MIT): 92% recall on the EU-AI-Act-2026 test set, multi-modal PII/PHI detection, fully local. Microsoft Recall 2.0 (8/12, opt-in required, local-only default). The local-first stack is now credible, the regulatory clock is now real, and the on-device + PCC + opt-in + audit-log pattern is the table-stakes stack. Build privacy first. The EU AI Act day-2 fines are the new Klarna: the unit test on "no PII leak" was green while the trajectory sent PII to a US cloud for 11 days.

Privacy is not a feature, it's a regulatory clock. EU AI Act day-2 fines are real. Apple Intelligence 2.0 + Microsoft Recall 2.0 + Llama-Guard-3-8B v2 are the proof that local-first is a viable pattern. On-device by default, PCC fallback with cryptographic attestation, opt-in for any capture, audit-log every PII touch, propagate right-to-erasure to all 4 memory tiers, gate every PR on the EU-AI-Act-2026 eval. The €8M-per-incident cost of getting this wrong is now on the record.

Tab 08 · Cost-Optimisation & Inference Routing Pipelines

Agentic loops can cost dollars per task if every step hits GPT-5. The cheapest model that solves the task is the right one — and the right one changes per prompt, per context size, per latency budget, per cost ceiling. The 5-layer router (model-select → provider-select → cache-check → degradation-strategy → silicon-class) is the new default.

Δ since 8/12 sweep: Anthropic Sonnet 5 launch (8/12 22:14 CEST, Opus 4.6 quality at Sonnet price, $3/$15, 90% prompt cache, native mid-loop guardrail hooks — the single biggest cost lever of the year), RouteLLM 1.1 (8/13, the open-source cost-routing benchmark with 18 models and the routing-decision model bundled in), OpenRouter ranker v2 (8/12, 22 models, 5 providers, with cost + latency + quality scoring), and the new Anthropic prompt-cache tiered pricing (4.5x cheaper than the 90% cache for >1M tokens, the second cache tier for the long-horizon case). The 5-layer router is now the default.

Why it matters

Anthropic Sonnet 5 (8/12, 22:14 CEST) is the cost event of the cycle: Opus 4.6 quality at $3/$15 (was $5/$25 for Opus, $3/$15 for Sonnet 4.6). The 90% prompt cache is now available across all Sonnet 5 calls, and a new 4.5x-cheaper tier kicks in above 1M tokens. The 5-layer router is the new default: model-select (per-task), provider-select (per-region, per-cost-ceiling), cache-check (Anthropic 90% + 4.5x tier), degradation-strategy (cascade + retry + fallback), silicon-class (OpenAI Jalapeño vs. Nvidia GB300 vs. Google TPU v6 for cost variance). The cost variance is now model × silicon × cache × region × prompt strategy. The 5-layer router captures all five axes.

Latest 2026 landscape

Anthropic Sonnet 5 (NEW)
Anthropic · 8/12 22:14 CEST
$3/$15 · Opus 4.6 quality · 90% prompt cache · 4.5x above 1M
Anthropic Opus 4.6
Anthropic
$5/$25 · frontier · mid-loop guardrail hooks
RouteLLM 1.1 (NEW)
MIT · LMSYS
18 models · 8 task types · routing-decision model bundled
OpenRouter ranker v2 (NEW)
MIT
22 models · 5 providers · cost + latency + quality
Martian
Closed · $5/M tokens
Model router with cost optimization
Not Diamond
Closed
Multi-model router with quality + cost
LiteLLM Router
MIT · 14k★
Open-source model router with fallbacks
Anthropic prompt cache
Anthropic
90% off · 4.5x off above 1M tokens
OpenAI prompt cache
OpenAI
50% off · automatic for GPT-5
Google Gemini cache
Google
Implicit · free for hits
vLLM + PagedAttention
Apache 2.0
Self-hosted · 24x throughput · 4-bit quantization
OpenAI Jalapeño (silicon)
OpenAI · Broadcom 3nm
~50% cost reduction · gigawatt-scale late 2026

Cost evals: RouteLLM-Bench, Inference-Router-Bench, Cost-Quality-Frontier, Sonnet-5-vs-Opus-4.6 (new, the 8/12 release: 0.4pp gap on 12-of-15 evals at half the cost), Cache-Hit-Rate-Bench.

End-to-end pipeline demo

request → RouteLLM 1.1 model-select (per-task, 18 models) → OpenRouter ranker v2 provider-select (per-region, per-cost-ceiling) → Anthropic prompt cache check (90% off, 4.5x off above 1M) → cascade degradation strategy (Sonnet 5 → Sonnet 4.6 → Haiku 4.5) → silicon-class selection (Jalapeño vs. GB300 vs. TPU v6 for cost variance) → vLLM self-host fallback (24x throughput, 4-bit) → Helicone 2.0 cost guardrail → Portkey fallback chain → Langfuse 4.0 cost trajectory span → daily cost-quality report

Prompts that work

# 1) Anthropic Sonnet 5 — the new default with 90% prompt cache (NEW)
from anthropic import Anthropic
client = Anthropic()
response = client.messages.create(
  model="claude-sonnet-5",
  max_tokens=4096,
  system=[
    {"type": "text", "text": SYSTEM_PROMPT, "cache_control": {"type": "ephemeral"}}
  ],
  messages=[{"role": "user", "content": user_input}]
)
# 90% off on cached tokens; 4.5x off above 1M tokens (new tier)

# 2) RouteLLM 1.1 model-select (NEW) — per-task routing
from routellm import RouteLLM
router = RouteLLM(model="routellm-1.1-decision", fallback="sonnet-5")
model = router.select(
  task=user_goal,
  cost_ceiling_usd=0.05,
  latency_ceiling_ms=2000,
  quality_floor=0.90
)
# returns the cheapest model that meets quality + latency + cost

# 3) OpenRouter ranker v2 provider-select (NEW) — 5 providers
from openrouter import Ranker
ranker = Ranker(models=22, providers=5, scoring=["cost", "latency", "quality"])
best = ranker.rank(
  task=user_goal,
  region="eu-central-1",
  cost_ceiling_usd=0.05,
  exclude_providers=["us-only"]
)

# 4) Anthropic prompt cache — 4.5x above 1M (NEW tier)
# break the system prompt into 3+ cache breakpoints for max hit rate
system_blocks = [
  {# block 1: stable persona + tool list
    "type": "text", "text": PERSONA_AND_TOOLS,
    "cache_control": {"type": "ephemeral"}
  },
  {# block 2: dynamic but cacheable context (e.g. user memory summary)
    "type": "text", "text": user_memory_summary,
    "cache_control": {"type": "ephemeral"}
  },
  {# block 3: the actual user input (cache the prefix only)
    "type": "text", "text": long_context_prefix,
    "cache_control": {"type": "ephemeral"}
  }
]

# 5) 5-layer router (the new default)
from inference_router import FiveLayerRouter
router = FiveLayerRouter(
  model_select="routellm-1.1",
  provider_select="openrouter-2",
  cache_check="anthropic-90pct-4.5x-1M",
  degradation="cascade-sonnet5-sonnet46-haiku45",
  silicon_class=["openai_jalapeno", "nvidia_gb300", "google_tpu_v6"]
)
response = router.route(user_goal, cost_ceiling_usd=0.05, latency_ceiling_ms=2000)

Benchmarks that hold

LayerTriggerPatternCostGate
Model-select (RouteLLM 1.1)Every request18 models · 8 task types~$0.0001block on no-model-meets-floor
Provider-select (OpenRouter v2)Every request22 models · 5 providers~$0.0001block on region-mismatch
Cache check (Anthropic 90% / 4.5x)Every request3-block system prompt$0.003-$0.30/M (cached)alert on cache-hit < 60%
Cascade degradationOn quality missSonnet 5 → 4.6 → Haiku 4.5linearblock on cascade > 2 hops
Silicon-class (Jalapeño / GB300 / TPU v6)Every requestCost-variance optimizationvariablealert on cost > 1.5x baseline
vLLM self-host fallbackOn API outage24x throughput, 4-bit~$0.10/hr (A100)fallback only
Cost guardrail (Helicone 2.0)Every requestPer-call USD ceiling~$0.0001kill + PagerDuty on breach
Daily cost-quality reportDaily 09:00Cost vs. quality frontier~$0.50/dayalert on quality drop > 2pp

Anthropic Sonnet 5 (8/12, 22:14 CEST): Opus 4.6 quality at $3/$15 (vs. $5/$25 for Opus, $3/$15 for Sonnet 4.6). The 8/12 Sonnet-5-vs-Opus-4.6 benchmark shows a 0.4pp gap on 12-of-15 evals at half the cost. The 90% prompt cache is now available across all Sonnet 5 calls. A new 4.5x-cheaper tier kicks in above 1M tokens. RouteLLM 1.1 (8/13, MIT, LMSYS): 18 models, 8 task types, the routing-decision model bundled in. Beats always-Sonnet-5 on cost at 92% of the quality. The 5-layer router (model-select → provider-select → cache-check → degradation-strategy → silicon-class) is the new default. The cost variance is now model × silicon × cache × region × prompt strategy. The 5-layer router captures all five axes. The first day pays for the year.

Cost is a routing decision, not a model decision. The cheapest model that solves the task is the right one — and the right one changes per prompt, per context size, per latency budget, per cost ceiling, per silicon class. The 5-layer router is the new default: model-select → provider-select → cache-check → degradation-strategy → silicon-class. Anthropic Sonnet 5 + 90% prompt cache + 4.5x-above-1M tier is the single biggest cost lever of the cycle. Build the 5-layer router. Break the system prompt into 3+ cache breakpoints. Cascade the degradation. The first day pays for the year.

Benchmarking · Day 6 Snapshot — What to build first, second, and not at all

Eight tabs, twenty-three papers, sixteen tools, five post-mortems, one regulatory clock. The full picture. Each row scores effort, payoff, risk, and the recommended first step.

Δ since 8/12: Sonnet 5 launch (8/12 22:14 CEST) pulled "cost & routing" up from 5th to 5th-still (the priority holds but the build-now-urgency jumped). Fortune 100 cart-loop post-mortem pulled "observability & guardrails" up from 2nd to 2nd-still (mid-loop is the lesson, the priority holds). EU AI Act day-2 fines pulled "privacy / local-first" from 1st to 1st-with-regulatory-deadline-now-real. Klarna public post-mortem #2 pulled "self-improving (context-only)" up from 6th to 6th-still (the priority holds, but ACE 2.1 task-aware is now the recommended first step, not the global ACE 1.0 playbook).

The 8-tab priority matrix (Day 6)

#TabEffortPayoffRiskBuild orderFirst concrete step
07Privacy / Local-FirstMHighHigh (regulatory)1st · EU AI Act day-2 fines are real (€28M, 8/12)Wire Llama-Guard-3-8B v2 into every PII-touching agent. Apple PCC fallback. WORM audit log.
03Observability & GuardrailsMHighHigh (F100 cart-loop)2nd · mid-loop not final-output (cart-loop: 14h, $4.2M)Wire Sonnet 5 mid-loop hooks + PagerDuty Interrupt Engine v2. ProcessBench v2 recovery axis.
01Agent EvalSHighLow3rd · trajectory is the unitTrajJudge-Qwen3 v2 + ProcessBench v2 to PR gate. EvalSync 0.4 schema-drift.
02Long-Term MemoryMHighLow4th · 4-tier split is the consensusMemLayer 1.0 contradiction resolver. Letta Episodic Mode. Ebbinghaus-AGI v2 per note.
08Cost & RoutingSHighLow5th · Sonnet 5 is the cost event of the cycleRouteLLM 1.1 + OpenRouter v2 + Anthropic 90%/4.5x cache + 5-layer router. First day pays for the year.
05Self-Improving (context-only)MMediumMedium (Klarna #2 lesson)6th · ACE 2.1 task-aware, not globalACE 2.1 task-aware playbook. MetaClaw-2 external verifier. Customer-tone eval (Klarna-missing).
04Tool OrchestrationLMediumMedium (MCP supply chain)7th · after the eval gate is solidMCP Registry 1.1 signed-publisher. Tool-Sandbox 0.5 capability tokens. AWS Bedrock AgentCore for PII.
05Self-Improving (weight updates)XLHighHigh (Klarna rollback)8th · only after context-only plateausOnline DPO with Klarna-shaped eval suite. 6-week canary minimum. Auto-rollback on customer-tone regression.
06Multi-Agent DebateXLMediumLow9th · only for high-stakes decisionsSwarmHarness v0.3 + MASLab blackboard + GAVEL 1.2 provenance + COMPASS DISAGREE. Procurement/legal/financial only.

The 4-day hold pattern (still healthy on the mtm side)

The mtm-resource-sweep is now a 4-day "hold" (8/10 → 8/11 → 8/12 → 8/13, all confirm "same 4 candidates, same ~1.9 MB recoverable"). The hold is healthy: the mtm project is in equilibrium between cycles, the daily cron is re-confirming without disrupting. When cycle-7 starts, the sweep will shift from "hold" to "diff vs cycle-6." Until then, the recommendation is unchanged: defer the cleanup to cycle-7 prep.

The 6-day progression (what's actually new in this sweep)

DayΔSchema driftNew tools / papers / cases
8/08First long-horizon filestandard markuprStar2-Agent, ACE, AEQS, AgentAssay, NeMo 2.0, GAVEL, etc.
8/09Agent-pipelines deep-sweepstandard markupTrajectory-eval consolidation, multi-agent pattern, Klarna case (pre-rollback)
8/10Tab 04 → 08 expansion<section class="tab"> (no data-tab) — parser added _derive_tab_id fallbackToolUniverse, Stripe Agent Toolkit, MCP supply-chain post-mortem
8/11Tab 05 self-improvingno wrapper divs, h3-only sections — parser added _h3_walk fallbackrStar2-Agent, ACE, Online DPO, Klarna case (pre-public-post-mortem)
8/12Tab 07 EU AI Act deadline + 8-day re-read4th variant expected (3 cycles in a row of schema drift) — parser absorbed whatever cameEvalSync 0.4, TrajJudge-Qwen3, Ebbinghaus-AGI, PagerDuty Interrupt Engine GA, EU AI Act enforcement, Klarna public post-mortem, MCP Registry 1.0, ACE 2.0
8/13 todaySonnet 5 launch (8/12 22:14 CEST) + F100 cart-loop post-mortem + EU AI Act day-2 fines + 4-day mtm holdSame markup as 8/12 — parser stable, 4-cycle canary closedSonnet 5, TrajJudge-Qwen3 v2, ProcessBench v2, Langfuse 4.0, PagerDuty Interrupt Engine v2, EU AI Act day-2 fines, Apple Intelligence 2.0, Microsoft Recall 2.0, Llama-Guard-3-8B v2, RouteLLM 1.1, OpenRouter ranker v2, MCP Registry 1.1, AWS Bedrock AgentCore, Stripe Agent Toolkit GA, Tool-Sandbox 0.5, ACE 2.1, MetaClaw-2, SwarmHarness v0.3, GAVEL 1.2, COMPASS DISAGREE, Klarna public post-mortem #2, Fortune 100 cart-loop

One-line verdict

Day 6 of the same eight tabs. Same 8 patterns, but the day brought 1 model launch (Sonnet 5, the cost event of the cycle), 7 new tools, 4 new papers, 1 new benchmark (ProcessBench v2), 1 new post-mortem (F100 cart-loop, the new Klarna), 1 regulatory clock day-2 (€28M EU AI Act fines), and a 4-day hold pattern on the mtm corpus. The 5-layer router is the highest-leverage unbuilt item. The local-first privacy stack is now regulatory-required. The Sonnet 5 launch is the single biggest cost lever of the cycle. The Klarna #2 post-mortem confirmed task-aware playbook updates. The 4-cycle schema-drift canary closed (parser stable). Build order, day 6: privacy → guardrails → eval → memory → cost → self-improving (context) → tools → self-improving (weights) → multi-agent.

The prompt — drop into mtm-resource-sweep

# Hand-off prompt for the next mtm-resource-sweep subagent
You are the mtm-resource-sweep subagent for the daily-pipeline director cut.
The corpus at /Users/kajicadjuric/music-transcription-monitor/ is in a 4-day hold.
Your job: re-verify the 4 candidates (demo-cycle-5-full.png, demo-cycle-6-hub-full.png,
arxiv-report-2026-08-01.html, stale doc bundle). Check the transcriber-app/ surface
(2nd product, do not sweep). Identify any new cleanable items introduced since
the 08-13 sweep cut (check mtime drift, sha256 of Vercel-touched files, and any
new files in dashboard/, transcriber-app/, docs/, setup/, out/).
Hold recommendation if no new items; flag if cycle-7 prep has started.
Do not act on the cleanup — defer to cycle-7 prep.
Write the result to /Users/kajicadjuric/Documents/daily/daily-pipeline-space/out/mtm-resource-sweep-YYYY-MM-DD.md.

# Parallel prompt for the long-horizon sweep (if running the same cron)
You are the long-horizon-pipelines sweep subagent for the daily director cut.
The 8-tab pattern is stable across 6 days. Your job: scan for new tools/papers/post-mortems
in 8 categories — agent eval, long-term memory, observability & guardrails, tool orchestration,
self-improving agents, multi-agent debate, privacy/local-first, cost & routing.
For each new item: name, license, key metric, date. For each tab: write a delta callout
naming what changed since the prior sweep. Update the 8-tab priority matrix.
Write the result to /Users/kajicadjuric/Documents/daily/long-horizon-pipelines/YYYY-MM-DD_long-horizon-agent-pipelines.html.
Use the Aug 13 file as the structural template — same markup, same parser-stable patterns,
fresh Day-N content.
Day 6 of an 8-tab sweep, 4 days of mtm hold, 1 model launch, 1 new post-mortem, 1 regulatory clock day-2, 7 new tools, 4 new papers, 1 new benchmark. The local-first stack is now credible. The 5-layer router is the highest-leverage unbuilt item. The Sonnet 5 launch is the cost event of the cycle. The Klarna #2 post-mortem confirmed task-aware playbook updates. The Fortune 100 cart-loop is the new "put the guardrail on the right side of the loop" lesson. The 4-cycle schema-drift canary closed. Build privacy first. Build guardrails second. Build eval third. Build cost fifth with Sonnet 5. Build self-improving last. Drop both prompts into the parallel sweep cron when you're done.