tainanfidelis' blogby Tainan Fidelis

Building Agent-First: The Architecture Behind DevFellowship's Platform Redesign

29 de abril de 2026

Building Agent-First: The Architecture Behind DevFellowship’s Platform Redesign

There’s a moment in every platform’s life where a patch job stops working.

You add a feature, wire it to the existing auth model, ship it. Works. You add another. Works. Somewhere around the fifth or sixth feature, you start noticing the seams. The tables don’t quite fit. The permissions model is doing three jobs. The code that was supposed to be “temporary” is now load-bearing.

That moment came for us at DevFellowship in late 2025.

We had 32 fellows, 5 active pods, and a platform that was built for humans — specifically, for humans in the roles we understood when we started: students, mentors, admins. But by 2025, our platform had a new kind of citizen: AI agents.

Jarvis was handling orchestration and task management inside the learning platform. Wong was curating the knowledge graph. Friday was running CI and infrastructure checks. And every single one of them was a second-class citizen in our own platform. They had no canonical identity. No permissions model. No wallet. They couldn’t receive tasks, make payments, or delegate to each other without a human standing in the middle of every handoff.

The architecture was built for a world that no longer existed.


The Problem: Identity Fragmentation

Here’s what our data layer actually looked like before the redesign:

  • Humans lived in auth.users → public.profiles → public.members
  • AI agents lived in public.agents and workflow_management.agents — two separate tables with different schemas
  • Services (CI bots, webhooks, cron jobs) had no first-class identity at all

Three different identity models for three different entity types. Every time you wanted to ask “who did this?” or “can this entity do that?”, you needed to know which kind of entity you were dealing with first, then query a completely different table.

This is a deeper problem than it looks. It’s not just a code smell. It means your authorization logic branches on entity type at every permission check. Your audit logs are scattered. Your delegation model — if you even have one — is bolt-on.

And when you’re trying to build a platform where AI agents are first-class citizens, not afterthoughts, this fragmentation becomes the ceiling.


The Actor Abstraction

The redesign started with one question: what is the minimal abstraction that lets every entity in the system — human, agent, or service — operate under the same rules?

The answer was an actor.

CREATE TYPE public.actor_type AS ENUM ('human', 'agent', 'service');
 
CREATE TABLE public.actors (
    id           UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    type         public.actor_type NOT NULL,
    display_name TEXT NOT NULL,
    metadata     JSONB NOT NULL DEFAULT '{}',
    created_at   TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at   TIMESTAMPTZ NOT NULL DEFAULT now()
);

Every entity that can do things in the system — create, approve, delegate, comment, trigger, pay — gets exactly one row in actors. The type discriminator tells you what kind of actor it is. The metadata JSONB bag holds whatever is specific to that type.

This is additive. We didn’t drop any existing tables. Humans still live in auth.users. Agents still have their definitions. The actor layer is a link layer on top:

CREATE TABLE public.actor_links (
    id           UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    actor_id     UUID NOT NULL REFERENCES public.actors(id) ON DELETE CASCADE,
    linked_table TEXT NOT NULL,   -- e.g. 'auth.users', 'public.agents'
    linked_id    TEXT NOT NULL,   -- PK in the linked table
    CONSTRAINT uq_actor_links_actor_table UNIQUE (actor_id, linked_table),
    CONSTRAINT uq_actor_links_table_id    UNIQUE (linked_table, linked_id)
);

Every actor can link to one row in any existing table. The constraint at the bottom is the key one: each source row can only be claimed by one actor. No duplicates. No ambiguity.


Delegation-First by Design

The other table that matters is delegation:

CREATE TABLE public.actor_delegations (
    id                  UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    delegator_actor_id  UUID NOT NULL REFERENCES public.actors(id),
    delegate_actor_id   UUID NOT NULL REFERENCES public.actors(id),
    scope               JSONB NOT NULL DEFAULT '{"all": true}',
    expires_at          TIMESTAMPTZ,
    revoked_at          TIMESTAMPTZ,
    CONSTRAINT chk_delegation_not_self CHECK (delegator_actor_id != delegate_actor_id)
);

This table encodes “actor X delegates authority to actor Y within scope S until time T.”

What makes this powerful is what it enables:

  • A human can delegate tasks to an agent
  • An agent can sub-delegate to another agent (chain of trust)
  • Scope is JSONB, so it can express anything: { "all": true }, { "repos": ["dfl-learn"], "actions": ["review", "merge"] }, { "spend_limit_brl": 500 }

When I give Jarvis the authority to open PRs on my behalf, that’s a row in actor_delegations. When Jarvis hands a sub-task to the implementation agent, that’s another row. The chain of trust is auditable, reversible, and scoped.

At DevFellowship I run two parallel agent fleets, both governed by this model. The in-product fleet — Jarvis (orchestration), Wong (knowledge), Friday (DevOps) — serves fellows directly inside the learning platform. The engineering fleet builds and operates the platform itself:

| Agent | Role | Delegation scope | |-------|------|-----------------| | dfl-tech-spec-owner | Technical decomposition, sequencing | Full write on specs | | dev-dfl | Architecture decisions, design authority | Full write on architecture docs | | dfl-single-repo-implementer | Bounded implementation | One repo at a time | | dfl-rollout-ops | Multi-repo fleet work | All repos, read/write | | dfl-verifier | Verification, approval gate | Read + approve/reject |

Five engineering agents. Each with a specific lane. Each capable of delegating to others within that lane. No human in the middle of routine handoffs. The same actor_delegations table governs them all — whether the actor is Jarvis serving a fellow or dfl-verifier approving a PR.


Three Protocols That Made This Possible

The actor model is the internal architecture. But for this architecture to be useful in 2026, it needed to connect to the external world of AI protocols. Three specifically:

1. MCP — The USB-C for AI Agents

Model Context Protocol (MCP), backed by Anthropic and now under the Linux Foundation, hit 10,000 production server deployments with 97 million monthly SDK downloads. It’s the standard interface for tools: your agent connects to an MCP server and gets a menu of capabilities — read this file, query this database, run this test.

In DevFellowship’s architecture, every internal system exposes an MCP server. The learning platform. The code execution sandbox. The review pipeline. Agents don’t need custom integrations into each system — they connect once, via MCP, and the capabilities are discoverable.

One of our early ADRs captured this exactly: Playwright (via MCP server) is now the verification layer for all UI repos. Agents validate their own UI changes in the browser before opening PRs. Human review becomes confirmation, not discovery.

2. A2A — Agent-to-Agent at Scale

Google’s A2A protocol handles agent-to-agent communication across organizational boundaries. This is what lets dfl-tech-spec-owner hand off a decomposed task to dfl-single-repo-implementer without me having to route it manually.

The handoff is structured, typed, and logged. The receiving agent knows the context, the scope of authority delegated, and what “done” looks like. It’s not a chat message. It’s a structured work unit.

3. x402 — Machine-to-Machine Payments

x402, Coinbase’s HTTP payment protocol on Base, has processed over 50 million transactions. This is what closes the loop on autonomous agents: if agents can hold wallets, accept tasks, and get paid for completing them, they become economic actors — not just computational ones.

For DevFellowship, this connects directly to the wallet field on every actor. An agent that verifies a fellow’s project submission can receive a micropayment for the verification. An external developer who reviews a PR via their agent gets paid immediately. ERC-8004, the Trustless Agents Standard going live on Base in early 2026, formalizes exactly this: agents as economic actors with on-chain identity and payment rails.


The Four-Layer Architecture

Put it all together and you get a stack:

Layer 4: Blockchain Settlement  (x402, ERC-8004, Base)
         ↑
Layer 3: Orchestration          (A2A protocol, actor_delegations)
         ↑
Layer 2: Capability Interface   (MCP servers per system)
         ↑
Layer 1: Identity               (actors + actor_links + wallets)

Layer 1 — Identity is the actor table. Everything starts here. You can’t act in the system without an actor ID.

Layer 2 — Capability Interface is the MCP layer. Every system exposes its capabilities through MCP. Agents discover and call those capabilities without custom integrations.

Layer 3 — Orchestration is the delegation and A2A layer. Work moves between actors via structured handoffs, with scope-bounded authority.

Layer 4 — Settlement is blockchain. When a unit of work is complete and payment is owed, x402 handles it without a human approving a wire transfer. The payment is part of the protocol, not a separate process.


Conway’s Law, Inverted

Conway’s Law says your software architecture mirrors your organization’s communication structure. Most teams discover this as a warning: if your team is siloed, your system will be too.

I think about it differently now.

If you design your architecture to treat every actor — human or AI — as a first-class citizen with an identity, a permission scope, and a delegation model, your organization will naturally evolve to match. The humans on your team start to think and operate more like the agents: clear ownership, scoped authority, structured handoffs.

At DevFellowship, the fellows who work alongside the agent roster have gotten noticeably better at scoping their own work. When you see dfl-tech-spec-owner decomposing an epic into bounded, delegatable tasks, it changes how you think about your own work scope. The architecture becomes a mental model for the whole team.

This is not a coincidence. It’s what happens when you design for agents as first-class citizens instead of bolting them on.


What DevFellowship Looks Like Now

Thirty-two fellows. Five pods. Ten agents across two fleets. One actor model holding all of them.

When a fellow submits a project, it goes to Jarvis first — Jarvis is their interface to the platform. On the engineering side, when a platform change is needed, it goes to dfl-verifier for technical review, then dfl-tech-spec-owner to scope it, then dfl-single-repo-implementer to ship it.

I sit at the top of both delegation chains. I delegate to the agents. The agents delegate to each other within their scopes. Every handoff is auditable. Every payment is automatic.

William, our operations lead at Revera — who went from security guard to full-time developer to delivery flow owner — is himself a node in this system. His actor record links to his auth.users row. His delegation scope says he owns Revera’s delivery pipeline. When a client project comes in, the routing logic doesn’t need to ask “is this a human or an agent?” It just routes to the actor with the right capability and the right delegation scope.

This is what agent-first means in practice: not that humans are replaced, but that humans and agents operate under the same rules. Same identity model. Same permission model. Same delegation model.


The LATAM Window

I’m building this in São Paulo. My fellows are mostly Brazilian. The LATAM edtech market is massive and almost entirely untouched by agent-first thinking.

Most edtech companies here are still running the playbook from 2015: content delivery, certificate issuance, completion tracking. They don’t have agent rosters. They don’t have actor abstraction layers. They definitely don’t have on-chain settlement for verified learning.

The window is open. ERC-8004 is going live on Base. MCP is the infrastructure layer. The protocols exist. The economic model works.

DevFellowship’s R$3M revenue target isn’t just about the platform. It’s about proving that a 32-person learning community, augmented by an agent-first architecture, can operate at a leverage ratio that no traditional edtech can match.

We’re not using AI to generate more content faster. We’re using it to operate the entire delivery, verification, and payment infrastructure — while the humans focus on the thing humans are actually irreplaceable at: curiosity, mentorship, judgment.


What’s Next

Phase 4 of the redesign is running now: backfilling the actor layer for all existing users, wiring RLS policies, and building the helper functions that let the rest of the application code stop caring about what kind of actor it’s talking to.

After that: the wallet integration on Base. Every actor gets a custodial wallet on creation. When x402 hits general availability, we flip the switch.

If you’re building something similar — agent-first, actor-based, or just trying to figure out how to give AI agents proper identity in your system — I’d genuinely want to talk. The actor abstraction layer is not complicated. The migration SQL fits in a single file. The hard part was deciding to do it.

Most teams are still patching. We decided to rebuild.


Tainan Fidelis is the founder of DevFellowship, an edtech for developers running on a PBL model with 32 fellows and 5 pods. Also building Pods Finance (DeFi/Web3) and Revera (software consultancy). Won the Base track at ETH Argentina 2024.

Follow on X: @tainanfidelis | Newsletter at tainanfidelis.com

Thanks,
Tainan Fidelis.


Edit on GitHub