Business-as-Code
Business-as-Code is the practice of writing a business's operations as code. Each line is a typed sentence, such as $.Customer.placed.Order, that people read as plain English and AI agents can execute. Events, relationships and workflows share one grammar, kept in version control, so agents run the business while people approve the decisions that matter.
How does a line of Business-as-Code read?
Every line is a sentence with a subject, a predicate and an object. In $.Customer.placed.Order, Customer is the subject, placed is the predicate and Order is the object, so the line reads as "A customer placed an order." The $ opens the sentence and each dot joins the next word.
$.Customersubject.placedpredicate.Orderobject
What can Business-as-Code describe?
Three kinds of statement cover a business. Events are past tense facts: an order was created, a payment was processed. Relationships are present tense links: a customer has an order, a business owns a brand. Workflows are future tense rules: when a ticket comes in, classify and assign it.
import { on, send, $ } from 'sdk.do' // Orders: paid, packed and confirmedon.Order.created(async order => { await send($.Payment.process, order) await send($.Inventory.allocate, order) await send($.Email.send, order)})A workflow written with the sdk.do package. When an order is created, its three next steps run.
How do AI agents use Business-as-Code?
Agents read and run the same lines people write. A call such as db.list($.Business) works the same from the TypeScript SDK, the do command line, the Model Context Protocol tool do and the REST API at apis.do. Agents work on their own and escalate to a person when their confidence drops below a threshold you set.
await client.useTool('do', { script: 'db.list($.Business)'})do db.list($.Business) curl https://apis.do/businesses \ -H "Authorization: Bearer $API_KEY"Where do the nouns and verbs come from?
Schema.org.ai, O*NET and 43 published standards come built in, so agents know what an Order is. That covers 969 Schema.org.ai types: every Schema.org type, such as Organization, Order and Invoice, plus the .org.ai types for work machines do, such as Agent and Workflow. It also covers 1,016 O*NET occupations, such as Accountants and Auditors, and standards such as GS1, NAICS and ISO 4217 from standards.org.ai. Because the vocabulary is shared, a line written by one team or agent means the same thing to every other.
How is Business-as-Code different from Infrastructure-as-Code?
Infrastructure-as-Code describes servers, networks and deployments in code, so they can be reviewed, versioned and reproduced. Business-as-Code applies the same idea to the business itself: customers, orders, decisions and the work between them. Infrastructure-as-Code lets software provision machines; Business-as-Code lets AI agents run operations.
What is Services-as-Software?
Services-as-Software is work that people have traditionally sold as a service, such as support, bookkeeping or sales outreach, delivered instead by software and AI agents. Business-as-Code is how .do expresses that work, so agents can do it and people can read exactly what they will do.
Sources
- Org.AI FoundationAn open record of human work: 1,016 occupations and 18,796 tasks
- Schema.org.aiEvery Schema.org term, plus the .org.ai superset
- Standards.org.aiThe register of standards the Org.AI Foundation keeps and writes
- Primitives.org.aiThe fundamental abstractions for building AI-native software
- MDX.org.aiDocuments that combine structured data, content, code and components
- id.org.aiSign-in for humans and AI agents
- .org.ai on GitHubThe open-source repositories
- Infrastructure as codeWikipedia, on the practice Business-as-Code extends
- Model Context ProtocolHow AI assistants call tools such as
do