Flow Agents#

A portable process-discipline layer for agentic work: a kit-neutral engine for FlowDefinition interpretation, gates, runtime adapters, evidence, trust, and kit validation — plus opt-in kits such as Builder, Knowledge, Release Evidence, and Veritas Governance. Flow Agents keeps work inspectable so you ask for outcomes and the selected kit supplies the path, the state, the checks, and the proof.

  • Kit-neutral engine. FlowDefinition interpretation, gates, runtime and harness adapters, SDK/evidence/trust primitives, and kit validation. The engine is not Builder Kit; Builder is one kit on top.
  • Survive context loss. Durable sidecar state under .kontourai/flow-agents/ records acceptance criteria, evidence, critique, and handoff, so any session resumes from recorded state instead of chat memory.
  • Tamper-evident trust. Local capture is advisory and best-effort; the repository's required CI checks on the exact pull request head, and the git diff, remain the authoritative boundary.
  • Flow Kits — workflow + output shape. A kit bundles flows and optional skills, docs, adapters, evals, and assets as a validated, installable unit. The catalog lists Builder, Knowledge, Release Evidence, and Veritas Governance; bring your own kit through the same manifest path.

How it works#

flowchart LR
  Idea[Idea]
  Backlog[Backlog]
  Plan[Plan]
  Build[Build]
  Review[Review]
  Verify[Verify]
  Evidence[Evidence]
  Release[Release readiness]
  Learn[Learning]

  Idea --> Backlog --> Plan --> Build --> Review --> Verify --> Evidence --> Release --> Learn
  Review -->|finding| Build
  Verify -->|gap| Build
  Evidence -->|not verified| Plan

Flow Agents adds the operating layer around the model: the engine preserves state, evaluates evidence, activates selected kits, renders structured kit triggers, and compiles canonical policies to host hooks. The gate semantics underneath — definitions, runs, evidence, route-back — belong to Kontour Flow.

Kits supply the workflow. Builder and Knowledge are examples on the engine, not the engine itself. The built-in catalog also includes Release Evidence and Veritas Governance, both useful proof points that a kit can be agentless and still run through the same manifest and gate model.

Process-discipline layer#

The four canonical policy classes are defined in the Runtime Hook Surface spec using a runtime-neutral vocabulary. Adapters translate them to the host's native hook format at three conformance levels: L0 (telemetry only), L1 (steering + stop-goal-fit warning), and L2 (all four policies with blocking capability).

Runtime and support matrix#

Tier Runtime Ships Conformance
Core harness Claude Code install + hooks + bundle L2 — reference implementation
Core harness Codex install + hooks + bundle L2 — reference implementation
Core harness Kiro install + hooks + bundle L2
Core harness opencode agents, skills, plugin, opencode.json L1 — no prompt-submit hook
Core harness pi extension, skills, AGENTS.md L1 — no stop hook
Official framework adapter AWS Strands (Python) integrations/strands/ spike/preview L0 + config protection via cancellation
Official framework adapter AWS Strands (TypeScript) integrations/strands-ts/ native-import preview shipped telemetry + native config protection; L2-targeted policies run through the conformance shim
Conformance-certified Community / third-party Self-certify Conformance kit in development

Documented gaps: opencode has no native prompt.submit-equivalent event; pi has no stop hook; Codex live hook influence on model context is limited; Strands TS workflow steering, quality-gate, and stop-goal-fit coverage is conformance-shim-only. The Runtime Hook Surface spec names every gap explicitly using the canonical event taxonomy.

Framework adapters#

The same canonical policies wire into agent frameworks as in-process language-native packages. integrations/strands/ contains flow-agents-strands, a Python HookProvider that emits the canonical telemetry taxonomy and enforces config protection via BeforeToolCallEvent cancellation — 76 unit tests, no Strands SDK required. integrations/strands-ts/ adds a native-import TypeScript preview with shipped telemetry callbacks and native config-protection blocking; workflow-steering, quality-gate, and stop-goal-fit policy coverage is exercised by the conformance shim only. See the spec for the full framework adapter mapping and minimum viable adapter pseudocode.

Quick Start#

Install into your workspace in one command:

npx @kontourai/flow-agents init --runtime <your-agent> --dest .

Where --runtime is claude-code, codex, kiro, opencode, or pi. Kits are opt-in. Activate Builder when you want its two gated flows: builder.shape (idea → slices → filed work items) and builder.build (selected work item → design probe → plan → execute → verify → PR → learn).

npx @kontourai/flow-agents init --runtime <your-agent> --dest . --activate-kit builder

Ask your agent to shape an idea:

Use Builder Kit shape. I want to add a progress indicator to the CLI output
so users can see what step the installer is on. Shape this into an executable
work item and stop at the backlog gate.

Then build it:

Use deliver for the issue you just filed. Pull it, probe the design, plan it,
implement it, verify it, and stop if any evidence is missing.

Each step has an evidence gate. The agent cannot proceed past a gate without the expected evidence — it either presents it or blocks and explains what is missing. See the Builder Kit Quick Start for a full two-minute walkthrough with worked examples and an explanation of what you observe at each gate.

For bugs:

Use fix-bug. Reproduce the problem, diagnose root cause, implement the fix, and verify the regression path.

Explore the docs#

  • Builder Kit Quick Start: Zero to a running, gated build flow in two minutes: install, shape an idea into a work item, build it through the builder.shape and builder.build flows, and see what the evidence gates do.
  • Engine and Kits: The canonical split: product-neutral engine, opt-in kits, catalog + kit.json plugin model, structured workflow triggers, and marketplace metadata with no runtime privilege.
  • Workflow Usage Guide: Every stage from shaping ideas to learning review, with example prompts and expected behavior.
  • Builder Codex PR Review: Adopt advisory exact-head Codex review in publish-learn, publish inline findings, and route blocking evidence back to implementation without giving the reviewer write authority.
  • System Guidebook: The plain-language map of how Flow Agents is assembled and how it should feel to use.
  • Parallel-Session Coordination: Run many sessions against one repo without collisions: the two-stream model (liveness + assignment), the four guard points, the one hard publish fence, and how delivery defends itself.
  • Workflow Map: See the core skills, gates, artifacts, and route-back behavior.
  • Kit Authoring Guide: Build your own Flow Kit from scratch: directory layout, kit.json, a flow file, validation, local install, and activation.
  • Flow Kit Repository Contract: Full validation rules, registry schema, activation diagnostics, and the install/update/force semantics.
  • Knowledge Kit: Gated knowledge storage with five pipeline flows, a representation-neutral store contract, default and Obsidian adapters, an extensive automated test suite, and a parameterized contract suite any adapter can run.
  • Runtime Hook Surface: Canonical event taxonomy, four policy classes, conformance levels L0/L1/L2, and host mapping tables for adapter authors.
  • Vision and Direction: The kits-as-ecosystem arc (authoring today → domain kits → registry → marketplace), TypeScript framework adapters, and Kontour Console as the unifying telemetry surface.
  • North Star: The product promise, design principles, operating layers, and roadmap.
  • Developer Architecture: Flow Agents' coordination role, product boundaries, artifact flow, and cross-product vocabulary.
  • Safer Execution: Choose local, worktree, container, cloud, or privileged execution boundaries deliberately.
  • Governance Evidence: Attach optional Veritas readiness reports without making governance tooling mandatory.
  • Eval Strategy: How static, integration, behavioral, and artifact evals validate the bundle.
  • Artifact Lifecycle: Check in reviewable change work while promoting completed behavior into durable docs before merge.
  • Provider Adapters: Map provider-neutral work items, boards, published changes, checks, and evidence to GitHub-first adapters.
  • Repository Structure: The canonical source, generated output, runtime state, package, docs, eval, and cleanup boundaries.
  • Resource Contracts: The shared resource shape for durable workflow state and sidecars.
  • Developer Reference: The generated repo map: commands, agents, skills, scripts, and contracts.
  • Integration Examples: Worked examples for harness runtimes (Claude Code, opencode, pi), framework adapters (AWS Strands), and third-party self-certification with the conformance kit.

The Kontour family#

Kontour AI shows the work behind AI. Flow proves why a process was allowed to advance. Veritas makes AI-authored code changes inspectable. Survey and Surface carry the evidence underneath. Flow Agents packages those foundations into the agent tools you already use — so trustworthy autonomy doesn't require a perfect prompt, perfect memory, or a new runtime.

Why it matters#

Long-running agent work fails when the model loses context, skips verification, or calls partial work done. Flow Agents makes the process explicit without making the user write a perfect prompt every time. The agent gets a workflow; the developer gets artifacts they can inspect.

Documentation

Start Here

Concepts

Agent System GuidebookThis is the plain-language map of how Flow Agents is assembled and how it should feel to use. Engine and KitsFlow Agents is an engine you build on — not a single product, and not the Builder Kit. It has two layers: Operating LayersFlow Agents should stay understandable by keeping a small public vocabulary. Each layer has one job, one source-of-truth pattern, and one reason to exist. Flow Agents Skills MapThis map groups the current skills by the user journey they support. The Builder Kit workflow system is centered on concrete workflow skills, while Flow Agents coordinates Flow Kit installation, runt… Developer ArchitectureThis guide is the local starting point for Flow Agents maintainers who need to understand how this repository coordinates with Flow, Surface, Veritas, and Builder Kit. It describes the architecture f… Workflow Artifact LifecycleFlow Agents treats task artifacts as useful working memory, not permanent product documentation. Feature branches should promote durable planning, decisions, evidence pointers, and acceptance notes i… Verifiable Trust — tamper-evident doneFlow Agents treats "the work is done" as a claim that must be proven, not a status the agent gets to assert. Completion is gated by evidence the system re-derives, with two different trust tiers: Sandbox PolicyFlow Agents workflows should choose the smallest execution boundary that can produce useful evidence. Veritas Integration BoundaryVeritas owns both the standalone governance engine and the optional governance Flow Kit that teaches agents how to set it up and use its results. Flow Agents remains a neutral kit installer, activato… Flow Agents North StarFlow Agents is the agent-facing vertical of Kontour Flow. It makes agents more reliable than they are out of the box by surrounding them with just-in-time guidance, scoped capabilities, durable conte… Vision and DirectionThis page captures where Flow Agents is headed, clearly labeled as direction rather than shipped capability. Shipped artifacts are documented in the Runtime Hook Surface spec and the Runtime and supp…

Guides

Workflow Usage GuideThis guide shows how to use the Builder Kit workflow skills in normal chats. Parallel-Session Coordination GuideThis is the plain-language, end-to-end explanation of how Flow Agents lets many sessions work the same repository at once without two of them silently taking the same work, redoing each other's effor… Flow Kit Authoring GuideA Flow Kit is a portable workflow bundle you author once and install into any Flow Agents workspace. It lets you package one or more Flow Definitions — plus optional skills, docs, adapters, evals, an… Survey review transports for workflow hostsA workflow host can present evidence and proposed decisions in Survey's browser workbench or MCP App, retain the review events, and apply the result through its own workflow authority. Flow Agents al… Installed kit activation in native harnessesInstall a kit in its tooling bootstrap, then project its native discovery assets into the application: Configurable Workflow RoutingConfigurable workflow routing is the design for choosing which provider or profile should handle each Flow Agents workflow slot. It belongs to the workflow and agent/provider-selection layer: it name… Work Item And Change AdaptersFlow Agents uses provider-neutral workflow vocabulary and maps it to concrete tools through adapters. GitHub is the first adapter and the most common example, but core workflow gates should talk abou… Knowledge KitThe Knowledge Kit is a Flow Kit for durable, gated knowledge storage. It packages a store contract, five pipeline flows, pluggable store adapters, and a parameterized contract test suite — all valida… Builder Codex PR reviewThe Codex PR review action is an optional CheckProvider producer for Builder Kit's third stage. It reviews the published pull request at the composed builder.publish-learn step merge-ready-ci; it doe… Survey Utterance Check IntegrationWhen an agent says something factual — "test coverage is 92%", "the API is backward-compatible", "no breaking changes in this release" — that claim either has evidence behind it or it doesn't. The ut… Agent Usage Feedback LoopThis document defines the usage feedback loop for comparing agent runs across repositories, runtimes, profiles, prompts, skills, and future setups. The measurement schema is runtime-neutral: every ru… Integration ExamplesFlow Agents reaches host runtimes and agent frameworks through two distinct distribution models. This section provides worked examples for each model and a guide to the conformance kit for third-part… Harness InstallThis page walks through three harness installs: Claude Code (the L2 reference runtime), opencode, and pi. All three follow the same model — npm run build:bundles generates the bundle, flow-agents ini… Framework AdapterThis page walks through the integrations/strands/ reference implementation: a Python HookProvider for AWS Strands Agents. It covers how to construct FlowAgentsHooks, what telemetry it emits, how the… ConformanceThis page explains how a third-party adapter self-certifies against the Flow Agents policy engine contract. It covers the engine contract version 1.0, how to run the conformance kit, what each confor… Knowledge Kit Live ExampleThis page documents integrations/strands/examples/knowledge_kit_live.py: a keyless, ollama-backed end-to-end proof of the Knowledge Kit's ingest and compile flows running against a real Strands agent. Flow Agents × Kontour ConsoleFlow Agents' coordination substrate is local-first and complete on a single machine — the local liveness stream plus the GitHub AssignmentProvider give you full parallel-session safety with no server…

Reference

Public Workflow CLIFlow Agents exposes its supported consumer workflow surface through the primary package binary. Consumer repositories do not need a package.json, a local dependency, or a repository-owned writer scri… Runtime Hook Surface SpecThis document is the canonical reference for adapter authors who need to surface Flow Agents canonical policies and telemetry events on a new agent runtime or framework. It is runtime-neutral: the po… Builder Flow RuntimeBuilder Kit build sessions use Flow as the authority for steps, gates, transitions, route-backs, and attempt limits. Flow Agents supplies the agent-facing adapter: it starts or loads the canonical ru… Flow Kit Repository ContractA Flow Kit repository is a local folder with a root kit.json. Flow Agents validates the repository shape, declared paths, declared assets, fixture behavior, and diagnostics. Flow validates Flow Defin… Kontour Resource ContractKontour Resource Contracts are the durable, versioned record shape for Flow Agents configuration, selected scope, workflow state, evidence pointers, provider output, and cross-product interchange. Shared Workflow ContractsThe workflow system now separates durable process contracts from role-specific instructions. Kit observability contribution contractIssue #911 defines an optional, host-neutral declaration for a Flow Agents Kit that wants operational projections consumed by Console, Station, or another host. It is a read contract: a Kit owns proj… Docker worker host adapterThe public @kontourai/flow-agents/docker-worker export provides runCodexDockerWorker and parseCodexEvents. @kontourai/flow-agents/provider-broker provides startProviderProxy; @kontourai/flow-agents/s… System Git provenance for local inspectionLocal committed configuration and immutable history inspection use fixed system Git paths. Repository files, ambient PATH, Git environment variables, and configuration cannot select the executable. G… Harness-capability matrixThe signals a feature can rely on depend on which runtime/harness the kit is hooked into. State the coverage; never assume it, never fabricate the gap. Host integration conformanceGenerated from conformance/host-conformance.json. Do not edit by hand. adapter-contract rows prove Conduit's projection contract only; runtime selection requires host-bound evidence generated by the… kontour.console.economics — per-run economics record contract (v0.2)Status: ratified (flow-agents #349). Kind: kontour.console.economics. Version: 0.2. kontour.learning-review-proposals — kit/gate tuning proposal contract (v0.1)Status: ratified (flow-agents #352). Kind: kontour.learning-review-proposals. Version: 0.1. Routing-efficiency reviewTurn recorded delegation outcomes into advisory proposals about which model each role should route to — the #409 small-model value proof, pointed inward at our own agent fan-out (#415). Standards RegisterFlow Agents should reuse durable standards and common conventions before inventing local formats. This register records the standards Flow Agents intends to align with and where Flow Agents-owned sch… Context MapGenerated by npm run context-map. Regenerate after changing agents, skills, schemas, workflow contracts, or core commands. CI Compute BudgetFlow Agents uses two repository-wide native job concurrency groups: flow-agents-compute-1 and flow-agents-compute-2. Every participating job sets queue: max and cancel-in-progress: false. The names c…

Decisions

Decision IndexGenerated by corpus decisions index. Do not edit by hand. Topic-keyed living decision records; the format is described at https://github.com/kontourai/corpus/blob/main/docs/decisions.md. Numbered ADR… Agent coordinationDecision. Parallel-session coordination is a two-stream join: an ephemeral, TTL-reaped liveness stream ("who is working now") and a durable assignment record ("who owns this") are joined at read time… Anti-gaming trust securityThis subject has provenance in frozen ADR history (0017-anti-gaming-trust-security-model.md, 0018-freeze-local-shell-heuristics.md) but no living decision has been ratified yet under the topic-keyed… Backlog Readiness SourceWhich signal marks a Work Item intentionally ready for pickup, and what pull-work is allowed to do when that signal yields nothing. Console record deliveryDelivery class is a property of the record class, declared once. It is not a per-script choice, and it is not decided by which transport a caller happened to reach for. Context lifecycleThis subject has provenance in frozen ADR history (0013-context-lifecycle.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contracts/decision-registry… Core vs domain kit boundaryThis subject has provenance in frozen ADR history (0014-core-vs-domain-kit-boundary.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contracts/decisio… Decision recordsNew decisions are recorded as topic-keyed living decision records at docs/decisions/<topic-slug>.md, one file per decision subject. Numbered ADRs (docs/adr/NNNN-*.md) are frozen history and are never… Embeddable engine and adapter modelDecision. Flow Agents is one runtime-agnostic engine with thin adapters on the edges. A development harness (Claude Code, Codex, opencode, pi, Kiro) and a customer agent built on a framework/SDK (AWS… Flow / Flow Agents boundaryThis subject has provenance in frozen ADR history (0015-flow-flow-agents-boundary-reconciliation.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/cont… Flow KitThis subject has provenance in frozen ADR history (0002-flow-kits-as-extension-unit.md, 0003-flow-agents-coordinates-kits-and-adapters.md) but no living decision has been ratified yet under the topic… Flow / Skill / Kit / Tool boundaryThis subject has provenance in frozen ADR history (0007-flow-skill-kit-tool-boundary.md, 0007-skill-audit.md) but no living decision has been ratified yet under the topic-keyed decision registry (con… Graph knowledge providerThe Knowledge Kit ships a neo4j knowledge-store provider: a real, queryable graph implementation of the #317 read interface, synced from the file/work-item providers. It is the OWNER'S OPT-IN persona… Hook core/kit boundaryThis subject has provenance in frozen ADR history (0009-canonical-hook-core-kit-boundary.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contracts/de… Kit dependency ownershipThis subject has provenance in frozen ADR history (0019-kit-dependency-ownership.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contracts/decision-r… Kit operation boundaryThis subject has provenance in frozen ADR history (0008-kit-operation-boundary.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contracts/decision-reg… Knowledge promote sub-flowSession promotion runs through a Knowledge Kit FlowDefinition (kits/knowledge/flows/promote.flow.json, id knowledge.promote) with four steps — ingest → distill → link → health — so promotion quality… Knowledge store providerThe Knowledge Kit owns a storage-independent Knowledge Graph model — typed nodes (note, decision, issue, session, person; extensible), a closed edge vocabulary (supersedes, merged-into, blocks, evide… Kontour Resource ContractThis subject has provenance in frozen ADR history (0005-kubernetes-inspired-resource-contracts.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contra… MCP postureThis subject has provenance in frozen ADR history (0011-mcp-posture.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contracts/decision-registry-contr… Model routingWhich model backs which delegate role is data resolved by the orchestrator at delegation time, not code baked into generated files or per-agent frontmatter. Portable host integration boundaryFlow Agents consumes @kontourai/conduit as the owner of portable host adapter contracts: lifecycle projection, context and deny fidelity, portable asset installation receipts, capability declarations… Promotion gateArchiving a delivered session is gated on promoting its durable residue. The sequence is final acceptance -> promote -> archive; durable-residue extraction is the archival act, not a parallel checkli… Standing directivesRatified owner directives get a durable, quotable home at context/contracts/standing-directives.md instead of living only in the ephemeral context of whichever orchestrator session ratified them. Survey evidence for paused Flow gatesFlow Agents provides a library adapter for a host that has a server-owned Survey review session and needs to continue an already-paused Flow gate. The host configures a review-session resolver capabi… Three-hard-boundary modelThis subject has provenance in frozen ADR history (0016-three-hard-boundary-model.md) but no living decision has been ratified yet under the topic-keyed decision registry (context/contracts/decision-… Trust-ledger retention and console-as-projectionDecision. Git is the authoritative store for trust bundles and delivery records; the Console (and any hosted DB projection) is a rebuildable, queryable projection over them, never the source of truth… Trust-reconcile and delivery reconciliationDecision. The CI trust anchor is retired. The Trust Reconcile workflow, the trust-verify composite action, CI attestation minting (scripts/ci/mint-attestation.js), the flow-agents verify subcommand,… TypeScript-first source policyKontour product and runtime source defaults to TypeScript across Flow, Flow Agents, Surface, Veritas, and kontourai.io. New durable product code, runtime adapters, package APIs, CLI behavior, workflo… Workflow EnforcementDecision. A new Workflow Run always starts at the first step declared by its canonical Flow Definition. A caller cannot choose a later starting step, and metadata such as an ad-hoc reason cannot gran… Workflow trust stateThis subject has provenance in frozen ADR history (0004-gates-expect-surface-claims.md, 0010-workflow-trust-state-as-hachure-bundle.md) but no living decision has been ratified yet under the topic-ke… Workspace Kit SelectionFlow owns the Kit container and Flow semantics. Flow Agents owns explicit workspace selection, portable artifact locking and local resolution. The v1 contract is directory-scoped and works without Gi… Writer-observed executionDecision. When record-gate-claim executes a declared evidence command itself (runObservedCommand — a real process it spawned, with a real exit code, output hash, and, for tests, a local-process-exit…

Contribute

Contracts

Source: docs/index.md