Counting visitors…
Browse all docs
Start · 9Find your path through RunifoldLearn Runifold in 45 minutesUnderstand the complete Runifold platformYour first trustworthy runChoose the right execution APIChoose crates and Cargo featuresBuild common Runifold applicationsRunifold frequently asked questionsTroubleshoot Runifold applications
Execution kernel · 7Understand RunContextCoordinate external effects safelyBound work with budgets and cancellationHandle errors and retries safelyEvents, journals, and execution evidenceDesign capability-safe executionRecover safely from checkpoints
Models & providers · 7Route across models without duplicate outputChoose and configure a providerUse the provider-neutral model protocolBuild on the Provider Runtime contractUse OpenAI control-plane and Realtime APIsTest and benchmark provider adaptersSet up OpenAI, Anthropic, Gemini, and Ollama
Agents · 7Build and configure an AgentGive an Agent typed toolsAdd conversations and semantic memoryDelegate to child Agents safelyReturn structured Rust valuesStream without losing semanticsGround an Agent with retrieval
Durable workflows · 7Compose deterministic workflowsMake workflows durableOperate durable workflow workersCoordinate timers, signals, and durable waitsRun multi-tenant workflow infrastructureRun parallel branches and safe racesVersion and evolve durable workflows
Integrations · 7Connect through MCPChoose stores and persistence boundariesExpose durable work through MCP TasksBuild and evaluate retrieval pipelinesUse MCP Resources, Prompts, and SamplingCache MCP responses without crossing authorityDeploy Runifold in a Rust web service
Quality & operations · 10Test without the networkEvaluate quality and prevent regressionsObserve the complete run treeRun safely in browsers and at the edgeRead reliability claims preciselyRun reproducible evaluations in CIOperate Runifold with SLOsGovern Task retention and deletionArchive audit evidence to S3-compatible WORM storageManage compatibility and trusted releases
Docs/Trusted execution
NEW TO RUNIFOLD?Build the complete mental model in 45 minutes
Trusted execution

Understand RunContext

Control identity, causality, lifetime, authority, accounting, metadata, and journaling for one run tree.

Practical guide·8 min

What a RunContext owns

RunContext is the execution envelope for one causal run tree. It carries stable identity, parent–child lineage, cancellation, deadline, shared budget accounting, capabilities, metadata, and the event journal.

It is not chat history and it is not global application state. Create a root context at an ingress boundary such as an HTTP request, job, or workflow task.

Create a root run

Start with explicit limits and no authority, then grant only what this run needs.

use runifold::{Budget, BudgetTracker, CapabilitySet, RunContext};
 
let budget = Budget {
    turns: Some(8),
    tool_calls: Some(4),
    ..Budget::default()
};
let run = RunContext::root(
    BudgetTracker::new(budget),
    CapabilitySet::new(),
);

The ergonomic prompt APIs create a default context. Move to an explicit context when policy or accounting matters.

Child runs

Tools, child Agents, and workflow steps derive child contexts from the parent. Children share cancellation and accounting while receiving their own identity and only the authority deliberately delegated to them.

This makes a request reconstructable as a tree and prevents a helper from gaining permissions simply because its caller had them.

Journaling

The journal records semantic lifecycle events: start, usage, callable boundaries, cancellation, failure, and completion. Use it for audit and recovery; use OpenTelemetry for operational traces and metrics.

Attach tenant and request identifiers as low-cardinality metadata. Never place API keys or raw secrets in metadata, events, or error messages.