Architecture

Open-source architecture that survives the next model

What an architecture that survives the next model needs, and how the open-source CompanyOS keeps identity, state and review intact when the model changes.

MK
Marko Kraemer
Co-founder··6 min read

What an architecture that survives the next model needs, and how the open-source CompanyOS keeps identity, state and review intact when the model changes.

Canonical: https://kortix.com/blog/agi-ready-architecture

The next model will be better than this one, and a better model will not make your platform safe to run. Each generation arrives more capable, more autonomous, better with images; it runs unattended for months, drives computers and accounts, and eventually gets cheap enough that one company spins up thousands of workers at once, and that part is safe to assume. What is not safe to assume is that your platform survives the jump without handing a model uncontrolled access, losing its state, or needing a rewrite, and that is what Kortix, the open-source CompanyOS, is built for. It is built so the model can change without the platform changing with it.

AGI-ready architecture is an execution system for intelligent entities that stays durable, stateful, model-independent, permissioned, observable, evaluable and self-improving, rather than one LLM wrapped in tools.

Swap today's model for a stronger one. Then check whether the identity boundaries, the permissions, the review gates and the state still hold. A vision model in place of a text one should not mean new privileges. Neither should ten thousand parallel workers, or an agent left running for a week. If the boundaries hold, the architecture is AGI-ready. If the model is the application, they never will.

Models are replaceable; state is not

An AGI-ready system depends on capabilities: reason, code, vision, verify. Model names change; those four do not. Kortix puts a gateway between the session and the model. Swapping one for another is a config change. Routing is a config change too. Bring a provider key or run inference on your own GPUs, send routine work to cheap open-weight models, keep a frontier one for the tasks that earn it.

  • Any model, your keys. Claude, GPT, Gemini, or open-weight GLM and DeepSeek on a key you supply; or the ChatGPT plan you already pay for; or your OpenCode Console sign-in for OpenCode Zen and Go.
  • A routing chain per project. Up to eight fallback models that the gateway tries in order when a model fails, and that take over when the requested model is unknown or retired.
  • Self-hosted inference. Run it inside your VPC, on your own hardware, or on-prem, with no vendor assumed reachable.

State is the harder half. If the context window is the only place your state lives, you have none. You have a lucky streak that ends when the session does. Kortix keeps the working system in a single git repo, as files: the manifest, the skills, the agents, the connectors, the policies, the memory. All of it versioned, diffable, yours. An agent's config change is a file change on its session branch, and the merge decides what joins the repo. Secret values and feature flags are the exception: the repo carries the secret's name, and the value stays encrypted on the platform. An agent asks for one by name: kortix secrets request <NAME> mints a link, good for seven days, where a person types the value, and kortix secrets sync pulls the session's secrets and grants.

# kortix.yaml, one file that defines this project.
default_agent: kortix

project:
  name: acme-security-audit

agents:
  kortix:

    mode: primary
    permission: allow
    prompt_file: agents/kortix.md
    connectors: [kortix_slack]

connectors:
  - slug: kortix_slack
    provider: channel
    platform: slack
    policies:
      - match: "send_*"
        action: require_approval

triggers:
  - slug: nightly-access-review
    type: cron
    agent: kortix
    cron: "0 0 2 * * *"
    prompt: Audit last night's access logs and flag any out-of-policy connector calls for review.

Nothing a model generates becomes authoritative business state on its own. An agent may write code, draft a campaign, move a file. Session work reaches main through a change request, and merge is default-deny for agents. The capability is project.gitops.merge. The starter worker agent holds kortix_permissions: "*", merge included. Narrow that grant before you leave an agent running unattended.

Every action has an identity, and its own machine

Authentication answers who the agent is. Authorization answers what it may do. A model is a poor judge of that second question. So each session carries its own scoped identity: a token scoped to one project, and a grant behind it that names the connectors, secrets and skills the agent may reach.

Credentials follow a tighter rule. Connector credentials are brokered server-side and never enter the machine. Each connector action can carry a policy of its own. A rule on the Slack send action holds that call before anything leaves Kortix.

Agent code should not run inside the control plane. Each run happens on a disposable machine, on a branch cut for it, with filesystem, network and processes walled off from everything else. Thousands run at once on one config. They do not collide, because none of them share state.

Durable sessions, reviewed changes

AGI-level work will not fit inside one HTTP request. Picture an agent that sleeps for three months, wakes when an event fires, reloads who it is and what it knows, and carries on. Stop a Kortix session and it pauses where it stands, keeping the disk, the branch and the transcript while the compute meter stops. Start it again. The work resumes where it stopped.

A trigger picks its own session strategy. fresh is the default. reuse prompts the latest non-failed session the trigger created. pinned names one session id, and keyed keeps one session per rendered key, where the key is a template over the trigger payload, such as {{ body.chat_id }}. A long-lived operator carries context across invocations instead of starting cold when the clock ticks.

The record of changes is git history, and the audit log records every action. The review gate is the change request. Kortix validates kortix.yaml on the head branch before anything lands. A preview is a port of the session's own sandbox, so the reviewer opens the running app on the port it listens on instead of reading a diff.

A model's benchmark score says nothing about any of that. The number to watch is the share of real tasks that finish correctly, safely and within budget, and a preview run gives the evidence.

Learning is gated, and people hold the switch

Production experience should make the system better without a model rewriting its own behavior mid-flight. A skill is a folder: skills/<name>/SKILL.md, frontmatter with a name and a description, then the instructions. The description is what an agent reads to decide when to load it. Kortix keeps skill bodies out of the prompt until then. An agent can write a new one on its session branch and propose it. It lands when the change request merges. Nothing swaps behavior mid-run.

Approval has the same shape, and it starts off. The policy block decides every call no rule matches, and its default_mode falls back to allow_all. Nothing is held until you write a rule or set the mode to risk. The page a person decides from shows what the app will receive, with private values hidden, and nothing runs until they choose approve or deny and leave a note if they want to. An approval is spent on the one call it names. Another account, or another argument, and the agent asks again.

Costs are bounded, authority is capped

Capability without a budget is a bill with no ceiling. A budget caps model spend per project, per day, week or month. At the limit a blocking budget refuses new requests with 402 budget_exceeded. A warn budget lets them run, and mail reaches account owners, admins and project managers at 80% and 100%. A stopped or sleeping sandbox uses no compute. Its files still count as storage.

A stronger model should let the platform do more work. It should not get more access. Authority is capped by identity, policy, sandbox and review, and the model controls none of those. A platform built this way survives the next model, and the one after it.

Which side of the jump you are on

Choose the wrapper if…

you are shipping a single model's output straight to production with no durable state, no permission boundary and no review, and betting that a smarter model makes that safe.

Choose Kortix if…

you want the capability jump without the authority jump, with agents that do more work inside the same identity, policy, sandbox and review you already control.

Model leadership changes hands every few quarters. The winners of the next decade will be the companies whose platform can absorb whatever model arrives and put it to work safely. If that operating layer is what you're missing, the introduction and the company-as-a-repo thesis are the next reads.

Build for the jump, not the model.

Self-host it, or run it on Kortix Cloud. Any model, your keys. Start one project free.

Get started

Own your company’s AI.Start today, in our cloud or yours.

Start for free

Open source · SOC 2 Type I · SAML SSO and SCIM · Any model, your keys