DEV Community

Ryan Huff
Ryan Huff

Posted on Originally published at ryanthomashuff.com

AIM: An OSI-Style Seven-Layer Model for AI Agents (and Where MCP Fits)

This is a condensed cross-post. The full version, with per-layer failure modes, the OSI mapping, a troubleshooting table and sources, lives in the AI Research & Education section of my site at The Agent Interconnection Model (AIM).

The OSI model never really won as a protocol suite. It won big as a way to think, though, and thirty-some years later network folks still say "that's a Layer 2 problem" and everybody in the room knows where to look. I think AI agents need the same kind of shared map.

The Agent Interconnection Model (AIM) is my attempt at one. It runs seven layers from the systems an agent touches up to the person (or agent) asking for the work, with two planes that cut across all of them. It's a working draft and a mental model, not a standard, and I'm not proposing it to anybody. The layer names, the order and where I drew the boundaries are all my opinion.

The seven layers

Numbered bottom to top, like OSI. Each layer consumes the one below it and serves the one above it.

# Layer One-line purpose Data unit Anchor standards today
7 Interaction Where work comes in and results go back out, whether the requester is a person or another agent Task A2A, MCP Apps, chat, IDE, CLI, tickets
6 Reasoning The model and the agent loop that plans, acts, observes and decides what's next Step Model APIs, Open Responses, goose, agent frameworks
5 Context Decides what the model actually sees on this turn Context window AGENTS.md, memory, retrieval, compaction
4 Capability Packaged know-how that teaches an agent how to do a specific job well Skill Agent Skills (SKILL.md folders)
3 Connectivity One standard way to discover and call tools and read data, whatever's behind them Message Model Context Protocol
2 Execution Where code actually runs on the agent's behalf, and with whose credentials Invocation Containers, sandboxes, stdio subprocesses, OpenSandbox
1 Resource The real systems an agent ultimately reads from or changes Record APIs, databases, files, SaaS, network gear

Two planes run vertically through every layer, the Trust plane (identity, authorization, consent, secrets, policy) and the Telemetry plane (tracing, logging, evals, audit, cost).

Remembering the order

OSI has "All People Seem To Need Data Processing." AIM gets the same treatment.

  • Top down, 7 to 1: In Real Change Control, Capture Every Rollback
  • Bottom up, 1 to 7: Real Engineers Check Configs Constantly, Rarely Improvising

The tricky part is the middle, where three C layers sit right next to each other (Context, Capability, Connectivity), so going down it's Change for Context, Control for Capability and Capture for Connectivity. If you'd rather reason it out, top down runs from what the model sees, to what it knows how to do, to what it can reach.

Where MCP sits, and why

MCP lives at Layer 3. Its job is to give any agent host one consistent way to find out what a server offers and then use it. A server can offer tools the model can call, resources for context and data, prompts for templated workflows, and elicitation so it can ask the user for more information. It speaks JSON-RPC 2.0 over stdio for local servers or Streamable HTTP for remote ones, and HTTP deployments use an OAuth 2.1 based authorization flow.

The current spec revision, 2026-07-28, made the core stateless. There's no initialize handshake and no session IDs anymore, so every request carries its own protocol version and capabilities. Over Streamable HTTP, every request carries an Mcp-Method header, and tools/call, resources/read and prompts/get also carry Mcp-Name (the tool or prompt name, or the resource URI), so a gateway can route and authorize without cracking open the body. It also deprecated sampling, roots and logging.

My take is that MCP is the narrow waist of the agent stack, the same way IP is the narrow waist of the internet. There's plenty of churn above it and every API you own sits below it, with one thin, boring standard holding the middle. That's why I don't think MCP is going anywhere.

What MCP deliberately doesn't do matters just as much. It doesn't decide which tool to call (L6), what goes in the context window (L5), how to do a job well (L4), how your code runs safely (L2), or how independent agents coordinate (L7, where A2A lives). The spec itself also says it can't enforce consent, so that part is on implementers to build.

Where Agent Skills fit

A skill is a folder with a SKILL.md file in it. That file starts with YAML frontmatter holding a name and description, followed by plain Markdown instructions, and the folder can carry optional scripts/, references/ and assets/ nested next to it.

change-window-precheck/
├── SKILL.md          # name + description, then instructions
├── scripts/          # code the agent can run      → executes at L2
├── references/       # docs it reads on demand     → feeds L5
└── assets/           # templates, sample data      → feeds L5
Enter fullscreen mode Exit fullscreen mode

(That skill is a made-up example.) A tool is a capability the agent can call, and a skill is the know-how for when and how to use the tools. MCP tells the agent what it can do. A skill tells it how to do it well. Watch out for one thing, though. Skill scripts can run straight at L2 without going through MCP, which skips whatever auth and gateway policy you put at L3. Treat installing a skill like installing software.

Using it

  • Troubleshooting. It's the same playbook as a network outage. Go bottom-up when you suspect the plumbing and top-down when you suspect the ask, or start at L3 and split the problem in half. "Tool not found" or a 401 points at L3, an agent ignoring an instruction is usually L5 (was it actually in the window?), and loops and blown budgets live at L6.
  • Design reviews. Walk a proposed agent up the stack and make somebody answer one question per layer. If a team can't answer a layer, that's your risk register.
  • Security. The useful trust boundaries fall on the layer lines. Credentials stay at L2/L3, skills get reviewed at L4, tool output gets treated as data rather than instructions at L5, and anything irreversible gets a human approval at L7.

Where the OSI analogy breaks

It holds at the top and bottom (Interaction to Application, Resource to Physical) and by role at L3, where MCP plays IP's part as the waist. It breaks down in a few places. There's no strict encapsulation, layers get skipped, whole stacks can hide inside a single tool call, and the reasoning layer isn't deterministic. Nobody blessed this one, either. OSI is ISO/IEC 7498-1, and this is a guy with a website.

Tell me where it breaks

This is version 0.1. The full page at ryanthomashuff.com/ai-research-education/agent-stack has the per-layer details, the OSI mapping table, the open questions and every source. If you think a layer's in the wrong place, I want to hear why.

Top comments (0)