Implementation Guide
The reference architecture shows the complete picture. Almost no team should build the complete picture. This guide is about getting there in proportion to need: which components a Workflow needs at each level of autonomy and risk, which existing open-source tools fit each one, and what little is genuinely left to build.
Three rules run through it:
- Invest by stage, not all at once. A single model call needs a timeout, a retry policy, redacted tracing, an evaluation set and a kill switch — not a policy engine. The stages show what each step up the autonomy ladder adds, and why.
- Reuse where the problem is generic. Durable execution, policy evaluation, token exchange, egress control, tracing and feature flags are solved problems. The technology choices map each to open-source options, with licences checked and the paid or gated features named.
- Build only where the specification is new. A small layer exists nowhere else, because it encodes the spec’s semantics: run context carrying credential, taint and budgets across sub-agents; the action ledger; pinning tool descriptions; and the policy rules themselves. That layer is thin, and listed at the end of each choice.
There is no single stack to adopt. Choices are interchangeable within a concern, and each Workflow should use the least that its risk tier requires.
The progression at a glance
| Stage | Configuration | Tier → level | What it adds |
|---|---|---|---|
| 1 | A single model call | T1 → L1 | Deterministic application code that owns control flow and validates the model’s output against a schema. |
| 2 | A fixed workflow with model steps | T1–T2 → L1–L2 | Workflow code with deterministic routing; rules that must be exactly right stay in code. |
| 3 | An agent with read-only tools | T1 → L1 | An agent loop with hard limits on steps, tokens, wall time and per-tool calls, and loop detection. |
| 4 | An agent that acts | T2 → L2 | A policy engine behind the tool gateway; every ToolRequest gets allow, deny or escalate from versioned, tested policy. |
| 5 | Multiple agents | T2–T3 → L2–L3 | Sub-agents that receive narrower credentials than their parent, with the actor chain recorded. |
| 6 | A shared agent platform | T3 → L3 | Queue-based admission with priorities, and a model gateway with token-denominated hierarchical quotas. |
Where each concern enters
| Concern | Introduced at stage | Typical first step |
|---|---|---|
| Model access | 1 | LiteLLM Proxy |
| Tool mediation | 3 | Framework hooks |
| Policy decisions | 4 | Open Policy Agent (OPA) |
| Durable execution and state | 2 | Framework checkpointer (e.g. LangGraph Postgres saver) |
| Effects — ledger, executor, approval | 4 | PostgreSQL (transactional outbox) |
| Identity and egress | 4 | Keycloak |
| Context and memory | 2 | MCP Toolbox for Databases |
| Observability and privacy | 1 | OpenTelemetry (SDKs, Collector) + OpenLLMetry / OpenInference |
| Evaluation and release | 1 | promptfoo / Inspect / DeepEval |
| Outcomes and data governance | 6 | dbt Core + ClickHouse or DuckDB |
How the guide was derived
The components came from the essays; the boundaries between them were checked bottom-up with an event storm of a Run’s life, which also surfaced the design questions that the choices have to answer.