❯ Task<T>
GitHub ↗
MODELS AS FUNCTIONS / WORKFLOWS AS PROGRAMS

Stop trusting the agent.
Program the workflow.

A typed runtime for composing local LLMs, cloud models, tools and deterministic code into explicit zero-trust agent workflows.

❯ unsafe agent autonomy → typed task graph → controlled effects
security-check.scalaTYPECHECK
val repo: Secure[Secret, Repo] = workspace.repo

val analysis = localReasoner(repo)   // OK
val review   = cloudReviewer(analysis)

error: Secret data cannot flow
       into Cloud execution domain.
WHY / THE AGENT IS NOT THE SECURITY BOUNDARY

LLMs are useful workers.
They are not trusted principals.

Hallucination, prompt injection and cloud data transfer make prompt-level permission rules an unreliable security boundary. The workflow needs a deterministic layer that decides what data may flow where, and which effects may actually commit.

Prompt-driven agent

  • “Do not leak secrets.”
  • “Ignore malicious instructions.”
  • “Only run safe commands.”
  • One model often observes, decides and acts.

Typed workflow

  • Secret → Cloud is not type-correct.
  • Untrusted input cannot directly drive privileged steps.
  • Effects are explicit values in the program.
  • The runtime commits actions, not the LLM.
CORE TYPES / FIVE ORTHOGONAL AXES

The workflow carries its constraints
in the types.

Task[T]

Task[T]

A delayed computation that yields T when executed. An agent-specific semantic layer lowered onto an existing async runtime.

Agent[D, I, O]

Agent[Domain, Input, Output]

A typed callable that maps I → O. Its execution domain describes Cloud/Local, Networked/Sandboxed and Probabilistic/Deterministic constraints.

Effect[E, T]

Effect[FileWrite, RepoState]

A computation that changes the current environment with effect E while producing T.

Secure[L, T]

Secure[Secret, Repo]

Information-flow label: Public < Private < Secret. Combining values raises to the stricter level; implicit downgrade is forbidden.

Trusted[T] / Untrusted[T]

Trusted[Facts]

Prompt-consumption trust. Trusted does not mean “mathematically true”; it means the workflow policy considers the data safe enough to enter ordinary agent prompts.

Raw LLM ABI

String → String

Raw models stay untyped. Encoders and decoders lift them into typed agents so the workflow only sees semantic values.

DSL / THE WORKFLOW IS THE PROGRAM

Small agents do one job.
Code composes the system.

fix-issue.scalaSCALA 3 EMBEDDED DSL / SKETCH
val issue = github.issue(412)
val repo  = workspace.repo

val analysis = local(qwen).analyze(repo, issue)

val patches = parallel(
  worktree("qwen")   { local(coderA).patch(analysis) },
  worktree("frontier"){ cloud(coderB).patch(declassify(analysis)) }
)

val best    = judge(patches)
val checked = verify(best)
val result  = runTests(applyPatch(checked))

result.retryWith(local(strongerModel))
MODELA first-class typed function selected explicitly or resolved by the runtime.
WORKTREEParallel agent attempts can own isolated Git branches/worktrees instead of sharing mutable workspace state.
VERIFYOpen-ended generation produces candidates; deterministic policy gates decide what may cross trust/effect boundaries.
ASYNCTasks can lower to existing JVM async/effect runtimes for timeout, cancellation, retry and structured concurrency.
EXECUTION GRAPH / THE DSL BECOMES THE RUNTIME PLAN

The program is compiled into
typed execution nodes.

The graph mirrors the DSL: values keep their security/trust wrappers, each Agent node carries its execution domain, and only explicit Effect nodes are allowed to mutate the environment.

input / issue
github.issue(412) Task[Trusted[Issue]]
input / workspace
workspace.repo Secure[Secret, Trusted[Repo]]
analysis
local(qwen).analyze(issue, repo) Agent[LocalSandboxed, Input, Analysis]
parallel patch generation
worktree("qwen") local(coderA).patch(analysis)
worktree("frontier") cloud(coderB).patch(declassify(analysis))
collect
patches Task[Vector[Candidate[Patch]]]
policy gate
judge → verify Candidate[Patch] → Verified[Patch]
effects
applyPatch → runTests Task[Effect[FileWrite + ProcessExec, TestResult]]
typed value/tasksecret/local boundaryeffectful nodecloud domain
ZERO TRUST / LET THE TYPECHECKER SAY NO

AI can be wrong.
The runtime limits what wrong can do.

ATTEMPTRESULTWHY
CloudAgent(Secret[Repo])REJECTSecurity level is incompatible with the execution domain.
Executor(Untrusted[WebPage])REJECTUntrusted external content cannot directly drive privileged execution.
apply(Candidate[Patch])REJECTThe effect requires a verified patch.
LocalAgent(Secret[Repo])ALLOWThe local domain is permitted to consume secret data.
type error: Secure[Secret, Repo] cannot be lowered into CloudAgent input.
✓ workflow accepted: all information-flow and effect constraints satisfied.
WORK IN PROGRESS / BUILDING IN PUBLIC

This runtime is still
under active design.

The type system, DSL and execution model are still being shaped. The first implementation target is a Scala 3 runtime for local-first LLM workflows with explicit orchestration, model routing and zero-trust boundaries. View the source on GitHub ↗

Work in progress. Leave an email if you want project updates or early access.