FAOPs: Normal Forms and an Algebra for AI Agent Workflows
Organizations: JPMorgan Chase & Co.
Abstract
Organizations increasingly encode operational procedures as multi-step agent skills, here called Agent Operating Procedures (AOPs), that must be traceable, auditable, reproducible, access-controlled, and bounded in time and cost, requirements that regulated sectors make mandatory. Yet AOPs are typically kept as coarse-grained files, in which steps bundle actions, copied procedures drift apart, any step may reach any tool, and refactoring goes unchecked. We present Functional Agent Operating Procedures (FAOP), a formal theory that brings database-grade discipline to AI agent workflows. FAOP recasts each workflow as a typed function over scoped state and subjects an entire library to four progressive normal forms: Decomposed (FNF-1) splits a workflow into atomic steps, Typed (FNF-2) makes its data flow explicit and type-checked, Factored (FNF-3) gives each shared procedure a single canonical definition so a change propagates instead of drifting, and Scoped (FNF-4) confines every step to least-privilege tool access. Once normalized, every atomic step is a separate entity with a declared contract and can be type-checked, scope-confined, bounded, tested, traced, and audited on its own. A FAOP algebra of provably sound equalities turns refactoring and parallelization into compiler rewrites; orthogonal extensions add verified termination (+V), optimization (+O), and time and cost bounds (+B); and an architectural-level classifier (0-3) determines whether a workflow needs AI at all. Together, these make integrity, isolation, typing, termination, cost, and optimization compile-time concerns across the whole library, not runtime hopes. We implement the theory in SkillBase, an AOP management system (what PostgreSQL is to data, SkillBase is to AOPs), together with a separate executor that enforces these guarantees at run time. A worked financial workflow illustrates the approach end to end.
Figures & tables
| LoanID | Customer | Address | Phone | Branch | BranchMgr | Amount |
|---|---|---|---|---|---|---|
| L001 | Alice | 10 Main St | 555-1234 | Downtown | Diana | 50,000 |
| L002 | Alice | 10 Main St | 555-1234 | Downtown | Diana | 25,000 |
| L003 | Carol | 7 Oak Ave | 555-5678 | Uptown | Dave | 80,000 |
| Primitive | Notation | Reading |
|---|---|---|
| Action | any single unit of work (for example, a tool call) | |
| Sequence | apply , then | |
| Branch | apply if , else | |
| Loop | apply until | |
| Interrupt | suspend with query ; resume by passing the response to continuation | |
| Checkpoint | persist the running state to internal storage |
| Dimension | Symbol | What it constrains | Example |
|---|---|---|---|
| Tools | Which tools, APIs, or functions the step may invoke | {account_db, ledger_api} | |
| Guardrails | Constraints the step must obey | {no_pii, on_topic, requires_confirmation} |
| Law | Optimization | Effect |
|---|---|---|
| L1 | Safe instrumentation | Insert or remove a pure value step (logging, a metric) without changing the surrounding function. |
| L2 | Sub-workflow extraction | Regroup a sub-sequence and register it as a FAOP under FNF-3. |
| L3 | Auto-parallelization | Schedule independent steps with , reducing wall-clock time. |
| L4 | Branch-specific optimization | Push the shared post-branch step into each arm so each copy is optimized for that arm. |
| L5 | Canonical reuse | Replace an inlined sub-sequence by to its registered body (FNF-3). |
| # | Benefit | Effect under FAOP | Source |
|---|---|---|---|
| 1 | Integrity across workflows | Compiler rejects dependents that become inconsistent when a shared step changes. | Registry |
| 2 | Scope isolation | Each step sees only its declared tools; depth cannot add tools absent from an ancestor. | FNF-4 |
| 3 | Type safety | Compiler verifies before deployment. | FNF-2 |
| 4 | Auto-parallelization | Independence proves disjoint dependencies; siblings are scheduled concurrently. | FNF-2, +O |
| 5 | Dead-step elimination | Every leaf with no downstream consumer is removed. | Algebra, +O |
| 6 | Interrupt batching | Independent interrupts with disjoint keys merge into one form. | +O |
LLM Agent Workflow Optimization
LLM agent workflow optimization studies how to design and run multi-step agents for better task success, reliability, latency, and cost.
See all 256 papers