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.
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.
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.
The workflow carries its constraints
in the types.
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]
A typed callable that maps I → O. Its execution domain describes Cloud/Local, Networked/Sandboxed and Probabilistic/Deterministic constraints.
Effect[E, T]
A computation that changes the current environment with effect E while producing T.
Secure[L, T]
Information-flow label: Public < Private < Secret. Combining values raises to the stricter level; implicit downgrade is forbidden.
Trusted[T] / Untrusted[T]
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
Raw models stay untyped. Encoders and decoders lift them into typed agents so the workflow only sees semantic values.
Small agents do one job.
Code composes the system.
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))
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.
AI can be wrong.
The runtime limits what wrong can do.
| ATTEMPT | RESULT | WHY |
|---|---|---|
| CloudAgent(Secret[Repo]) | REJECT | Security level is incompatible with the execution domain. |
| Executor(Untrusted[WebPage]) | REJECT | Untrusted external content cannot directly drive privileged execution. |
| apply(Candidate[Patch]) | REJECT | The effect requires a verified patch. |
| LocalAgent(Secret[Repo]) | ALLOW | The 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.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 ↗