Month-end close
- Starts
- on a schedule
- Shape
- up the hierarchy: entity, region, group
- Review
- a controller approves between levels
Pyrana Harness
The Pyrana Harness is the agent runtime and the orchestration layer: native tool calling, planning, subagents, checkpoints, and resume, on durable workflows that fan out, wait, retry, and finish, scheduled or on demand. Every child call re-enters the gate. Every lane produces one execution record.
identity resolved, idempotency claimed, audit written
explicit steps, written through tools, not hidden state
tools, subagents, extensions with delegated tokens
checkpoint; suspend for a person or an external result
paused · awaiting approvaldeclared finish conditions: required artifacts, packet schemas
receipts, effects, versioned resources, one causal trace
00Inside an agent
Every agent runs the same governed loop. Configuration decides what it knows, what it may use and when it is done.
Block 3 on the platform picture, opened up. Unpack it into what an agent is given, what it may use and what it leaves; walk the six steps of the loop; then fold it back into one configuration.
Every agent runs the same governed loop. Configuration decides what it knows, what it may use and when it is done.
3Inside the block
Every agent runs the same governed loop. Configuration decides what it knows, what it may use and when it is done.
01Why a runtime
Each agent in an App is configured for one job: a system prompt scoped to the use case, the tools for its data, and a library of files it discovers progressively. A model is assigned per agent through provider adapters and is not switched mid-run. For data shaping, the runtime provides a code interpreter environment that runs deterministic scripts the agent calls, so the same input yields the same output. The Harness owns the loop discipline: explicit plans, tools with declared effects, checkpoints that survive a restart, and finish conditions the model cannot bypass.
02Execution lanes
The gate is common. Execution semantics are not forced to be. The App routes each target to the lane that fits; deterministic work never touches a model.
| Lane | When | Why |
|---|---|---|
| Direct | Deterministic work: no model, no harness, no workflow engine. | Lowest latency and cost. Smallest attack surface. |
| Agent | Adaptive work with native tool calling, subagents, suspension for human input, checkpoint and resume. | Every child tool call re-enters the gate. No ambient tool access. |
| Workflow | Durable graphs on Temporal, including graphs authored at runtime; fan-out per entity and per group. | Suspend, checkpoint, and resume after any interruption. |
| Batch | One target run across many entities at once. | Per-entity identity, status, and result under the same gate. |
| Event | Schedules, webhooks, and system events trigger direct or agentic work. | Continuation is explicit: NEW, JOIN, or NONE. An invalid join fails closed. |
03Fan-out
One workflow dispatches specialized agents per entity and per group. Pyrana Capital, a synthetic portfolio, has nine operating companies in three groups under one holding company. For each operating company the monthly workflow runs three agents, revenue, materials, and labor, each scoped to its entity, its period, and the tools for its data: the agent passes the entity and the period, the tool holds the query. No agent writes a free-form query.
Outputs publish back to the App as versioned resources and roll up: operating company to group, group to holding company. Each agent reads what siblings and prior runs published, so the June analysis can reference May's. Every child execution passes the gate and leaves its own record under the parent.
one June run · 45 agent executions · 36 published references
03bInside a workflow
A workflow decides who works, in what order, what waits for what, and when a person checks. The Pyrana Harness keeps the run going until it finishes.
Levels follow levels; a person can review between them; one failed entity is rerun on its own.
Any workflow is one configuration
workflow_key: demo.financial_analysis
mode: deterministic
orchestration:
type_order: [opco, group, holdco]
agents_by_type:
opco: [action_demo_sales_analyzer, action_demo_labor_analyzer,
action_demo_materials_analyzer, action_demo_pl_analyzer]
group: [action_demo_group_sales, action_demo_group_labor,
action_demo_group_materials, action_demo_group_pl]
holdco: [action_demo_holdco_pl]
wait_mode: per_parent # each group starts when its own companies are done
hierarchy_nodes:
- {id: PMW, type: opco, parent: IND}
# ... 8 more companies
- {id: IND, type: group, parent: PYRANA}
# ... 2 more groups
- {id: PYRANA, type: holdco}
agent_dependencies:
action_demo_pl_analyzer:
- action_demo_sales_analyzer
- action_demo_labor_analyzer
- action_demo_materials_analyzer
input_contract:
enforcement_mode: strict
json_schema: {required: [period]}One workflow = one configuration.
Same shape, any process
03cNumbers by code
The figures people rely on are computed by tested code the agents call: named data calls and scripts. The agents write the words.
Formulas run in code, not in the model. The agent reads the result and writes the words, citing the figures it used.
Any calculation is one configuration
source_name: pyrana-demo-data-api
tools:
- name: entity-monthly
description: "Monthly P&L for a single OpCo. Returns revenue, costs,
margins with MoM/YoY deltas and trailing averages."
input_schema: *entity_period_schema # entity_id, start_period, end_period
page_execution:
read_only_attested: true
http_config:
payload:
json:
sql: |
SELECT *
FROM public.vw_demo_entity_monthly
WHERE entity_id = '{{input.entity_id}}'
AND period_id BETWEEN '{{input.start_period}}' AND '{{input.end_period}}'
ORDER BY period_id
output:
artifact_path: "entity_monthly_pnl.json" # the agent reads it as a file
max_rows: 1000
# ... 42 more named data callsOne calculation = one configuration. Figures come from tested code.
04Approval as policy
A tool approval policy inspects amounts, membership, existence, and compound rules. Above threshold, the invocation, its arguments, scope, and evidence freeze into a durable proposal the waiting agent cannot alter. Each named approval lane receives an independent obligation. Reviewer eligibility is checked at decision time. The frozen invocation is revalidated before it dispatches exactly once, and an ambiguous provider outcome goes to reconciliation rather than a blind retry.
Policies compose restrictively: a platform floor cannot be loosened by an App or an agent setting. A queued request is visibly different from a posted entry.
Go deeperApproval is a policy, not a boolean7 minpolicy over typed argumentsbuilt
05Durable execution
Workflows are directed graphs of tasks with declared dependencies, retries, timeouts, and budgets, hosted on Temporal workers. The scheduler is deterministic and durable: it tracks node and item state, preserves partial results, and resumes after a worker or process interruption. The idempotency key claimed at the gate means a verified replay rejoins the prior result instead of starting duplicate work.
The platform is hosted as SaaS on a dedicated private tenant, or deployed into the client's own infrastructure for large enterprises. Workers scale horizontally, and separate worker pools handle data fetching, file extraction, and the code interpreter, so a large extraction does not compete with an interactive run.
06One causal trace
Gate decision, model calls, tool calls, subagents, approvals, effects, context use, and outputs are correlated under one execution identity. Traces, tokens, and tool errors are available as JSON for every run. The same evidence supports evaluation of an execution, an agent, a workflow, or an App version; deterministic checks (token growth, tool error rates) come first, then an LLM-as-judge stage in Agent Studio.
07Questions
Admit, plan, act, observe, validate, publish. On the client's systems, under the client's rules.