Writing

Why Rust Fits Provider-Agnostic AI Agent Systems

I worked in Rust on a private, provider-agnostic AI agent with a multi-layer architecture, and I am building the Electron assistant Arlene around the same ideas. This is how I think about agent systems: providers behind interfaces, honest layers, and control where it counts.

Agents are systems, not prompts

Most “AI agent” demos are a prompt, a loop, and hope. A system someone depends on is a different animal: it has to call tools safely, survive a provider outage, keep behaviour predictable when a model changes, and be debugged by someone who was not in the room when it misbehaved. I learned this from two directions at once — working in Rust on a private, provider-agnostic agent system for a third-party company, and building Arlene, my own cross-platform AI assistant. Different products, same conclusion: the model is a component, and the engineering is everything around it.

That framing changes the questions you ask. Not “which model is smartest this week?” but “what happens when this provider is down, deprecated, or suddenly expensive? What may this agent touch, and what proves it stayed in bounds? Which parts must be deterministic even though the model is not?” Agent systems are backend systems with a probabilistic core, and they deserve backend rigour.

Provider-agnostic from day one

The Rust system I worked on was provider-agnostic by design: every model provider sits behind one interface, so swapping or adding a provider is a contained change instead of a rewrite. This is not abstraction for its own sake. Providers change pricing, rate limits, terms, and quality on their schedule, not yours. A system welded to one vendor’s SDK inherits all of that as unplanned roadmap.

Arlene follows the same rule from the user’s side: local models and cloud providers appear through one consistent surface, so a pipeline a user designs today still runs when they change their mind about models tomorrow. Provider independence is partly a business hedge and partly an engineering one — it forces you to define what your system actually needs from a model, in your own types, instead of leaking one vendor’s vocabulary through every layer.

Layers with honest boundaries

The Rust agent’s architecture is deliberately multi-layered. In my experience the useful separation looks like this: a provider layer that only knows how to talk to models; an orchestration layer that owns the agent loop, state, and policy; a tools layer where each capability is explicit and permissioned; and the outer interfaces — API, CLI, UI — that real consumers touch. Each layer can be tested without the others, which matters enormously when one ingredient in the system is a model whose answers vary.

Honest boundaries are also a security posture, and security is where I start rather than where I finish. An agent that can call tools is an agent that can be talked into calling the wrong ones. Keeping tools behind a narrow, typed, permissioned layer — instead of letting model output wander into stringly-typed execution — is the difference between an agent you can audit and one you merely hope about. The same instinct is why Sonobe generates agent-facing documentation and MCP support: agents work better inside systems that explain their own rules.

Why Rust, specifically

Rust earns its complexity in agent infrastructure for three concrete reasons. First, predictable performance: an orchestrator juggling many concurrent model calls, streams, and tool executions should not add its own latency surprises or memory drama to an already variable system. Second, the type system: when provider messages, tool arguments, and agent state are distinct types, whole categories of “the model returned something odd and it flowed everywhere” simply do not compile. Third, concurrency you can reason about — ownership makes shared state an explicit decision, which is exactly what you want when parallel agent steps touch the same context.

None of that makes Rust the right choice for every agent-shaped thing. A prototype, a thin wrapper, an experiment you will throw away — Python will get you there faster, and I use Python for agent-adjacent work too. Rust is for the layer that has to keep behaving while everything around it — models, providers, prompts — keeps changing. That is precisely the layer a serious agent product lives or dies on.

The same thinking on the desktop: Arlene

Arlene is where these ideas meet a single user instead of a platform. It is a cross-platform Electron assistant with a drag-and-drop pipeline designer in the spirit of n8n: agents and tools become visible, rearrangeable parts instead of hidden prompt chains. Built-in harnesses cover common task shapes, and self-learning and self-improvement features let it refine its own behaviour over time.

The desktop changes the constraints but not the principles. Pipelines still need provider independence (a local model on a train, a cloud model at the desk). Tools still need explicit permissions — more so, because now they run on the user’s own machine. And customizability has to be structural, not a settings page: if users cannot reshape how the assistant works, it remains my assistant that they merely operate. I am building Arlene to open-source it later; the architecture has to survive other people reading it, which is the best design pressure I know.

What I would tell a team starting now

Start by drawing the boundaries, not by picking the model. Decide what a provider owes you, in your types. Decide what tools exist and who may call them. Decide which parts of the system are deterministic and testable without a model in the loop — then keep the model inside that frame instead of letting it become the frame. Choose the implementation language for the layer that must not wobble; for me, increasingly, that answer is Rust.

Agent systems will keep changing underneath us — models, protocols, prices. The systems still standing in three years will be the ones whose architecture assumed that from the first commit. If you are building one and want that kind of foundation, or an assistant of your own shaped like Arlene, start from my résumé and let’s talk.

All writing