# Agent platform 2027: the architecture of companies that run on agents

> Ten principles for building agents and company software: the company defined in code, one agent that acts as whoever is talking, a system of record instead of a shared filesystem, chats kept apart from traces, credentials the model never holds, and signals, workflows and apps as code.

Updated 2026-11-23.

An agent that does real work in a company needs three things a model does not supply: records it may change only through rules, an identity to act as, and a place where people see what it did. These are the principles we build SegmentStream on, one claim each.


## 1. The company is defined in code

A company's agent, data model, permissions, pipelines, connections, event streams and apps are declared in one repository, reviewed like any code and deployed as a whole. The platform's interface shows what is deployed; it does not edit it.

Settings stored in a console drift away from review, history and rollback. Settings in code have all three, and a coding agent can read and change them. Only what code cannot hold is managed live: secrets, authorizations, members and access.

The repository holds behaviour, never business data. Everyone with access to the code reads every file and every past commit, while records are shown only to those allowed to read them.

## 2. One agent, many people

A company needs one agent, defined once, rather than a fleet of agents that each re-implement the company's rules. What differs from person to person is around the agent: its persona, model, skills, tools and whether someone reviews its replies follow the roles of the person it is talking to.

The definition is separate from its instances. A session is the agent's memory of one chat: it outlives deployments and ends when the chat goes idle. Work a workflow hands the agent runs in a session of its own. One definition means one set of instructions to review and one place to fix a mistake.

## 3. A system of record, not a shared filesystem

Agents need shared state, and a filesystem is the wrong primitive for it. A file has no rules for how it may change, no permission finer than its folder, and no history of who decided what.

The shared state is the company's **system of record**: typed entities and their relationships, the **actions** that change them, roles that may read and run each one, metrics defined once, and the history of every change. An action is the only way to change a record, and every read and every action needs a permission. People, workflows and the agent are held to the same rules, and a refused change comes back with its reason so the agent can correct its input.

Files still exist, as properties of records, read with the record's permission. The agent's computer is a workbench, not a store: a sandbox where it unpacks an archive or reads a scanned document, by default with no network and no credentials. Nothing there outlives the work, so there is nothing for agents to configure or for people to secure. What must last becomes a record.

## 4. Decisions and observations live apart

A company's data has two kinds of value. What a person or an agent decides, such as a status, an approval or a correction, is a record, changed by an action and kept with its history. What a machine reports or a model computes, such as orders, spend or a forecast, is a table in the warehouse, rebuilt by pipelines.

The test is who sets the value. If the next pipeline run would overwrite it, it is an observation. If someone needs to know who changed it and why, it is a decision. A number over many records is a metric, never a stored field, so every app, report and agent gives the same answer.

## 5. Every action has an actor

Every call the agent makes runs as a specific identity with that identity's current permissions. In a chat, it is the person who wrote: a member whose messenger account is linked to their sign-in, a member in the company's own app, or an anonymous visitor with a guest role and its limits. In a workflow, it is the workflow's own identity, holding exactly the workflow's role.

History names the person or workflow behind every change and the chat it came from. Removing a member stops the agent for them at once. There is no agent superuser and no shared key. A workflow's role stays narrow on purpose: a record the agent reads may carry untrusted text, and the role, not the prompt, is the boundary.

![The console's role comparison: each read and action of every entity, the permission it requires, and which roles grant it](https://segmentstream.com/screens/dark/console-roles-compare.webp)

*Every read and every action requires a permission, and roles grant them. The same check applies to people, workflows and the agent.*

Destructive, irreversible and external actions ask the person to confirm, and the permission is checked again before the action runs.

## 6. Credentials never reach the model

Connections to other services are declared in code. A member authorizes each one with whatever the provider offers, a consent flow or a token of their own, and the platform keeps the credential. Calls go through the connection, which applies its own access rules.

An agent that can read a secret can leak it, through a tool, a reply or an injected instruction. An agent that can only call a declared connection can at most misuse what its permissions allow, and that is in the history.

## 7. Chats and sessions are separate stores

People should see a chat: what they wrote, what the agent and staff replied, and whether it arrived. Builders need the session's trace: model calls, tool calls and retries. Different readers, lifetimes and privacy make them different stores, linked by id.


A chat should be stored once, in the company's own database, kept as long as its code declares. Tool calls do not belong in the chat, and the chat does not belong in the trace. The same goes for all telemetry: logs, metrics and traces are read where code runs, because a second copy is a second store of private conversations to secure and delete.

## 8. People stay in their channels; staff work an inbox

The agent talks where people already are: messengers, team chat, email, and a chat in the company's own app or website. A company can add a channel for any service with an API, and gets the same sign-in, limits, sessions, history and review as on the built-in ones.

Staff work an inbox of those chats. A member can take a chat over and hand it back, and the agent hands a chat to a person when it is asked to or when its instructions say so. Replies can be held for review by the role of the person they answer: never, always, or when a model judges the reply uncertain. A held reply is a record like any other, so approving, editing and rejecting it are actions with their own permissions, and a company can build its own review screens on them, as it builds any other app.

## 9. Signals and workflows are code

Events reach the company as webhooks from other services and as event streams from its websites and servers. Webhook deliveries are verified and start workflows; event streams land in the warehouse, where pipelines turn them into tables. A rule that watches for something, such as an unpaid invoice or a stale request, is one recurring sweep over the records that are due, declared in code. Agents do not create listeners at runtime: every watcher can be read and reviewed in the repository.

Work that runs on its own is a **workflow**: durable, made of steps, declared in code and started by a schedule, an action (after an invoice is approved) or a webhook. A workflow mixes fixed steps with the agent's judgement: a step that needs one generation calls a model, a step that needs tools and instructions hands the agent a task. Records still change only through actions, and steps are written to tolerate a retry.

## 10. Every company owns its apps

Every interface a company's people work in is an app in the company's own repository, started from a template the company then owns and changes. Usually a coding agent builds and changes it. The app reads records and metrics through the system of record, under the signed-in person's permissions, and holds no provider credentials and no access beyond what the platform admits.

Nothing of the platform is forked. The platform holds only mechanisms nearly every company needs, with neutral defaults and no wording of its own; each company decides how to use them and builds what only it needs in its own repository. Vertical software becomes a starting point a company owns, not a product it rents.

## Frequently asked questions

### Should a company run one agent or many?

One agent per company, defined in code, fits most companies. Its persona, model, tools and review follow the roles of the person it is talking to, so different people get different behaviour from one definition.

### Why not give agents a shared filesystem?

A filesystem has no rules for how a file may change, permissions only by folder, and no history of decisions. A system of record has named actions with their own checks, permissions per role and the history of every change. Files belong to records.

### What is the difference between a chat and a session?

A chat is what people saw, kept for people and staff. A session's trace is how the agent worked, kept for builders. They are separate stores linked by id.

### How do agents use other services without seeing their credentials?

Each service is a connection declared in code. The platform keeps the credential, and calls go through the connection under its access rules.
