runtime-engine

A guide to the runtime engine that executes validated agent configurations. It explains the long-lived engine, the per-request execution context, and the request lifecycle.

In plain words
What is it for?
Use it when changing agent execution, request routing, context handling, tool execution, or the RuntimeEngine and ExecutionContext classes.
Why use it?
It prevents request-specific data from leaking between requests and keeps execution based on validated, compiled models rather than raw YAML.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/extra-org/extra/runtime-engine
Any agent
npx skills add extra-org/extra --skill runtime-engine
Clone the repo
git clone --depth 1 https://github.com/extra-org/extra

Made for: Claude Code, Codex.

Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00041 $0.00501
Opus 5 $0.00020 $0.00251
Sonnet 5 $0.00008 $0.00100
Haiku 4.5 $0.00004 $0.00050

Measured 2d ago against content hash 6c5d9781ca7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

runtime-engine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/runtime-engine/SKILL.md · 63 lines

What it actually says

Skill: Runtime Engine

When to use this skill

Use this when modifying RuntimeEngine, ExecutionContext, agent execution, or the request lifecycle. Primary tasks: tasks/0003-compiled-agent-graph.md, tasks/0004-runtime-engine.md.

Files to read first

  • AGENTS.md
  • docs/ARCHITECTURE.md
  • docs/RUNTIME_LIFECYCLE.md
  • docs/adr/0001-runtime-engine-created-once.md

Architecture rules

  • RuntimeEngine is long-lived, created once at startup from the CompiledAgentGraph.
  • ExecutionContext is per-request and carries all request-scoped state.
  • The compiled graph is immutable at runtime.
  • The runtime operates only on compiled, typed models — never raw YAML.

Implementation rules

  • Construct the engine only on startup paths; never inside request handlers.
  • Do not put request state (identity, tenant, current request, rendered prompts) on RuntimeEngine or the compiled graph.
  • Pass ExecutionContext explicitly through routing, context resolution, prompt rendering, and tool execution.
  • Keep the engine concurrency-safe by keeping it stateless w.r.t. requests.
  • Build the engine in src/agentplatform/runtime; the graph in src/agentplatform/graph.

Validation checklist

  • Engine constructed once (startup), not per request.
  • No request-scoped fields on the engine or graph.
  • All per-request data lives on ExecutionContext.
  • Compiled graph treated as immutable.
  • Tests cover concurrent requests not leaking state.
  • make check passes.

Common mistakes to avoid

  • Recreating the runtime or recompiling the graph per request.
  • Storing "current user/request" on the engine.
  • Mutating the compiled graph during execution.
  • Hidden global/singleton request state.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 63 lines · 41 tokens per session scan A 6c5d9781ca7b

Subscribe to this mod's changes

runtime-engine is a skill published in the GitHub repository extra-org/extra (108 stars, last pushed 4d ago), licensed MIT. It adds 41 tokens to every session and 501 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.