Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
160758 stories
·
33 followers

Model Context Protocol Explained - Why MCP Is Replacing Custom Tool APIs in Enterprise Agentic AI Systems (2026)

1 Share

The rapid transition toward autonomous multi-agent systems has exposed the acute fragility of maintaining bespoke, hard-coded API integrations for every large language model. In 2026, enterprise software architects and engineering teams are moving away from proprietary function-calling wrappers in favor of open, vendor-neutral interface standards.

 

Under the modern enterprise landscape—anchored by the open-source Model Context Protocol (MCP) 2026 specification and cross-industry Linux Foundation governance—applications now establish standardized, bidirectional bridges between foundation models and live business environments. This architectural shift eliminates mounting integration debt while enforcing stringent enterprise security and operational governance.

 

Model Context Protocol MCP Enterprise Architecture
Standardizing autonomous agent tool calling, resource context, and enterprise data access with the Model Context Protocol (MCP) in 2026.

 

Table of Contents

 

  • Eliminating Integration Debt: MCP replaces proprietary M×N API wrappers with a universal Model Context Protocol standard, allowing any compliant client to interact with any MCP server seamlessly.
  • Three Core Primitives: Standardizes enterprise capabilities across executable Tools, URI-addressable dynamic Resources, and parameterized Prompts over uniform JSON-RPC 2.0 transport.
  • Decoupled Architecture: Clean separation between the AI Host (IDE, workflow orchestrator), the Client, and the isolated MCP Server guarantees modularity and prevents model hallucination loops.
  • Enterprise Security by Design: Implements scoped capability negotiation, explicit human-in-the-loop approvals, read-only resource subscriptions, and granular trajectory auditing for production compliance.
  • Ecosystem Synergy: Operates alongside emerging multi-agent networking standards like Google Agent2Agent (A2A) and knowledge graph architectures to deliver reliable, enterprise-grade cognitive pipelines.

 

The Enterprise Tool-Calling Crisis - Moving Beyond M-times-N Custom API Wrappers

For the past three years, engineering organizations rushed to equip generative models with external agency by writing bespoke tool-calling functions. Whenever an engineering team wanted an AI assistant to query an internal PostgreSQL database, inspect a GitHub repository, or create an issue in Jira, developers wrote custom JSON schemas and handcrafted Python or TypeScript client code tailored to one specific model provider.

 

This ad-hoc paradigm created an unsustainable M×N integration bottleneck. If an enterprise deployed three distinct models across two client environments (such as an IDE extension and an automated Slack bot) alongside ten internal software services, developers had to maintain sixty separate integration paths. Every time an API vendor changed a payload structure or released a revised SDK version, fragile custom connectors broke across the entire enterprise stack.

 

As explored in our technical breakdown on decoding the differences between Gen AI and Agentic AI, true autonomy demands standardized sensory perception and deterministic action execution. Rather than spending valuable development cycles on repetitive integration plumbing, modern software engineering requires a universal interface bus where data sources expose their capabilities once, and all AI clients consume them reliably.

 

This integration gridlock is precisely what drove the industry-wide adoption of the open-source Model Context Protocol in 2026. By turning external services into modular, pluggable servers that communicate via uniform schemas, organizations have finally decoupled foundation model reasoning from concrete backend infrastructure.

 

 

Understanding MCP Architecture - Client, Host, and Server Mechanics

The Model Context Protocol establishes a clean, three-tier architecture consisting of the Host, the Client, and the Server. Understanding how these three entities collaborate is essential for building resilient agentic systems.

1. The MCP Host (The Environment)

The Host is the primary user-facing application or orchestration runtime where cognitive work originates. Examples of Hosts include developer IDEs, conversational assistants, and enterprise multi-agent workflow engines. The Host is responsible for initializing client instances, managing authentication keys, enforcing user permissions, and presenting results back to human operators.

2. The MCP Client (The Protocol Adapter)

The Client resides inside the Host application and maintains a direct 1:1 connection with an individual MCP Server. The Client handles protocol negotiation, converts model function calls into structured JSON-RPC 2.0 requests, and receives streaming responses. A single Host can manage dozens of active Clients simultaneously, allowing an AI agent to interact with a file system, a cloud telemetry service, and a database within the same reasoning loop.

3. The MCP Server (The Capability Provider)

The Server is a lightweight, dedicated process or microservice that exposes domain-specific capabilities to Clients. The Server does not need to know which language model is querying it; it simply advertises its available tools, resources, and prompts, executes requested operations when invoked with valid arguments, and returns structured data payloads.

 

Communication between Clients and Servers is executed over two primary transport protocols:

  • Standard Input/Output (stdio): Designed for local process execution. The Host spawns the MCP Server as a local child process and communicates via standard input/output streams, providing sandboxed, high-performance execution without opening local network ports.
  • Server-Sent Events (SSE) over HTTP/HTTPS: Designed for distributed cloud infrastructure. The Client establishes an SSE stream for real-time server-to-client notifications and posts commands over standard HTTPS endpoints, enabling secure access to remote enterprise microservices.

 

To see how autonomous agents organize multiple domain workers, our architectural guide on why agentic AI is tech's biggest winner in 2026 provides helpful context on real-world multi-agent workflow orchestration.

 

 

The Three Core Primitives - Tools, Resources, and Dynamic Prompts

Unlike early tool-calling interfaces that treated all external interactions as opaque function executions, the Model Context Protocol categorizes capabilities into three distinct, first-class primitives:

1. Tools (Action Execution)

Tools represent model-controlled actions that produce side effects or retrieve dynamic computational results. Examples include executing SQL statements, running unit tests, sending emails, or provisioning cloud resources. Every tool definition includes a strict JSON schema describing its parameters, required fields, and expected response format, allowing language models to plan and invoke function calls with mathematical precision.

2. Resources (Context and Knowledge Ingestion)

Resources represent read-only data streams and document contexts that the Host or user can attach directly to model context windows. Resources are identified by standard URIs (such as postgres://warehouse/orders/schema or file:///repo/docs/architecture.md). Unlike static RAG chunks, MCP Resources support real-time subscription models: when an underlying database schema or log file changes, the Server emits an update notification, ensuring the agent always reasons over active, authoritative state.

3. Prompts (Standardized Workflows)

Prompts are parameterized, reusable workflow templates exposed by the Server to guide both human users and AI agents through complex multi-step procedures. A GitHub MCP Server might expose a prompt titled review-pull-request, which automatically gathers the diff, fetches relevant style guidelines, and structures the critique. Prompts transform ad-hoc prompt engineering into version-controlled, reusable enterprise assets.

 

 

Implementing an Enterprise MCP Server - Before and After Code Comparison

To appreciate how dramatically the Model Context Protocol streamlines development, consider how developers traditionally integrated a customer order lookup tool compared to how it is authored today with an MCP Server.

The Legacy Approach - Fragile Custom Tool Calling Wrapper

In traditional setups, developers wrote proprietary schema bindings coupled tightly to a single SDK. If the team migrated from one LLM provider to another, the schema definitions, validation logic, and error formatting had to be rewritten from scratch:

 

// LEGACY: Proprietary OpenAI-specific function calling wrapper
// Hardcoded schema and manual dispatch tightly coupled to one vendor
const orderLookupTool = {
  type: "function",
  function: {
    name: "lookup_customer_order",
    description: "Fetch customer order details from PostgreSQL database",
    parameters: {
      type: "object",
      properties: {
        order_id: { type: "string", description: "The UUID of the order" },
        include_history: { type: "boolean", description: "Fetch audit log" }
      },
      required: ["order_id"]
    }
  }
};

// Custom execution dispatcher with manual JSON parsing and error handling
async function handleToolCall(toolCall) {
  if (toolCall.function.name === "lookup_customer_order") {
    const args = JSON.parse(toolCall.function.arguments);
    return await db.orders.findUnique({ where: { id: args.order_id } });
  }
  throw new Error("Unknown function call");
}

The Modern Approach - Standardized MCP Server Implementation

With MCP, the server exposes the capability using a standardized SDK. Any compliant MCP Client (whether running in Visual Studio, Claude Desktop, Cursor, or a custom internal enterprise agent) can discover, inspect, and invoke this tool without a single line of custom adapter code:

 

// MODERN: Standardized Enterprise MCP Server implementation (TypeScript)
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod";

const server = new Server(
  { name: "enterprise-order-service", version: "2.0.0" },
  { capabilities: { tools: {}, resources: {} } }
);

// 1. Advertise available tools using standardized schemas
server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: "lookup_customer_order",
      description: "Securely query customer order records from PostgreSQL",
      inputSchema: {
        type: "object",
        properties: {
          orderId: { type: "string", description: "Enterprise order UUID" },
          includeAudit: { type: "boolean", description: "Include compliance log" }
        },
        required: ["orderId"]
      }
    }
  ]
}));

// 2. Deterministic execution with typed arguments and uniform response envelope
server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === "lookup_customer_order") {
    const { orderId, includeAudit } = request.params.arguments as { orderId: string; includeAudit?: boolean };
    const orderData = await queryOrderDatabase(orderId, includeAudit);
    return {
      content: [
        { type: "text", text: JSON.stringify(orderData, null, 2) }
      ]
    };
  }
  throw new Error(`Tool not found: ${request.params.name}`);
});

// 3. Connect via isolated standard input/output transport
const transport = new StdioServerTransport();
await server.connect(transport);

 

Notice the architectural elegance: the server is completely agnostic of the LLM. It can be invoked by a local open-weight model running through Ollama or a massive frontier cloud model without altering a single byte of server-side code.

 

 

Production Security, Fine-Grained Scoping, and Audit Guardrails

Deploying autonomous agents in enterprise banking, healthcare, and e-commerce requires far more than reliable API connectivity. When an AI model is empowered to invoke software tools, organizations face catastrophic risks if an agent falls victim to indirect prompt injection or enters runaway execution loops.

 

The Model Context Protocol incorporates four essential protective layers specifically designed to satisfy corporate security reviews:

  • Granular Capability Scoping: During the initial JSON-RPC handshake, the Client and Server negotiate capabilities explicitly. A server can be restricted to read-only resource access, preventing write-capable tools from ever being loaded into the agent's active execution envelope.
  • Human-in-the-Loop (HITL) Gatekeepers: The MCP Host sits between the model's reasoning brain and the Server's physical execution layer. For high-stakes operations (such as deleting database records or sending financial transactions), the Host can require explicit biometric or cryptographic human approval before transmitting the tool execution request.
  • Ephemeral Sandboxing: By executing MCP Servers over stdio inside isolated container boundaries or WebAssembly runtimes, rogue agents cannot inspect neighboring processes, access host memory, or exfiltrate private credentials.
  • Comprehensive Trajectory Audit Trails: Every MCP request and response payload contains unique request IDs, execution timestamps, and deterministic input parameters, generating tamper-evident audit logs essential for regulatory and SOC 2 compliance.

 

Developers working in local development workflows can explore our guide on running local AI models with Ollama and SLMs to prototype private, zero-leakage MCP architectures right on developer workstations.

 

 

Ecosystem Interoperability - How MCP Complements Agent2Agent (A2A) and GraphRAG

As enterprise architectures mature, confusion often arises regarding the relationship between the Model Context Protocol, multi-agent communication frameworks, and modern knowledge retrieval strategies. Far from competing, these technologies form a cohesive, layered ecosystem:

  • MCP vs Agent2Agent (A2A): While MCP standardizes how a single agent connects vertically to its tools and data resources, protocols like Google Agent2Agent (A2A) govern horizontal communication between multiple distinct agents. In a modern enterprise, a coordinator agent might use A2A to delegate an audit to a security agent, and that security agent uses MCP to query the production firewall logs.
  • MCP and GraphRAG Integration: Traditional vector RAG struggles with complex multi-hop queries spanning relational dependencies. By encapsulating knowledge graphs (such as Neo4j or Microsoft GraphRAG) inside an MCP Server, agents can dynamically traverse entity relationships through standardized resource URIs rather than blind vector similarity calculations.
  • First-Class IDE and Tooling Support: Leading development environments—including Microsoft Visual Studio 2026, Cursor, and enterprise developer platforms—now ship native MCP client drivers out of the box. As highlighted in our review of what is new in Visual Studio 2026, native protocol support allows coding assistants to tap directly into internal build caches and Roslyn analyzers seamlessly.

 

 

Frequently Asked Questions (FAQ)

  1. What is the Model Context Protocol (MCP)?
    The Model Context Protocol (MCP) is an open-source standard that governs how AI models, client hosts, and external tools exchange context, execute actions, and query dynamic data over uniform JSON-RPC 2.0 protocols.
  2.  

  3. Why is MCP replacing custom tool APIs in enterprise systems?
    Custom tool integrations force engineering teams to maintain M-times-N point-to-point connectors across evolving model APIs. MCP standardizes tool definitions and permissions into a single, reusable protocol, eliminating technical debt and governance overhead.
  4.  

  5. Who maintains and governs the Model Context Protocol in 2026?
    Originally open-sourced by Anthropic, MCP was contributed to open-source governance under the Linux Foundation with widespread cross-industry collaboration from cloud providers, developer tool vendors, and enterprise AI organizations.
  6.  

  7. What are the three core architectural primitives of MCP?
    MCP organizes agent capabilities into Tools (executable functions that perform external actions), Resources (read-only data streams and document contexts), and Prompts (reusable, pre-engineered prompt workflows and slash commands).
  8.  

  9. How does MCP differ from Google Agent2Agent (A2A) protocol?
    MCP standardizes the connection between an AI agent and its external tools or data sources, whereas Agent2Agent (A2A) standardizes discovery, communication, and task delegation between multiple independent autonomous agents.
  10.  

  11. What transport mechanisms does MCP support?
    MCP officially supports standard input/output (stdio) for secure local process execution and Server-Sent Events (SSE) over HTTP/HTTPS for remote microservices and distributed cloud infrastructure.
  12.  

  13. How does MCP enforce enterprise security and data privacy?
    MCP enforces explicit client-level consent, granular capability negotiation, scoped authentication tokens, and comprehensive trajectory logging, ensuring autonomous agents cannot invoke unauthorized internal APIs.
  14.  

  15. Can MCP be used with open-weight models and local inference engines?
    Yes. Because MCP operates over standard JSON-RPC 2.0 payloads, developers can connect local models hosted on Ollama or vLLM to standard MCP servers just as easily as frontier proprietary cloud LLMs."
  16.  

  17. How do MCP Resources differ from traditional RAG vector stores?
    Traditional vector RAG relies on pre-computed similarity chunk lookups, whereas MCP Resources provide structured, URI-addressable real-time data access with dynamic subscriptions, change notifications, and live state updates.
  18.  

  19. What programming languages support MCP server development?
    Official and community-supported production SDKs exist for TypeScript/JavaScript, Python, C#/.NET, Go, and Rust, allowing teams to expose existing enterprise services as MCP servers with minimal wrapper code.

 

 

End Note

The maturation of the Model Context Protocol marks a pivotal milestone in software engineering, resolving one of the most stubborn friction points in enterprise AI adoption. By replacing fragile, proprietary tool connectors with an open and universally supported standard, engineering teams can finally focus on business domain logic and workflow orchestration rather than low-level API plumbing.

 

As multi-agent ecosystems become the primary interface for software creation, operations, and enterprise data analysis, standardized protocols will serve as the essential connective tissue of modern digital infrastructure. Organizations that adopt MCP today insulate themselves against vendor lock-in, streamline their compliance audits, and unlock unprecedented speed when rolling out autonomous capabilities.

 

I encourage software engineers, team leads, and architects to begin by wrapping a single internal utility or database service into a standardized MCP Server. Test it against your local development environment, observe how cleanly your AI coding assistant interacts with it, and scale your agentic infrastructure with confidence. Feel free to share your thoughts, architecture questions, and implementation experiences in the comments below!

 

Model Context Protocol MCP Enterprise Architecture
Standardizing autonomous agent tool calling, resource context, and enterprise data access with the Model Context Protocol (MCP) in 2026.

 

Read the whole story
alvinashcraft
2 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Android Weekly Issue #743

1 Share
Articles & Tutorials
Sponsored
We reach out to more than 80k Android developers around the world, every week, through our email newsletter and social media channels. Advertise your Android development related service or product!
alt
Luca Fioravanti explains how Restore Credentials uses WebAuthn resident keys to sign users in on new devices automatically.
John O'Reilly demonstrates swapping Google's new Gen AI Kotlin SDK into a coroutine-based Gemini video-analysis tool.
Oğuzhan Aslan examines systems-engineering challenges for deploying on-device diffusion image generation on Android hardware.
Akshay Nandwana shares daily workflows using Gemini in Android Studio for coding, debugging, and prototyping.
Wassim Beltaief explains Formidable, a KSP-powered form engine generating typed Compose form controllers at compile time.
Nav Singh walks through implementing Android 17's new session-based Location Button in Jetpack Compose apps.
Sajid Ali walks through porting Compose Multiplatform's Gradle plugin and runtime modules to support tvOS targets.
Rob Orgiu demonstrates using adb emu terminal commands to fold, rotate, and resize emulators for adaptive testing.
John O'Reilly explains fine-tuning Gemma 4 with LoRA for on-device golf swing analysis on Android.
Segun Famisa builds a reusable JUnit rule that simplifies WorkManager test setup and constraint handling.
Joe Birch demonstrates animating numeric values in Jetpack Compose with animateFloatAsState, consistent formatting, and accessibility handling.
Justin Mancinelli argues Compose Multiplatform now makes cross-platform a strategic, low-risk choice over Flutter for engineering leaders.
Thomas Künneth examines how Google Play's sensitive-permission policies collide with developer freedom and digital sovereignty.
Tetiana Synytsyna builds an iOS-style layered bottom sheet stack using Navigation 3's SceneStrategy in Jetpack Compose.
Libraries & Code
A Jetpack Compose overlay for browsing, querying, and exporting Room/SQLite database contents directly on-device.
alt
A zero-overhead Compose library that visualizes recomposition frequency with on-device heatmap overlays and audit reports.
An OkHttp interceptor with a Jetpack Compose overlay for injecting on-device network latency, errors, and timeouts.
An OkHttp interceptor and Compose debug overlay for inspecting JSON-RPC calls in Android Web3 apps.
A Kotlin Multiplatform library unifying iOS Live Activities and Android 16 Live Updates behind one API.
A headless, schema-driven form engine for Kotlin Multiplatform with type-safe generated controllers and built-in validation.
An Android Studio/IntelliJ plugin exposing Kotlin PSI semantic code analysis to AI assistants via MCP.
A Gradle plugin that adds Apple tvOS target support to Compose Multiplatform projects via dependency resolution tricks.
News
JetBrains releases Kotlin Toolchain 0.12 with multiplatform library publishing, Wasm app support, and Compose Hot Reload from the CLI.
Google ships Android Studio Quail 4 stable, adding bundled Android skills and native offline Gemma 4 integration.
Videos & Podcasts
Nicole Terc demonstrates using Filament's rendering engine to build particle and material-based UI effects in Compose Multiplatform.
alt
Philipp Lackner demonstrates a simple way to optimize Android app performance without digging through complex traces.
Firebase's Marina and Peter continue building a spoiler-free book Q&A app using on-device AI and Firestore.
Kotlin by JetBrains explains how Google Search uses server-side Kotlin coroutines for scalable, low-latency streaming results.
Idan Nakav demonstrates using Kotlin's Analysis API to make code migrations semantically safe, not just syntactic.
Anna Kozlova explains how everyday Kotlin code style choices can quietly degrade IntelliJ IDE performance.
Android Developers previews new Android Studio Quail features: native LeakCanary profiling, Gemini-assisted crash fixes, and bundled Skills.
Philipp Lackner covers Android Studio Canary Rabbit's Play test track changes and new Compose Multiplatform MCP updates.
Jessalyn Wang shows how Amazon Delivery scales Kotlin Multiplatform and iOS using the App Platform framework.
Android Developers shows how PUBG MOBILE used the Google Play Games Level Up program to boost player retention.
Stanislav Sandler demonstrates KotlinLLM, a research project exploring how LLMs can power new Kotlin language features.
Alexander Sysoev demonstrates kotlinx-rpc's Kotlin-first gRPC support, covering Native/iOS targets, compiler plugin tooling, and code generation.
Read the whole story
alvinashcraft
2 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Why companies are becoming a series of loops | Anish Acharya (a16z)

1 Share

Anish Acharya is a General Partner at Andreessen Horowitz (a16z), where he has focused on consumer investing. Anish is one of the most insightful, thought-provoking, and in-the-weeds product investors I’ve met, and this conversation will get your mind buzzing. Before joining a16z, Anish was a serial founder and operator: he founded SocialDeck, which he sold to Google, then led multiple efforts inside Google before founding Snowball, which he sold to Credit Karma. At Credit Karma he rose to VP of Product and then GM of the consumer product and the broader credit card business.

In our in-depth conversation, we discuss:

1. Why you don’t have to worry about becoming part of the “permanent underclass”

2. Why company building will now involve creating a series of loops

3. What’s happening in consumer right now

4. Why the biggest opportunity in consumer is “/loop, make me happier”

5. Why moats are discovered, not designed

6. The rising importance of distribution as a moat

7. Being a model sommelier

Brought to you by:

WorkOS—Make your app enterprise-ready, with SSO, SCIM, RBAC, and more

Mercury—Radically different banking, now with Command

Episode transcript: https://www.lennysnewsletter.com/p/why-companies-are-becoming-a-series

Archive of all Lenny's Podcast transcripts: https://www.dropbox.com/scl/fo/yxi4s2w998p1gvtpu4193/AMdNPR8AOw0lMklwtnC0TrQ?rlkey=j06x0nipoti519e0xgm23zsn9&st=ahz0fj11&dl=0

Where to find Anish Acharya:

• Andreessen Horowitz: https://a16z.com/author/anish-acharya/

• LinkedIn: https://www.linkedin.com/in/anishacharya/

• X: https://x.com/illscience

• SoundCloud: https://soundcloud.com/illscience

Where to find Lenny:

• Newsletter: https://www.lennysnewsletter.com

• X: https://twitter.com/lennysan

• LinkedIn: https://www.linkedin.com/in/lennyrachitsky/

In this episode, we cover:

(00:00) Introduction

(02:25) The fear of AI creating a permanent underclass

(05:25) Why AI takeoff may be slower than expected

(08:02) How companies are actually adopting AI

(11:25) Building AI products with loops

(15:25) Why human intuition still matters

(20:19) What the winners in AI are doing differently

(21:41) Generalists vs. specialists

(26:22) How to become a model sommelier

(32:03) /loop make me happier

(36:15) Why Anish is optimistic about the future of AI

(42:47) What happens when models become too dangerous

(46:29) How AI will change jobs and ambition

(51:34) The state of consumer AI

(54:30) How to build a durable moat in AI

(59:25) The power of distribution and word of mouth

(01:04:30) Making bigger bets and rethinking pricing

(01:09:17) Advice for product builders in the AI era

(01:11:48) Lightning round and final thoughts

References: https://www.lennysnewsletter.com/p/why-companies-are-becoming-a-series

Production and marketing by https://penname.co/. For inquiries about sponsoring the podcast, email podcast@lennyrachitsky.com.

Lenny may be an investor in the companies discussed.



To hear more, visit www.lennysnewsletter.com



Download audio: https://pscrb.fm/rss/p/api.substack.com/feed/podcast/213044770/3b97202cd424a1dca4955ed3371c9424.mp3
Read the whole story
alvinashcraft
3 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

How to Build an AI-Native Company Today

1 Share
From: AIDailyBrief
Duration: 24:27
Views: 3,439

What does it actually take to build an AI-native company? NLW breaks down Alex Lieberman’s 30 features of AI-native organizations, from shared context and agent skills to self-improving workflows, token efficiency, and making every employee a builder. The episode explores how companies can redesign work around agents, where human judgment belongs, and why ownership and accountability are becoming essential parts of a new management discipline.

The AI Daily Brief helps you understand the most important news and discussions in AI.
Subscribe to the podcast version of The AI Daily Brief wherever you listen: https://pod.link/1680633614
Get it ad free at http://patreon.com/aidailybrief
Learn more about the show https://aidailybrief.ai/

Read the whole story
alvinashcraft
3 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Introducing Onus - The Code Is Generated, The Responsibility Is Still Mine

1 Share

I find coding assistants compelling. They are extraordinary tools, genuinely transformational and I use them daily, and I’m interested in what becomes possible as they continue to get better. I’m also a CTO. At some point I have to be willing to sign off on the software we build. Sometimes directly, sometimes through the people and processes I’m responsible for.

Those two positions aren’t contradictory. But they do create a tension.

I can be impressed by an implementation without having sufficient grounds to approve it. I can believe these tools are enormously useful while still asking what, exactly, gives me confidence in their output. The fact that a model wrote the code doesn’t make that question go away. Nor does having another model tell me that the code looks good.

That’s the starting point for Onus: a programming language, and the development environment around it, built to explore a different basis for trusting generated implementations.

The compiler is already written in Onus. The workbench comes next.

The problem isn’t just whether the code is right

There are two different questions involved in approving a change.

Does the implementation satisfy its requirements?

And are those requirements sufficient for the system we intend to operate?

Code review often conflates the two. Reading an implementation helps us find mistakes, but it also helps us discover requirements nobody wrote down. We notice that something should be authorised, that a retry could repeat a payment, or that a seemingly innocent operation could become very expensive.

That is valuable engineering work and it was hard even before code started being generated at AI speed. My concern is what happens when the volume of generated implementation grows faster than our ability to do it.

We can respond with better tests, more automation, more selective review and better coding assistants. I expect all of those to matter. But I’m interested in a more fundamental question:

Can we change the thing a human has to review?

Nobody understands every line of a substantial production system today. We already rely on abstractions, interfaces, tools and other people’s judgement. I’m not proposing that we stop doing that.

I’m asking whether the boundary between what we inspect and what we trust can become more explicit—and more mechanically enforceable.

An instruction is not a constraint

Consider a reporting function that must never modify the database. We can put that rule in a ticket, a conventions document or a prompt. We can ask a reviewer to remember it. All of those communicate intent.

In Onus, we can also make it part of the function’s interface:

pub fn monthly_totals(db: sql.Db[ReadOnly], year: Int)
  -> Result[List[MonthlyTotal], sql.Error] may sql.read, alloc

The database capability is read-only. The declared effects permit database reads and allocation, not writes. Those restrictions apply through the functions it calls; moving a write into a helper doesn’t hide it from the compiler. This is the reporting example on the Onus site.

Suppose a model decides to record each report run by inserting a row into an audit table. That might be a perfectly reasonable feature. It is nevertheless outside the authority granted to this function.

The important question is no longer whether the model remembered the instruction. The proposed implementation crosses a boundary the compiler can reject.

Perhaps we decide the report should acquire write access. Perhaps we put the logging somewhere else. Either way, changing the boundary is a decision, not an incidental detail buried in generated code.

That separation also governs Onus’s regeneration loop. The model can revise implementations, but it cannot make them acceptable by weakening the contracts, widening the permitted effects or inserting a new assumption. It can propose such a change for a human to consider; it cannot silently award itself permission.

This is the division of responsibility I’m trying to establish: freedom to implement within agreed constraints, not freedom to redefine those constraints when implementation becomes inconvenient.

Permissions aren’t behaviour

Of course, a reporting function can be read-only and still return complete nonsense.

Restricting what code may do is not the same as establishing that it does the right thing. Onus also has behavioural contracts: preconditions, postconditions and invariants that create obligations for the checker.

But there is an important trap here.

Imagine specifying a sorting function by requiring that its result is sorted. An implementation that always returns an empty list satisfies that requirement. The result is indeed sorted. It just isn’t a useful implementation of the function we intended.

We also needed to say that the result contains the original elements, with their multiplicities preserved. The proof wasn’t wrong. The specification was inadequate.

That distinction is central to Onus. I’m not expecting the compiler to infer all the things I meant but failed to express. I want it to establish the properties I actually specified, and make clear what kind of evidence supports them.

The human still has a difficult job: deciding whether those properties are the right ones.

Contracts are code too. They can be subtle, incomplete and wrong. Moving complexity from a function body into an equally difficult specification would not, by itself, be progress.

The bet is that the properties we care about can often be expressed more clearly, reviewed more economically and retained across many different implementations.

That is a hypothesis to test, not a benefit I get merely by adding an ensures clause.

Proof, checking and assumption are different things

A green build is not a sufficiently detailed account of why something should be trusted.

Onus records obligations in a ledger, distinguishing those established statically, those checked at runtime and those accepted through explicit assumptions. The distinction matters: a runtime check can detect a violation, but it is not a proof that the violation will never occur. An assumption is a dependency on something the checker has not established.

These are not three interchangeable ways of saying “safe”.

For example, the checkout example includes an asserted idempotency claim that ultimately depends, in part, on a payment provider’s promise to deduplicate requests. The compiler tracks the claim and the assumptions supporting it. It does not prove the behaviour of the external payment provider.

That is useful precisely because it refuses to conceal where trust enters the system.

As a reviewer, I might accept an external guarantee under certain conditions. I might require evidence that we exercised it against a test environment. I might reject it for a particularly sensitive operation.

But I need to know that I am making that judgement.

I also need to understand its limits. Testing a provider’s behaviour gives me evidence about the cases tested. It doesn’t transform the provider’s promise into a universal theorem. Detecting an invalid state after an external side effect doesn’t necessarily undo that side effect.

The ledger is intended to support those distinctions, not flatten them into a reassuring badge.

What the human reviews

An individual function is only part of the picture. For requirements that apply across an operation, Onus has path declarations: constraints checked over the functions reachable from an entry point. These can bound effects, require claims and restrict which assumptions are acceptable.

The workbench is where I want those pieces to become a useful review experience.

Its inputs are compiler-produced interfaces, obligation records and path reports. The design is deliberately not another model reading the implementation and producing a plausible explanation. The review tool renders the evidence produced by the checking machinery.

I want a reviewer to see what changed in the terms under which an operation can be accepted. Does it need more authority? Has a behavioural promise weakened? Does something previously proved now require a runtime check? Has an external assumption been introduced? The interface and ledger comparisons are designed to expose those changes.

Those questions are much closer to the decisions I need to make as a CTO than “does this large diff look reasonable?”

They don’t replace judgement. They give judgement a more explicit object.

There is nothing new about contracts, effect systems, capabilities or formal verification individually. Onus draws on existing work in all of those areas. The experiment is in how they fit together around model-written implementations and human approval.

The language is necessary because the review surface needs something enforceable underneath it. The workbench matters because technically sound evidence that a person cannot understand or use is not enough.

Delete the implementation and see what survives

One way to investigate the premise is to deliberately discard implementations.

Onus’s regeneration audit removes bodies from the model’s context and asks it to rebuild them from their interfaces. The intention is to expose behaviour that depended on knowledge held only in the previous implementation.

Suppose the replacement satisfies every stated contract, yet we reject it because it behaves differently in a way that matters.

Perhaps it changes ordering that callers relied on. Perhaps it handles an edge case differently. Perhaps it is functionally correct but operationally too expensive.

We have found something important: our specification did not describe everything we needed to preserve.

That gives us a choice. We can capture the missing requirement, retain another form of evidence for it, or acknowledge that this part of the system still requires implementation review.

A successful regeneration doesn’t prove the specification is complete, either. Two implementations can share the same blind spot. A model may reproduce a convention because it is familiar, not because the interface requires it.

Regeneration is a way to challenge the specification. It is not a certificate of completeness.

Not reading the body is not the success criterion

I am interested in how often I need to open an implementation, and especially why.

If I open one to understand a permission boundary, perhaps the interface is missing something. If I open it to investigate performance, perhaps I need different evidence. If I open it because the report is confusing, that may be a workbench problem rather than a language problem.

But I could also stop opening implementations because the tool made me overconfident.

That would be failure, even if the body-open metric looked excellent.

The harder test is whether I can make good decisions with the evidence available: approve acceptable implementations, reject unacceptable ones, and recognise when the specification itself is insufficient.

That means deliberately looking for implementations which satisfy the stated claims but fail the intended job. It means noticing requirements discovered during operation, not just during review. It means accounting for the time spent writing and maintaining contracts, rather than counting only the time saved reading bodies.

I’m interested in less implementation review where it is justified—not less scrutiny.

The compiler is already written in Onus

The Onus compiler is now written in Onus.

That matters because a compiler is not an example chosen to make a language feature look good. It is a substantial piece of software with its own requirements, complexity and opportunities to get things wrong.

Next, I’ll be building the workbench in Onus.

These are related but different tests. Writing the compiler exercises the language. Building and using the workbench will test the development model: whether the evidence Onus produces is enough to support decisions I’m prepared to stand behind.

The first milestone doesn’t establish the second. A compiler written in Onus isn’t, by itself, proof that the checking machinery is sound, that the contracts capture everything important, or that implementation review can safely be reduced.

But it gives the experiment something substantial to work with.

As I build the workbench, I want to examine the decisions I make. What evidence was enough to approve a change? What made me inspect an implementation? What requirement did I discover only after running the software? Where did a perfectly satisfied contract turn out to describe the wrong thing?

The important result won’t be that I managed to avoid reading code. It will be whether I could make a defensible decision without reading it—and whether that decision held up afterwards.

I don’t yet know how broadly that will work. Finding out is the point.

I’m not building Onus because I dislike coding assistants. I’m building it because I find them compelling, and I want a development process that takes their capabilities—and our responsibilities—seriously.

The model can write the implementation. I still need grounds to sign it off.

Read the whole story
alvinashcraft
3 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

VSCode/VSCodium Hanging on Startup Under COSMIC? Here's the Fix

1 Share

If you’re running Arch Linux with the COSMIC desktop environment and VS Code or VSCodium hangs for a while on launch before eventually crashing, you’re not imagining things it’s a real, reproducible bug.

The symptom

You launch codium (or code), the window either never appears or appears blank, and after roughly 25 seconds to a minute it either crashes outright or has to be killed manually. Nothing obviously useful shows up in journalctl at first glance.

Read the whole story
alvinashcraft
3 minutes ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories